Merge remote changes and remove Python cache files

This commit is contained in:
2025-08-15 16:51:58 +00:00
10 changed files with 512 additions and 123 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
# api/models/requests.py
from pydantic import BaseModel
from typing import List,Dict
from typing import List,Dict, Optional
class BaseRequest(BaseModel):
pass
@@ -13,7 +13,7 @@ class ChatMessage(BaseModel):
class ChatRequest(BaseModel):
query: str
history: List[ChatMessage] = []
customer_metadata: Dict = None # Customer info: name, email, phone, user_id
class SurveyRequest(BaseModel):
+9 -2
View File
@@ -23,13 +23,20 @@ async def chat_ai(
logger.info(f"Starting chat request with query: {request.query}")
logger.info(f"History length: {len(request.history)}")
# Extract customer metadata if provided
customer_metadata = request.customer_metadata
if customer_metadata:
logger.info(f"Customer metadata provided: {list(customer_metadata.keys())}")
else:
logger.info("No customer metadata provided")
# Convert to internal Message format
history = [Message(role=msg.role, content=msg.content) for msg in request.history]
logger.info(f"Converted history to internal format: {len(history)} messages")
# Initialize DroneBot with history
# Initialize DroneBot with history and customer metadata
logger.info("Initializing DroneBot...")
bot = DroneBot(history=history, use_openai_as_fallback=True)
bot = DroneBot(history=history, use_openai_as_fallback=True, customer_metadata=customer_metadata)
logger.info("DroneBot initialized successfully")
# Get response from DroneBot