Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
math_tutor_dev
public_math_tutor
Commits
1ddd502e
Commit
1ddd502e
authored
Jan 26, 2026
by
Kantz
Browse files
leichte anpassung in der Hint generierung. KONTEXT wird NICHT beachtet
parent
57c8f712
Changes
2
Hide whitespace changes
Inline
Side-by-side
math-tutor/backend/app/LLM_services/hint_LLM.py
View file @
1ddd502e
...
@@ -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
+=
"
\n
Historie:
\n
"
+
history
+
"
\n
"
prompt
+=
"
\n
Historie:
\n
"
+
history
+
"
\n
"
if
context_sheet
:
prompt
+=
"Halte dich kurz und klar. Gibt nicht die Lösung aus."
prompt
+=
"
\n
Kontextblatt:
\n
"
+
context_sheet
+
"
\n
"
result
=
llm_client
.
chat
(
result
=
llm_client
.
chat
(
messages
=
[{
"role"
:
"user"
,
"content"
:
prompt
}],
messages
=
[{
"role"
:
"user"
,
"content"
:
prompt
}],
...
...
math-tutor/backend/app/deterministic_services/orchestrator.py
View file @
1ddd502e
...
@@ -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
),
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment