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
403696e4
Commit
403696e4
authored
Feb 16, 2026
by
Kantz
Browse files
anpassung des Tools um Laufzeit zu verkürzen
parent
436a6311
Changes
1
Show whitespace changes
Inline
Side-by-side
math-tutor/backend/app/LLM_services/math_intent_LLM.py
View file @
403696e4
import
sympy
as
sp
import
json
from
app.deterministic_services
import
llm_client
...
...
@@ -33,15 +32,20 @@ def sympy_solve(task: str, input: str, symbols: list[str] | None = None) -> str:
SYSTEM
=
"""
Du bist ein Mathe-Assistent.
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 final mit dem vereinfachten Ergebnis (kein Doppelbruch).
Antworte nach folgendem Muster:
"Rechung: <Rechung>
Lösung: <Lösung>"
ODER
"Keine Lösung"
"""
def
solve_with_tools
(
user_text
:
str
,
model
:
str
=
"ministral-3"
)
->
str
:
messages
=
[
{
"role"
:
"system"
,
"content"
:
SYSTEM
},
{
"role"
:
"user"
,
"content"
:
user_text
},
{
"role"
:
"user"
,
"content"
:
user_text
+
"
\n
Antworte mit 'None' falls es in dieser Nachricht KEINE Berechung gibt."
},
]
result
,
tool_outputs
=
llm_client
.
chat_with_tools
(
...
...
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