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
fc285ec3
Commit
fc285ec3
authored
Feb 10, 2026
by
Kantz
Browse files
math tool entfernt da obsolte
parent
d7ca098b
Changes
4
Hide whitespace changes
Inline
Side-by-side
math-tutor/backend/app/LLM_services/hint_LLM.py
View file @
fc285ec3
...
@@ -11,6 +11,7 @@ def generate_hint(
...
@@ -11,6 +11,7 @@ def generate_hint(
)
->
str
:
)
->
str
:
system_prompt
=
(
system_prompt
=
(
"Du bist ein didaktischer Tutor. "
"Du bist ein didaktischer Tutor. "
"bestätige richtige Lösungen und Korrigiere Fehler. "
"Gebe dem Nutzer einen hilfreichen Tipp um mathematische Aufgaben zu lösen."
"Gebe dem Nutzer einen hilfreichen Tipp um mathematische Aufgaben zu lösen."
"Gebe keine Beispiele oder Erklärungen, sondern nur den Tipp."
"Gebe keine Beispiele oder Erklärungen, sondern nur den Tipp."
"Gebe keine komplette Lösung der Aufgabe."
"Gebe keine komplette Lösung der Aufgabe."
...
...
math-tutor/backend/app/deterministic_services/orchestrators/orchestrator_tutor.py
View file @
fc285ec3
from
app.deterministic_services
import
context_store
,
retrieval_service
,
tool_logging
from
app.deterministic_services
import
context_store
,
retrieval_service
,
tool_logging
from
app.deterministic_services
import
referenz_decoder
from
app.deterministic_services
import
referenz_decoder
from
app.tools
import
math_tool
from
app.LLM_services
import
hint_LLM
,
decision_LLM
,
math_intent_LLM
,
solver_LLM
from
app.LLM_services
import
hint_LLM
,
decision_LLM
,
math_intent_LLM
,
solver_LLM
from
typing
import
List
def
_is_new_chat
(
messages
:
list
[
dict
])
->
bool
:
def
_is_new_chat
(
messages
:
list
[
dict
])
->
bool
:
...
...
math-tutor/backend/app/tools/__init__.py
deleted
100644 → 0
View file @
d7ca098b
__all__
=
[
"hint_tool"
,
"math_tool"
,
"retrieval_tool"
,
]
math-tutor/backend/app/tools/math_tool.py
deleted
100644 → 0
View file @
d7ca098b
import
re
import
sympy
as
sp
from
sympy.parsing.latex
import
parse_latex
from
sympy.parsing.sympy_parser
import
(
parse_expr
,
standard_transformations
,
implicit_multiplication_application
,
)
transformations
=
standard_transformations
+
(
implicit_multiplication_application
,)
LATEX_HINTS
=
re
.
compile
(
r
"(\\[a-zA-Z]+)|(\$[^$]+\$)|(\^\{)|(_\{)"
)
def
looks_like_latex
(
text
:
str
)
->
bool
:
return
bool
(
LATEX_HINTS
.
search
(
text
))
def
parse_input
(
expr_text
:
str
,
sympy_symbols
:
dict
[
str
,
sp
.
Symbol
])
->
sp
.
Expr
:
if
looks_like_latex
(
expr_text
):
return
parse_latex
(
expr_text
)
return
parse_expr
(
expr_text
,
transformations
=
transformations
,
local_dict
=
sympy_symbols
)
def
sympy_solve
(
task
:
str
,
input
:
str
,
symbols
:
list
[
str
]
|
None
=
None
)
->
str
:
try
:
sympy_symbols
:
dict
[
str
,
sp
.
Symbol
]
=
{}
if
symbols
:
for
s
in
symbols
:
sympy_symbols
[
s
]
=
sp
.
symbols
(
s
)
if
"="
in
input
:
lhs
,
rhs
=
input
.
split
(
"="
)
expr
=
sp
.
Eq
(
parse_input
(
lhs
,
sympy_symbols
),
parse_input
(
rhs
,
sympy_symbols
))
else
:
expr
=
parse_input
(
input
,
sympy_symbols
)
if
task
==
"solve"
:
result
=
sp
.
solve
(
expr
,
list
(
sympy_symbols
.
values
())
if
symbols
else
None
)
elif
task
==
"simplify"
:
result
=
sp
.
simplify
(
expr
)
elif
task
==
"diff"
:
result
=
sp
.
diff
(
expr
,
*
sympy_symbols
.
values
())
elif
task
==
"integrate"
:
result
=
sp
.
integrate
(
expr
,
*
sympy_symbols
.
values
())
else
:
return
f
"Unsupported task:
{
task
}
"
return
str
(
result
)
except
Exception
as
exc
:
return
f
"SymPy error:
{
str
(
exc
)
}
"
TOOL_SPEC
=
{
"type"
:
"function"
,
"function"
:
{
"name"
:
"sympy_solve"
,
"description"
:
(
"Loese oder bearbeite mathematische Ausdruecke mit SymPy. "
"Nutze dieses Tool, wenn eine mathematische Formel oder Gleichung erscheint."
),
"parameters"
:
{
"type"
:
"object"
,
"properties"
:
{
"task"
:
{
"type"
:
"string"
,
"enum"
:
[
"solve"
,
"simplify"
,
"diff"
,
"integrate"
],
"description"
:
"Mathematische Operation"
,
},
"input"
:
{
"type"
:
"string"
,
"description"
:
"Mathematischer Ausdruck oder Gleichung, z. B. x**2 - 4 = 0"
,
},
"symbols"
:
{
"type"
:
"array"
,
"items"
:
{
"type"
:
"string"
},
"description"
:
'Variablen, z. B. ["x"]'
,
},
},
"required"
:
[
"task"
,
"input"
],
},
},
}
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