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
6ed827f0
Commit
6ed827f0
authored
Feb 05, 2026
by
Kantz
Browse files
box_hint entfernt
parent
051b1b00
Changes
2
Hide whitespace changes
Inline
Side-by-side
math-tutor/README.md
View file @
6ed827f0
...
...
@@ -64,4 +64,4 @@ Retrieval settings:
## Testing
python -m test.hint_test ...
pyhton -m test.vector_store_test ...
\ No newline at end of file
python -m test.vector_store_test --query "Was ist eine Teilmenge?" --k 8 --expand
math-tutor/backend/app/deterministic_services/vector_store.py
View file @
6ed827f0
...
...
@@ -131,7 +131,6 @@ CREATE TABLE IF NOT EXISTS docs (
subsection_title TEXT NULL,
title TEXT NULL,
type TEXT NULL,
box_hint TEXT NULL,
path TEXT NOT NULL,
markdown TEXT NOT NULL,
...
...
@@ -152,12 +151,12 @@ UPSERT_SQL = """
INSERT INTO docs (
uid, doc_type,
section_index, subsection_index, child_index,
section_title, subsection_title, title, type,
box_hint,
section_title, subsection_title, title, type,
path, markdown, embedding
) VALUES (
%(uid)s, %(doc_type)s,
%(section_index)s, %(subsection_index)s, %(child_index)s,
%(section_title)s, %(subsection_title)s, %(title)s, %(type)s,
%(box_hint)s,
%(section_title)s, %(subsection_title)s, %(title)s, %(type)s,
%(path)s, %(markdown)s, %(embedding)s
)
ON CONFLICT (uid) DO UPDATE SET
...
...
@@ -169,7 +168,6 @@ ON CONFLICT (uid) DO UPDATE SET
subsection_title = EXCLUDED.subsection_title,
title = EXCLUDED.title,
type = EXCLUDED.type,
box_hint = EXCLUDED.box_hint,
path = EXCLUDED.path,
markdown = EXCLUDED.markdown,
embedding = EXCLUDED.embedding
...
...
@@ -213,7 +211,6 @@ def upsert_docs(pg_url: str, docs: List[DocRecord], embeddings: List[List[float]
"subsection_title"
:
m
.
get
(
"subsection_title"
),
"title"
:
m
.
get
(
"title"
),
"type"
:
m
.
get
(
"type"
),
"box_hint"
:
m
.
get
(
"box_hint"
),
"path"
:
doc
.
path
,
"markdown"
:
doc
.
markdown
,
"embedding"
:
Vector
(
emb
),
...
...
@@ -294,7 +291,6 @@ def _row_to_retrieved(row: Dict[str, Any]) -> Retrieved:
"subsection_title"
:
row
[
"subsection_title"
],
"title"
:
row
[
"title"
],
"type"
:
row
[
"type"
],
"box_hint"
:
row
[
"box_hint"
],
"path"
:
row
[
"path"
],
}
return
Retrieved
(
...
...
@@ -360,7 +356,7 @@ def retrieve(
SELECT
uid, doc_type,
section_index, subsection_index, child_index,
section_title, subsection_title, title, type,
box_hint,
section_title, subsection_title, title, type,
path, markdown,
1 - (embedding <=> %(qvec)s) AS score
FROM docs
...
...
@@ -402,7 +398,7 @@ def retrieve(
SELECT
d.uid, d.doc_type,
d.section_index, d.subsection_index, d.child_index,
d.section_title, d.subsection_title, d.title, d.type,
d.box_hint,
d.section_title, d.subsection_title, d.title, d.type,
d.path, d.markdown,
1.0 AS score
FROM docs d
...
...
@@ -419,7 +415,7 @@ def retrieve(
SELECT
uid, doc_type,
section_index, subsection_index, child_index,
section_title, subsection_title, title, type,
box_hint,
section_title, subsection_title, title, type,
path, markdown,
1.0 AS score
FROM docs
...
...
@@ -435,7 +431,7 @@ def retrieve(
SELECT
d.uid, d.doc_type,
d.section_index, d.subsection_index, d.child_index,
d.section_title, d.subsection_title, d.title, d.type,
d.box_hint,
d.section_title, d.subsection_title, d.title, d.type,
d.path, d.markdown,
1 - (d.embedding <=> %(qvec)s) AS score
FROM docs d
...
...
@@ -478,7 +474,7 @@ def retrieve(
SELECT
d.uid, d.doc_type,
d.section_index, d.subsection_index, d.child_index,
d.section_title, d.subsection_title, d.title, d.type,
d.box_hint,
d.section_title, d.subsection_title, d.title, d.type,
d.path, d.markdown,
0.9 AS score
FROM docs d
...
...
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