Files
AI-System/main.py
T
2026-07-05 09:18:06 +00:00

53 lines
1.1 KiB
Python

import asyncio
from agent import Agent
from llm.bedrock_client import BedrockClient
from mcp.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.")