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
77c29417
Commit
77c29417
authored
Jan 26, 2026
by
Kantz
Browse files
ollama für LLMs und GWDG für outisde material
parent
d040fafa
Changes
3
Hide whitespace changes
Inline
Side-by-side
math-tutor/backend/app/LLM_services/decision_LLM.py
View file @
77c29417
...
...
@@ -23,7 +23,8 @@ def needs_more_context(history: str, context_sheet: str) -> dict:
messages
=
[
{
"role"
:
"system"
,
"content"
:
CLASSIFIER_PROMPT
},
{
"role"
:
"user"
,
"content"
:
prompt
},
]
],
use_ollama
=
True
,
)
content
=
llm_client
.
get_message_content
(
result
)
try
:
...
...
math-tutor/backend/app/LLM_services/math_intent_LLM.py
View file @
77c29417
...
...
@@ -17,7 +17,8 @@ def extract_math_request(user_text: str) -> dict | None:
messages
=
[
{
"role"
:
"system"
,
"content"
:
MATH_INTENT_PROMPT
},
{
"role"
:
"user"
,
"content"
:
user_text
},
]
],
use_ollama
=
True
,
)
content
=
llm_client
.
get_message_content
(
result
)
try
:
...
...
math-tutor/backend/app/deterministic_services/llm_client.py
View file @
77c29417
...
...
@@ -29,8 +29,12 @@ def _chat_openai(messages: list[dict]) -> dict:
return
{
"raw"
:
response
,
"message"
:
message
}
def
chat
(
messages
:
list
[
dict
],
tools
:
list
[
dict
]
|
None
=
None
)
->
dict
:
if
not
tools
:
def
chat
(
messages
:
list
[
dict
],
tools
:
list
[
dict
]
|
None
=
None
,
use_ollama
:
bool
=
False
,
)
->
dict
:
if
not
tools
and
not
use_ollama
:
openai_result
=
_chat_openai
(
messages
)
if
openai_result
:
return
openai_result
...
...
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