48 lines
921 B
Python
48 lines
921 B
Python
import asyncio
|
|
|
|
from agent import Agent
|
|
from util.logger import get_logger
|
|
|
|
|
|
async def main():
|
|
|
|
log = get_logger("NORA")
|
|
|
|
print("\n==============================")
|
|
print(" N.O.R.A START")
|
|
print("==============================\n")
|
|
|
|
agent = Agent()
|
|
|
|
log.info("Connecting MCP...")
|
|
await agent.mcp.connect()
|
|
|
|
log.info("Loading tools...")
|
|
await agent.load_tools()
|
|
|
|
print("\nN.O.R.A bereit. (exit zum Beenden)\n")
|
|
|
|
while True:
|
|
|
|
try:
|
|
user = input("Du: ").strip()
|
|
|
|
if user.lower() in ["exit", "quit"]:
|
|
break
|
|
|
|
if not user:
|
|
continue
|
|
|
|
response = await agent.run(user)
|
|
|
|
print(f"\nN.O.R.A: {response}\n")
|
|
|
|
except KeyboardInterrupt:
|
|
break
|
|
|
|
except Exception as e:
|
|
log.error(str(e))
|
|
|
|
await agent.mcp.close()
|
|
|
|
log.info("Shutdown complete") |