fixed llm issues with response
This commit is contained in:
@@ -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())
|
||||
Reference in New Issue
Block a user