feat(file-check): 新增文件检核相关 API 和工具,替换 RoHS 检核功能
This commit is contained in:
1 parent
fa0cdee8df
commit
24310b63b3
35 files changed
+3066
-659
No files matched your search
@@ -577,10 +577,10 @@ class DifyService:
|
||||
|
||||
def _resolve_persist_run_id() -> int | None:
|
||||
try:
|
||||
from app.services.rohs_check_tools.agent_resolver import is_rohs_check_chat_agent
|
||||
from app.services.rohs_check_tools.chat_log_run_binding import resolve_run_id_for_chat_log
|
||||
from app.services.file_check_tools.agent_resolver import is_file_check_chat_agent
|
||||
from app.services.file_check_tools.chat_log_run_binding import resolve_run_id_for_chat_log
|
||||
|
||||
if not is_rohs_check_chat_agent(agent):
|
||||
if not is_file_check_chat_agent(agent):
|
||||
return None
|
||||
return resolve_run_id_for_chat_log(
|
||||
session_id=session_id,
|
||||
@@ -604,7 +604,7 @@ class DifyService:
|
||||
if chat_persist_started and event_name == "workflow_finished" and chat_log_id_persisted:
|
||||
run_id = _resolve_persist_run_id()
|
||||
if run_id and run_id != run_id_persisted:
|
||||
from app.services.rohs_check_tools.chat_log_run_binding import update_chat_log_run_id
|
||||
from app.services.file_check_tools.chat_log_run_binding import update_chat_log_run_id
|
||||
|
||||
if update_chat_log_run_id(chat_log_id_persisted, run_id):
|
||||
run_id_persisted = run_id
|
||||
@@ -845,7 +845,7 @@ class DifyService:
|
||||
latency: End-to-end latency in milliseconds.
|
||||
retriever_resources: Source retrieval metadata list.
|
||||
attribution_parts: Attribution/annotation list.
|
||||
run_id: RoHS 检核批次 ID(按轮问答绑定,可选)。
|
||||
run_id: 文件检核批次 ID(按轮问答绑定,可选)。
|
||||
"""
|
||||
try:
|
||||
chat_log = ChatLog(
|
||||
@@ -912,10 +912,10 @@ class DifyService:
|
||||
db_write_started = time.time()
|
||||
run_id = None
|
||||
try:
|
||||
from app.services.rohs_check_tools.agent_resolver import is_rohs_check_chat_agent
|
||||
from app.services.rohs_check_tools.chat_log_run_binding import resolve_run_id_for_chat_log
|
||||
from app.services.file_check_tools.agent_resolver import is_file_check_chat_agent
|
||||
from app.services.file_check_tools.chat_log_run_binding import resolve_run_id_for_chat_log
|
||||
|
||||
if is_rohs_check_chat_agent(agent):
|
||||
if is_file_check_chat_agent(agent):
|
||||
run_id = resolve_run_id_for_chat_log(
|
||||
session_id=session_id,
|
||||
query=query,
|
||||
|
||||
Reference in new issue
Block a user