updated bot chat api
This commit is contained in:
Binary file not shown.
@@ -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
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user