|
@@ -414,8 +414,9 @@ async def chat():
|
|
|
|
|
|
rag_chat_agent = RAGChatAgent()
|
|
rag_chat_agent = RAGChatAgent()
|
|
chat_result = await rag_chat_agent.chat_with_deepseek(query_text, query_results)
|
|
chat_result = await rag_chat_agent.chat_with_deepseek(query_text, query_results)
|
|
|
|
+ study_task_id = None
|
|
if chat_result["status"] == 0:
|
|
if chat_result["status"] == 0:
|
|
- study(query_text)
|
|
|
|
|
|
+ study_task_id = study(query_text)['task_id']
|
|
llm_search = await rag_chat_agent.llm_search(query_text)
|
|
llm_search = await rag_chat_agent.llm_search(query_text)
|
|
decision = await rag_chat_agent.make_decision(chat_result, llm_search)
|
|
decision = await rag_chat_agent.make_decision(chat_result, llm_search)
|
|
data = {
|
|
data = {
|
|
@@ -435,9 +436,9 @@ async def chat():
|
|
llm_search["source"],
|
|
llm_search["source"],
|
|
llm_search["status"],
|
|
llm_search["status"],
|
|
decision["result"],
|
|
decision["result"],
|
|
|
|
+ study_task_id,
|
|
is_web=1,
|
|
is_web=1,
|
|
)
|
|
)
|
|
- # data = {"results": query_results, "chat_res": 'chat_res', 'rag_summary': 'rag_summary', 'llm_summary': 'llm_summary'}
|
|
|
|
return jsonify({"status_code": 200, "detail": "success", "data": data})
|
|
return jsonify({"status_code": 200, "detail": "success", "data": data})
|
|
|
|
|
|
|
|
|
|
@@ -531,8 +532,9 @@ async def rag_search():
|
|
chat_result_mapper = ChatResult(resource.mysql_client)
|
|
chat_result_mapper = ChatResult(resource.mysql_client)
|
|
rag_chat_agent = RAGChatAgent()
|
|
rag_chat_agent = RAGChatAgent()
|
|
chat_result = await rag_chat_agent.chat_with_deepseek(query_text, query_results)
|
|
chat_result = await rag_chat_agent.chat_with_deepseek(query_text, query_results)
|
|
|
|
+ study_task_id = None
|
|
if chat_result["status"] == 0:
|
|
if chat_result["status"] == 0:
|
|
- study(query_text)
|
|
|
|
|
|
+ study_task_id = study(query_text)['task_id']
|
|
llm_search = await rag_chat_agent.llm_search(query_text)
|
|
llm_search = await rag_chat_agent.llm_search(query_text)
|
|
decision = await rag_chat_agent.make_decision(chat_result, llm_search)
|
|
decision = await rag_chat_agent.make_decision(chat_result, llm_search)
|
|
data = {
|
|
data = {
|
|
@@ -551,6 +553,7 @@ async def rag_search():
|
|
llm_search["source"],
|
|
llm_search["source"],
|
|
llm_search["status"],
|
|
llm_search["status"],
|
|
decision["result"],
|
|
decision["result"],
|
|
|
|
+ study_task_id
|
|
)
|
|
)
|
|
return jsonify({"status_code": 200, "detail": "success", "data": data})
|
|
return jsonify({"status_code": 200, "detail": "success", "data": data})
|
|
|
|
|