main.py aktualisiert
This commit is contained in:
@@ -1,65 +1,18 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
from llm import LLM
|
||||
|
||||
|
||||
class Jarvis:
|
||||
def __init__(self):
|
||||
print("\n🤖 Starte Jarvis...\n")
|
||||
|
||||
self.llm = LLM()
|
||||
|
||||
print("✔ Jarvis ist bereit.\n")
|
||||
|
||||
def process(self, text: str):
|
||||
|
||||
text = text.strip()
|
||||
|
||||
if not text:
|
||||
print("⚠ Keine Eingabe erkannt.")
|
||||
return
|
||||
|
||||
if text.lower() in ["exit", "quit", "stop"]:
|
||||
print("\nJarvis: Auf Wiedersehen.")
|
||||
raise SystemExit
|
||||
|
||||
print("\n🧠 Denke...\n")
|
||||
|
||||
try:
|
||||
answer = self.llm.ask(text)
|
||||
|
||||
if not answer:
|
||||
print("⚠ Keine Antwort vom Modell erhalten.")
|
||||
return
|
||||
|
||||
print("🤖 Jarvis:")
|
||||
print(answer)
|
||||
print()
|
||||
|
||||
except Exception as e:
|
||||
print("\n❌ Fehler im LLM:")
|
||||
print(str(e))
|
||||
print()
|
||||
|
||||
from agent import run_agent
|
||||
|
||||
def main():
|
||||
|
||||
jarvis = Jarvis()
|
||||
|
||||
print("=" * 50)
|
||||
print("Jarvis Beta v0 – Chat Mode")
|
||||
print("Tippe 'exit' zum Beenden")
|
||||
print("=" * 50)
|
||||
print("JARVIS gestartet (OpenRouter + MCP)")
|
||||
print("Tippe 'exit' zum Beenden\n")
|
||||
|
||||
while True:
|
||||
try:
|
||||
user_input = input("\nDu: ")
|
||||
jarvis.process(user_input)
|
||||
user = input("Du: ")
|
||||
|
||||
except KeyboardInterrupt:
|
||||
print("\n\nJarvis gestoppt.")
|
||||
if user.lower() in ["exit", "quit"]:
|
||||
break
|
||||
|
||||
response = run_agent(user)
|
||||
|
||||
print("JARVIS:", response)
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user