source/main.py aktualisiert
This commit is contained in:
@@ -116,26 +116,20 @@ def get_system_prompt():
|
|||||||
docker_str = "Ja" if n['docker_installed'] else "Nein"
|
docker_str = "Ja" if n['docker_installed'] else "Nein"
|
||||||
node_info += f"- Name: {n['name']}, IP: {n['ip']}, User: {n['user']}, OS: {n['os']}, Arch: {n['arch']}, Docker: {docker_str}\n"
|
node_info += f"- Name: {n['name']}, IP: {n['ip']}, User: {n['user']}, OS: {n['os']}, Arch: {n['arch']}, Docker: {docker_str}\n"
|
||||||
|
|
||||||
workspace_context = f"""
|
# Datei auslesen
|
||||||
### DEIN WORKSPACE (LOKALER SERVER)
|
|
||||||
Du hast Zugriff auf ein eigenes Arbeitsverzeichnis für Notizen und Aufgaben:
|
|
||||||
- Pfad: {WORKSPACE_DIR}
|
|
||||||
- Notizen: {NOTES_FILE}
|
|
||||||
- Aufgaben: {TODO_FILE}
|
|
||||||
|
|
||||||
Du kannst diese Dateien jederzeit lesen oder beschreiben, um dir Dinge für Tony zu merken.
|
|
||||||
Nutze dazu: <EXECUTE target="localhost">Befehl</EXECUTE>
|
|
||||||
"""
|
|
||||||
# Hier liest du die system_prompt.txt aus config/
|
|
||||||
if PROMPT_FILE.exists():
|
if PROMPT_FILE.exists():
|
||||||
template = PROMPT_FILE.read_text(encoding="utf-8")
|
prompt = PROMPT_FILE.read_text(encoding="utf-8")
|
||||||
else:
|
else:
|
||||||
template = "Du bist J.A.R.V.I.S... {workspace_context}\nNodes: {node_info}"
|
prompt = "Fehler: system_prompt.txt nicht gefunden!"
|
||||||
|
|
||||||
prompt = template.replace("{node_info}", node_info)
|
# Platzhalter durch die echten Pfade ersetzen
|
||||||
prompt = prompt.replace("{workspace_context}", workspace_context)
|
prompt = prompt.replace("{node_info}", node_info)
|
||||||
|
prompt = prompt.replace("{workspace_dir}", str(WORKSPACE_DIR))
|
||||||
|
prompt = prompt.replace("{notes_file}", str(NOTES_FILE))
|
||||||
|
prompt = prompt.replace("{todo_file}", str(TODO_FILE))
|
||||||
|
|
||||||
return prompt
|
return prompt
|
||||||
|
|
||||||
# --- KI FUNKTIONEN ---
|
# --- KI FUNKTIONEN ---
|
||||||
|
|
||||||
async def get_ai_response(user_input, system_prompt):
|
async def get_ai_response(user_input, system_prompt):
|
||||||
|
|||||||
Reference in New Issue
Block a user