Files
ds_drone_bot/test.py
T
2025-08-18 21:21:08 +01:00

45 lines
1.3 KiB
Python

from src.llm.orchestrator import DroneBot, Message # Adjust import path as needed
import json
async def terminal_chat():
print("🚁 DroneBot Terminal Chat")
print("Type 'exit' to quit.\n")
# Initial conversation history
history = []
# Initialize the bot
customer_metadata = {
"customer_name": "John Doe",
"customer_email": "john.doe@example.com",
"customer_phone": "+1-555-0123",
"user_id": "12345"
}
bot = DroneBot(history=[], use_openai_as_fallback=True, customer_metadata=customer_metadata)
# Get initial user input
while True:
user_input = input("👤 You: ")
if user_input.lower() in ("exit", "quit"):
print("👋 Exiting DroneBot. Goodbye!")
break
# Add user message to history
history.append(Message(role="human", content=user_input))
# Update bot's history
bot.history = history
# Get bot response
response = await bot.chat(user_input)
# Add bot response to history
history.append(Message(role="ai", content=json.dumps(response)))
# Print bot response
print(f"🤖 DroneBot: {response}\n")
if __name__ == "__main__":
import asyncio
asyncio.run(terminal_chat())