updated and integrated backedn apis

This commit is contained in:
OwusuBlessing
2025-08-15 17:33:43 +01:00
parent bab442e955
commit 093c212928
17 changed files with 509 additions and 123 deletions
+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