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
781ba659
Commit
781ba659
authored
Feb 12, 2026
by
Kantz
Browse files
verscuht das decision_LLM zu fixen
parent
bc0fbd71
Changes
3
Hide whitespace changes
Inline
Side-by-side
math-tutor/backend/app/LLM_services/decision_LLM.py
View file @
781ba659
...
@@ -36,7 +36,6 @@ def needs_more_context(context_sheet: str) -> dict:
...
@@ -36,7 +36,6 @@ def needs_more_context(context_sheet: str) -> dict:
f
"
{
context_sheet
}
\n\n
"
f
"
{
context_sheet
}
\n\n
"
}
}
)
)
messages
.
append
({
"role"
:
"user"
,
"content"
:
"Treffe eine Entscheidung. Zu der letzten Nachricht"
})
resp
,
tool_outputs
=
llm_client
.
chat_with_tools
(
resp
,
tool_outputs
=
llm_client
.
chat_with_tools
(
messages
=
messages
,
messages
=
messages
,
...
...
math-tutor/backend/app/deterministic_services/llm_client.py
View file @
781ba659
...
@@ -52,7 +52,14 @@ def chat(
...
@@ -52,7 +52,14 @@ def chat(
if
settings
.
temperature
is
not
None
:
if
settings
.
temperature
is
not
None
:
kwargs
[
"options"
]
=
{
"temperature"
:
settings
.
temperature
}
kwargs
[
"options"
]
=
{
"temperature"
:
settings
.
temperature
}
response
=
client
.
chat
(
**
_filter_kwargs
(
client
.
chat
,
kwargs
))
filtered_kwargs
=
_filter_kwargs
(
client
.
chat
,
kwargs
)
if
tools
and
"tools"
not
in
filtered_kwargs
:
raise
RuntimeError
(
"Configured ollama Python client does not support tool calling (chat(..., tools=...)). "
"Update the 'ollama' package or switch to a backend/model path with tool support."
)
response
=
client
.
chat
(
**
filtered_kwargs
)
return
{
"raw"
:
response
,
"message"
:
_extract_message
(
response
)}
return
{
"raw"
:
response
,
"message"
:
_extract_message
(
response
)}
...
...
math-tutor/backend/test/decision_test.py
View file @
781ba659
...
@@ -21,14 +21,6 @@ def _resolve_sheet(args: argparse.Namespace) -> dict[str, Any]:
...
@@ -21,14 +21,6 @@ def _resolve_sheet(args: argparse.Namespace) -> dict[str, Any]:
return
sheet
return
sheet
raise
ValueError
(
"Bitte --sheet oder --chat-id angeben."
)
raise
ValueError
(
"Bitte --sheet oder --chat-id angeben."
)
def
_last_user_inputs
(
history
:
list
[
dict
[
str
,
Any
]],
count
:
int
)
->
list
[
str
]:
if
count
<=
0
:
return
[]
user_msgs
=
[
msg
.
get
(
"content"
,
""
)
for
msg
in
history
if
msg
.
get
(
"role"
)
==
"user"
]
return
[
text
for
text
in
user_msgs
[
-
count
:]
if
text
]
def
main
()
->
None
:
def
main
()
->
None
:
parser
=
argparse
.
ArgumentParser
(
description
=
"Isolierter Decision-LLM Test mit Context Sheet."
)
parser
=
argparse
.
ArgumentParser
(
description
=
"Isolierter Decision-LLM Test mit Context Sheet."
)
parser
.
add_argument
(
"--sheet"
,
help
=
"Pfad zu einem Context Sheet JSON."
)
parser
.
add_argument
(
"--sheet"
,
help
=
"Pfad zu einem Context Sheet JSON."
)
...
...
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