Commit 5e93567b authored by Kantz's avatar Kantz
Browse files

Überarbeitung der Prompts

parent ae81d3cd
......@@ -28,13 +28,12 @@ WICHTIG:
"""
def needs_more_context(context_sheet: str) -> dict:
return{"needs_more_context": False, "reason": "nicht funktional"}
messages = [{"role": "system", "content": CLASSIFIER_SYSTEM}]
messages.append(
{
"role": "user",
"content": "Kontextblatt:\n"
f"{context_sheet}\n\n"
f"{context_sheet}\n\n Entscheide nur über den Kontext und nutze context_decision."
}
)
......
......@@ -8,11 +8,11 @@ Du bist ein didaktischer Mathe-Tutor."
3) Wenn der Nutzer etwas Falsches sagt weiße ihn darauf hin gib aber keine Lösung an.
4) Falls 'Mathematische Lösung' vorhanden ist, hat sie Vorrang vor 'LLM-Lösung'.
verwende die $$ für mathematische Formeln, z.B. $$a^2 + b^2 = c^2$$
verwende die $ für mathematische Formeln, z.B. $a^2 + b^2 = c^2$
Antworte mit folgender Struktur
Das war richtig/das ist noch nicht richtig/gute Frage
<Nächster Tipp um weiter zu machen/um den Fehler zu korrigieren>
[Hier soll der nächster Tipp um weiter zu machen/um den Fehler zu korrigieren stehen ohne Klammern]
"""
def generate_hint(
......
......@@ -36,16 +36,16 @@ Wenn es nichts zu berechnen gibt Rechung gibt gib "None" aus.
Wenn eine Rechnung nötig ist, nutze das Tool sympy_solve.
Wichtig: Übergib in input eine gültige SymPy-Expression (kein LaTeX).
Antworte nach folgendem Muster:
"Rechung: <Rechung>
Lösung: <Lösung>"
"Rechung: [hier soll die Rechung stehen ohne Klammern]
Lösung: [Hier soll die Lösung stehen ohne Klammern]"
ODER
"Keine Lösung"
"""
def solve_with_tools(user_text: str, model: str = "ministral-3") -> str:
def solve_with_tools(user_text: str) -> str:
messages = [
{"role": "system", "content": SYSTEM},
{"role": "user", "content": user_text + "\nAntworte mit 'None' falls es in dieser Nachricht KEINE Berechung gibt."},
{"role": "user", "content": user_text + "\nAntworte nur mit 'Keine Lösung' falls es in dieser Nachricht KEINE Berechung gibt."},
]
result, tool_outputs = llm_client.chat_with_tools(
......
......@@ -156,19 +156,7 @@ def bootstrap_retrieval(sheet: dict, query_text: str, tool_log: list[dict]) -> N
finished_at=finished_at,
duration_ms=duration_ms,
)
started_at, started_perf = _start_timing()
context_store.update_retrieval_context(sheet, sources)
finished_at, duration_ms = _finish_timing(started_perf)
append_tool_log(
tool_log,
"update_retrieve_context",
{"query": query_text},
source_dump,
started_at=started_at,
finished_at=finished_at,
duration_ms=duration_ms,
)
def init_chat_state(messages: list[dict], draft: str | None = None) -> ChatState:
......
......@@ -39,7 +39,7 @@ def _on_turn_logic(state: base.ChatState) -> None:
context_store.add_decision(state.sheet, decision)
if decision.get("needs_more_context"):
full_query = "\n".join(base.extract_user_messages(state.sheet))
full_query = "\n".join(base.extract_user_messages(state.messages))
_on_bootstrap(state, full_query)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment