|
@@ -18,7 +18,7 @@ from applications.config import (
|
|
)
|
|
)
|
|
from applications.resource import get_resource_manager
|
|
from applications.resource import get_resource_manager
|
|
from applications.search import HybridSearch
|
|
from applications.search import HybridSearch
|
|
-from applications.utils.chat import ChatClassifier
|
|
|
|
|
|
+from applications.utils.chat import RAGChatAgent
|
|
from applications.utils.mysql import Dataset, Contents, ContentChunks, ChatResult
|
|
from applications.utils.mysql import Dataset, Contents, ContentChunks, ChatResult
|
|
|
|
|
|
server_bp = Blueprint("api", __name__, url_prefix="/api")
|
|
server_bp = Blueprint("api", __name__, url_prefix="/api")
|
|
@@ -397,10 +397,10 @@ async def chat():
|
|
dataset_name = datasets[0]["name"]
|
|
dataset_name = datasets[0]["name"]
|
|
result["datasetName"] = dataset_name
|
|
result["datasetName"] = dataset_name
|
|
|
|
|
|
- chat_classifier = ChatClassifier()
|
|
|
|
- chat_res = await chat_classifier.chat_with_deepseek(query_text, query_results)
|
|
|
|
- deepseek_search = await chat_classifier.search_with_deepseek(query_text)
|
|
|
|
- select = await chat_classifier.select_with_deepseek(chat_res, deepseek_search)
|
|
|
|
|
|
+ rag_chat_agent = RAGChatAgent()
|
|
|
|
+ chat_res = await rag_chat_agent.chat_with_deepseek(query_text, query_results)
|
|
|
|
+ deepseek_search = await rag_chat_agent.search_with_deepseek(query_text)
|
|
|
|
+ select = await rag_chat_agent.select_with_deepseek(chat_res, deepseek_search)
|
|
data = {"results": query_results, "chat_res": select["result"]}
|
|
data = {"results": query_results, "chat_res": select["result"]}
|
|
await chat_result_mapper.insert_chat_result(
|
|
await chat_result_mapper.insert_chat_result(
|
|
query_text,
|
|
query_text,
|