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
4406f4f2
Commit
4406f4f2
authored
Jan 29, 2026
by
Kantz
Browse files
new chat check verschoben
parent
4c15ecde
Changes
2
Hide whitespace changes
Inline
Side-by-side
math-tutor/backend/app/deterministic_services/context_store.py
View file @
4406f4f2
...
...
@@ -17,10 +17,6 @@ def _utc_now() -> str:
return
datetime
.
now
().
strftime
(
"%Y-%m-%dT%H:%M:%SZ"
)
def
is_new_chat
(
messages
:
list
[
dict
])
->
bool
:
return
not
any
(
m
.
get
(
"role"
)
==
"assistant"
for
m
in
messages
)
def
get_chat_id
(
messages
:
list
[
dict
],
draft
:
str
|
None
=
None
)
->
str
:
if
draft
:
return
f
"draft_
{
draft
}
"
...
...
math-tutor/backend/app/deterministic_services/orchestrator.py
View file @
4406f4f2
...
...
@@ -4,6 +4,9 @@ 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
:
return
not
any
(
m
.
get
(
"role"
)
==
"assistant"
for
m
in
messages
)
def
_append_tool_log
(
tool_log
:
list
[
dict
],
name
:
str
,
args
:
dict
,
response
:
object
)
->
None
:
tool_log
.
append
({
"name"
:
name
,
"arguments"
:
args
,
"response"
:
response
})
...
...
@@ -57,7 +60,7 @@ def run_chat(messages: list[dict], draft: str | None = None) -> dict:
# Context Store Mangement
chat_id
=
context_store
.
get_chat_id
(
messages
,
draft
=
draft
)
new_chat
=
context_store
.
is_new_chat
(
messages
)
new_chat
=
_
is_new_chat
(
messages
)
sheet
=
context_store
.
load_sheet
(
chat_id
)
if
new_chat
or
not
sheet
:
sheet
=
context_store
.
init_sheet
(
chat_id
,
messages
)
...
...
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