Files
AI-System/main.py
T
2026-07-04 14:31:50 +02:00

66 lines
1.3 KiB
Python
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/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()
def main():
jarvis = Jarvis()
print("=" * 50)
print("Jarvis Beta v0 Chat Mode")
print("Tippe 'exit' zum Beenden")
print("=" * 50)
while True:
try:
user_input = input("\nDu: ")
jarvis.process(user_input)
except KeyboardInterrupt:
print("\n\nJarvis gestoppt.")
break
if __name__ == "__main__":
main()