updated bot chat api

This commit is contained in:
OwusuBlessing
2025-08-11 23:16:48 +01:00
parent a185815e24
commit 9952eeda71
8 changed files with 127 additions and 7 deletions
Binary file not shown.
+1 -3
View File
@@ -3,10 +3,8 @@ from pydantic import BaseModel
from typing import Dict
class ChatResponse(BaseModel):
status: str
message: str
message: Dict
class SurveyAgentResponse(BaseModel):
status: str
result: Dict
Binary file not shown.
+3 -4
View File
@@ -25,13 +25,12 @@ async def chat_ai(
# Initialize DroneBot with history
bot = DroneBot(history=history, use_openai_as_fallback=True)
# Get response
result = bot.chat(request.query)
message = json.loads(result["final_message"])
print(result)
return ChatResponse(
status="success",
message=result["final_message"]
message=message
)
except Exception as e:
raise HTTPException(