fixed llm issues with response

This commit is contained in:
OwusuBlessing
2025-08-18 21:21:08 +01:00
parent 3e7a300eef
commit 02852b2992
5 changed files with 188 additions and 41 deletions
+7 -7
View File
@@ -1,7 +1,6 @@
# terminal_chat.py
from src.llm.orchestrator import DroneBot, Message # Adjust import path as needed
import json
def terminal_chat():
async def terminal_chat():
print("🚁 DroneBot Terminal Chat")
print("Type 'exit' to quit.\n")
@@ -31,15 +30,16 @@ def terminal_chat():
bot.history = history
# Get bot response
response = bot.chat(user_input)
response = await bot.chat(user_input)
# Add bot response to history
history.append(Message(role="ai", content=response["final_message"]))
history.append(Message(role="ai", content=json.dumps(response)))
# Print bot response
response_json = json.loads(response["final_message"])
print(f"🤖 DroneBot: {response_json}\n")
print(f"🤖 DroneBot: {response}\n")
if __name__ == "__main__":
terminal_chat()
import asyncio
asyncio.run(terminal_chat())