Commit 1ddd502e authored by Kantz's avatar Kantz
Browse files

leichte anpassung in der Hint generierung. KONTEXT wird NICHT beachtet

parent 57c8f712
...@@ -9,8 +9,9 @@ def generate_hint( ...@@ -9,8 +9,9 @@ def generate_hint(
) -> str: ) -> str:
prompt = ( prompt = (
"Du bist ein didaktischer Tutor. " "Du bist ein didaktischer Tutor. "
"Gib einen naechsten hilfreichen Hinweis, gib auf keinen Fall eine Lösung aus. Wiederhole nicht den Kontex" "Schaue dir Aufgabe, die dazugehörige Lösung und die bisherige Historie an."
"Halte dich kurz und klar.\n\n" "Entscheide basierend darauf was der nächste Schritt ist den der Nutzer machen muss um zur Lösung zu kommne"
"Schreibe einen kurzen und klaren Tipp zum nächsten Schritt"
"Aufgabe:\n" "Aufgabe:\n"
+ task + task
+ "\n\n" + "\n\n"
...@@ -20,8 +21,7 @@ def generate_hint( ...@@ -20,8 +21,7 @@ def generate_hint(
) )
if history: if history:
prompt += "\nHistorie:\n" + history + "\n" prompt += "\nHistorie:\n" + history + "\n"
if context_sheet: prompt += "Halte dich kurz und klar. Gibt nicht die Lösung aus."
prompt += "\nKontextblatt:\n" + context_sheet + "\n"
result = llm_client.chat( result = llm_client.chat(
messages=[{"role": "user", "content": prompt}], messages=[{"role": "user", "content": prompt}],
......
...@@ -34,6 +34,7 @@ def _bootstrap_context(sheet: dict, query_text: str, tool_log: list[dict]) -> No ...@@ -34,6 +34,7 @@ def _bootstrap_context(sheet: dict, query_text: str, tool_log: list[dict]) -> No
def run_chat(messages: list[dict], draft: str | None = None) -> dict: def run_chat(messages: list[dict], draft: str | None = None) -> dict:
# Input-Fehlerbehandlung
if not messages: if not messages:
raise ValueError("messages required") raise ValueError("messages required")
...@@ -41,6 +42,7 @@ def run_chat(messages: list[dict], draft: str | None = None) -> dict: ...@@ -41,6 +42,7 @@ def run_chat(messages: list[dict], draft: str | None = None) -> dict:
if not last_user: if not last_user:
raise ValueError("last user message required") raise ValueError("last user message required")
# Context Store Mangement
chat_id = context_store.get_chat_id(messages, draft=draft) chat_id = context_store.get_chat_id(messages, draft=draft)
new_chat = context_store.is_new_chat(messages) new_chat = context_store.is_new_chat(messages)
sheet = context_store.load_sheet(chat_id) sheet = context_store.load_sheet(chat_id)
...@@ -63,6 +65,7 @@ def run_chat(messages: list[dict], draft: str | None = None) -> dict: ...@@ -63,6 +65,7 @@ def run_chat(messages: list[dict], draft: str | None = None) -> dict:
_bootstrap_context(sheet, last_user.get("content", ""), tool_log) _bootstrap_context(sheet, last_user.get("content", ""), tool_log)
sheet_text = context_store.format_sheet(sheet) sheet_text = context_store.format_sheet(sheet)
# Hinweis und Ausgaben generierung
hint_args = { hint_args = {
"task": last_user.get("content", ""), "task": last_user.get("content", ""),
"solution": context_store.latest_math_solution(sheet), "solution": context_store.latest_math_solution(sheet),
......
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