main.py gelöscht
This commit is contained in:
@@ -1,61 +0,0 @@
|
||||
import asyncio
|
||||
import os
|
||||
from dotenv import load_dotenv
|
||||
|
||||
from agent import Agent
|
||||
from util.logger import get_logger
|
||||
|
||||
load_dotenv()
|
||||
|
||||
# Konfiguration
|
||||
AWS_REGION = os.getenv("AWS_REGION")
|
||||
AWS_ACCESS_KEY_ID = os.getenv("AWS_ACCESS_KEY_ID")
|
||||
AWS_SECRET_ACCESS_KEY = os.getenv("AWS_SECRET_ACCESS_KEY")
|
||||
BEDROCK_MODEL = os.getenv("BEDROCK_MODEL")
|
||||
MCP_URL = os.getenv("MCP_URL")
|
||||
|
||||
|
||||
async def main():
|
||||
log = get_logger("NORA")
|
||||
|
||||
print("\n" + "="*40)
|
||||
print(" N.O.R.A START")
|
||||
print("="*40 + "\n")
|
||||
|
||||
agent = Agent()
|
||||
|
||||
try:
|
||||
log.info("Connecting to MCP...")
|
||||
await agent.mcp.connect()
|
||||
|
||||
log.info("Loading tools...")
|
||||
await agent.load_tools()
|
||||
|
||||
print("N.O.R.A ist bereit. (Schreibe 'exit' oder 'quit' zum Beenden)\n")
|
||||
|
||||
while True:
|
||||
try:
|
||||
user = input("Du: ").strip()
|
||||
|
||||
if user.lower() in ["exit", "quit", "bye"]:
|
||||
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(f"Fehler in Main-Loop: {e}")
|
||||
print("Ein Fehler ist aufgetreten. Bitte versuche es erneut.")
|
||||
|
||||
finally:
|
||||
await agent.mcp.close()
|
||||
log.info("Shutdown complete")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(main())
|
||||
Reference in New Issue
Block a user