53 lines
1.1 KiB
Python
53 lines
1.1 KiB
Python
import asyncio
|
|
|
|
from agent import Agent
|
|
from llm.bedrock_client import BedrockClient
|
|
from client import MCPClient
|
|
|
|
|
|
async def main():
|
|
print("\n==============================")
|
|
print(" JARVIS START")
|
|
print("==============================\n")
|
|
|
|
# 🧠 LLM (AWS Bedrock Nova)
|
|
llm = BedrockClient()
|
|
|
|
# 🤖 Agent
|
|
agent = Agent(llm)
|
|
|
|
# 🔌 MCP CONNECT (OpenHAB Remote)
|
|
await agent.mcp.connect()
|
|
|
|
# 🧠 Tools laden
|
|
await agent.load_tools()
|
|
|
|
print("\n[JARVIS] System bereit. Tippe 'exit' zum Beenden.\n")
|
|
|
|
while True:
|
|
try:
|
|
user_input = input("Du: ").strip()
|
|
|
|
if user_input.lower() in ["exit", "quit"]:
|
|
break
|
|
|
|
if not user_input:
|
|
continue
|
|
|
|
response = await agent.run(user_input)
|
|
|
|
print(f"\nJARVIS: {response}\n")
|
|
|
|
except KeyboardInterrupt:
|
|
break
|
|
|
|
except Exception as e:
|
|
print(f"\n[ERROR] {e}\n")
|
|
|
|
# 🧹 Cleanup
|
|
try:
|
|
await agent.mcp.close()
|
|
except:
|
|
pass
|
|
|
|
print("\n[JARVIS] Shutdown abgeschlossen.") |