add mcp server
This commit is contained in:
parent
29697f6274
commit
46ec8c7fe3
8 changed files with 1665 additions and 17 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import json
|
||||
import httpx
|
||||
from typing import Dict, Any, List, Optional
|
||||
from ..config import settings
|
||||
|
|
@ -111,14 +112,17 @@ class ChatService:
|
|||
|
||||
chat_response = await self.send_message(session_id, message)
|
||||
history = await self.get_chat_history(session_id)
|
||||
|
||||
sources = self._extract_sources_from_response(chat_response.get("message", ""))
|
||||
|
||||
ai_response = json.loads(chat_response.get("message", {}))
|
||||
ai_message = ai_response.get("message", "")
|
||||
hooks = ai_response.get("hooks", [])
|
||||
|
||||
return {
|
||||
"session_id": session_id,
|
||||
"answer": chat_response.get("message", "No response received"),
|
||||
"sources": sources,
|
||||
"history": history
|
||||
"answer": ai_message,
|
||||
"sources": [],
|
||||
"history": history,
|
||||
"hooks": hooks,
|
||||
}
|
||||
|
||||
except Exception as e:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue