xueyiming vor 1 Woche
Ursprung
Commit
23e73a5d5b

+ 2 - 2
applications/utils/chat/__init__.py

@@ -1,4 +1,4 @@
-from applications.utils.chat.chat_classifier import ChatClassifier
+from applications.utils.chat.rag_chat_agent import RAGChatAgent
 
 
-__all__ = ["ChatClassifier"]
+__all__ = ["RAGChatAgent"]

+ 1 - 1
applications/utils/chat/chat_classifier.py → applications/utils/chat/rag_chat_agent.py

@@ -4,7 +4,7 @@ from applications.config import Chunk
 from applications.api import fetch_deepseek_completion
 
 
-class ChatClassifier:
+class RAGChatAgent:
     @staticmethod
     def generate_summary_prompt(query, search_results):
         """

+ 5 - 5
mcp_server/server.py

@@ -6,7 +6,7 @@ import mcp.types as types
 from mcp.server.lowlevel import Server
 
 from applications.resource import get_resource_manager
-from applications.utils.chat import ChatClassifier
+from applications.utils.chat import RAGChatAgent
 from applications.utils.mysql import ChatResult
 from routes.buleprint import query_search
 
@@ -63,10 +63,10 @@ async def rag_search(query_text: str) :
 
     resource = get_resource_manager()
     chat_result_mapper = ChatResult(resource.mysql_client)
-    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 = {
         "result": select["result"],
         "status": select["status"],

+ 5 - 5
routes/buleprint.py

@@ -18,7 +18,7 @@ from applications.config import (
 )
 from applications.resource import get_resource_manager
 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
 
 server_bp = Blueprint("api", __name__, url_prefix="/api")
@@ -397,10 +397,10 @@ async def chat():
             dataset_name = datasets[0]["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"]}
     await chat_result_mapper.insert_chat_result(
         query_text,