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
9bd364f5
Commit
9bd364f5
authored
Feb 10, 2026
by
Kantz
Browse files
anpassung, das auch suhbseciton und section als source-type angezeigt werden
parent
2bcba69b
Changes
1
Show whitespace changes
Inline
Side-by-side
math-tutor/backend/app/deterministic_services/vector_store.py
View file @
9bd364f5
...
@@ -301,7 +301,7 @@ class SourceID(BaseModel):
...
@@ -301,7 +301,7 @@ class SourceID(BaseModel):
return
f
"[
{
string_rep
}
|
{
self
.
doc_type
}
]"
return
f
"[
{
string_rep
}
|
{
self
.
doc_type
}
]"
def
_row_to_retrieved
(
row
:
Dict
[
str
,
Any
])
->
Retrieved
:
def
_row_to_retrieved
(
row
:
Dict
[
str
,
Any
]
,
source_type
:
Optional
[
str
]
=
None
)
->
Retrieved
:
meta
=
{
meta
=
{
"uid"
:
row
[
"uid"
],
"uid"
:
row
[
"uid"
],
"doc_type"
:
row
[
"doc_type"
],
"doc_type"
:
row
[
"doc_type"
],
...
@@ -311,7 +311,7 @@ def _row_to_retrieved(row: Dict[str, Any]) -> Retrieved:
...
@@ -311,7 +311,7 @@ def _row_to_retrieved(row: Dict[str, Any]) -> Retrieved:
"section_title"
:
row
[
"section_title"
],
"section_title"
:
row
[
"section_title"
],
"subsection_title"
:
row
[
"subsection_title"
],
"subsection_title"
:
row
[
"subsection_title"
],
"title"
:
row
[
"title"
],
"title"
:
row
[
"title"
],
"source_type"
:
row
[
"source_type"
],
"source_type"
:
row
[
"source_type"
]
or
source_type
,
"path"
:
row
[
"path"
],
"path"
:
row
[
"path"
],
}
}
return
Retrieved
(
return
Retrieved
(
...
@@ -429,7 +429,7 @@ def retrieve(
...
@@ -429,7 +429,7 @@ def retrieve(
"""
,
"""
,
{
"sec"
:
most_common_sec
,
"sub"
:
most_common_sub
,
"sub_doc_types"
:
[
"subsection"
,
"chapter"
]},
{
"sec"
:
most_common_sec
,
"sub"
:
most_common_sub
,
"sub_doc_types"
:
[
"subsection"
,
"chapter"
]},
)
)
subsections
=
[
_row_to_retrieved
(
row
)
for
row
in
cur
.
fetchall
()]
subsections
=
[
_row_to_retrieved
(
row
,
source_type
=
"subsection"
)
for
row
in
cur
.
fetchall
()]
cur
.
execute
(
cur
.
execute
(
"""
"""
...
@@ -445,7 +445,7 @@ def retrieve(
...
@@ -445,7 +445,7 @@ def retrieve(
"""
,
"""
,
{
"sec"
:
most_common_sec
,
"sec_doc_types"
:
[
"section"
,
"oberchapter"
]},
{
"sec"
:
most_common_sec
,
"sec_doc_types"
:
[
"section"
,
"oberchapter"
]},
)
)
sections_docs
=
[
_row_to_retrieved
(
row
)
for
row
in
cur
.
fetchall
()]
sections_docs
=
[
_row_to_retrieved
(
row
,
source_type
=
"section"
)
for
row
in
cur
.
fetchall
()]
cur
.
execute
(
cur
.
execute
(
"""
"""
...
...
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