调整PGSQL相关代码逻辑
This commit is contained in:
@@ -7,7 +7,7 @@ import pandas as pd
|
||||
|
||||
import sys
|
||||
sys.path.append(os.getcwd())
|
||||
from rag2_0.dify.dify_tool import PgSql, DifyTool
|
||||
from rag2_0.dify.dify_tool import DifyTool
|
||||
import requests
|
||||
|
||||
|
||||
@@ -38,7 +38,6 @@ class DifyExporter:
|
||||
self.end_date = datetime.datetime.strptime(end_date, "%Y-%m-%d %H") if end_date else None
|
||||
|
||||
# 初始化工具类
|
||||
self.dify_pgsql = PgSql()
|
||||
self.dify_tool = DifyTool()
|
||||
|
||||
# 初始化数据存储
|
||||
@@ -237,7 +236,7 @@ class DifyExporter:
|
||||
else:
|
||||
wiki_list = list(set(wiki_list))
|
||||
wiki_list_str = "\n".join(wiki_list)
|
||||
rating = self.dify_pgsql.get_message_rating(msg_id)
|
||||
rating = self.dify_tool.get_message_rating(msg_id)
|
||||
|
||||
# 从HTTP服务获取query_type
|
||||
workflow_run_id = message['workflow_run_id']
|
||||
@@ -266,9 +265,9 @@ class DifyExporter:
|
||||
Returns:
|
||||
处理后的消息信息列表
|
||||
"""
|
||||
conversations = self.dify_pgsql.get_app_conversations(appid=self.app_id)
|
||||
conversations = self.dify_tool.get_app_conversations(appid=self.app_id)
|
||||
for conversation in conversations:
|
||||
messages = self.dify_pgsql.get_conversation_messages(conversation_id=conversation['conversation_id'])
|
||||
messages = self.dify_tool.get_conversation_messages(conversation_id=conversation['conversation_id'])
|
||||
message_chain_new = self.process_message_chain(messages)
|
||||
if len(message_chain_new) != len(messages):
|
||||
print(f"过滤了{len(messages) - len(message_chain_new)}条消息,会话ID:{conversation['conversation_id']}")
|
||||
|
||||
Reference in New Issue
Block a user