Commit 6ed827f0 authored by Kantz's avatar Kantz
Browse files

box_hint entfernt

parent 051b1b00
...@@ -64,4 +64,4 @@ Retrieval settings: ...@@ -64,4 +64,4 @@ Retrieval settings:
## Testing ## Testing
python -m test.hint_test ... python -m test.hint_test ...
pyhton -m test.vector_store_test ... python -m test.vector_store_test --query "Was ist eine Teilmenge?" --k 8 --expand
\ No newline at end of file
...@@ -131,7 +131,6 @@ CREATE TABLE IF NOT EXISTS docs ( ...@@ -131,7 +131,6 @@ CREATE TABLE IF NOT EXISTS docs (
subsection_title TEXT NULL, subsection_title TEXT NULL,
title TEXT NULL, title TEXT NULL,
type TEXT NULL, type TEXT NULL,
box_hint TEXT NULL,
path TEXT NOT NULL, path TEXT NOT NULL,
markdown TEXT NOT NULL, markdown TEXT NOT NULL,
...@@ -152,12 +151,12 @@ UPSERT_SQL = """ ...@@ -152,12 +151,12 @@ UPSERT_SQL = """
INSERT INTO docs ( INSERT INTO docs (
uid, doc_type, uid, doc_type,
section_index, subsection_index, child_index, section_index, subsection_index, child_index,
section_title, subsection_title, title, type, box_hint, section_title, subsection_title, title, type,
path, markdown, embedding path, markdown, embedding
) VALUES ( ) VALUES (
%(uid)s, %(doc_type)s, %(uid)s, %(doc_type)s,
%(section_index)s, %(subsection_index)s, %(child_index)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 %(path)s, %(markdown)s, %(embedding)s
) )
ON CONFLICT (uid) DO UPDATE SET ON CONFLICT (uid) DO UPDATE SET
...@@ -169,7 +168,6 @@ ON CONFLICT (uid) DO UPDATE SET ...@@ -169,7 +168,6 @@ ON CONFLICT (uid) DO UPDATE SET
subsection_title = EXCLUDED.subsection_title, subsection_title = EXCLUDED.subsection_title,
title = EXCLUDED.title, title = EXCLUDED.title,
type = EXCLUDED.type, type = EXCLUDED.type,
box_hint = EXCLUDED.box_hint,
path = EXCLUDED.path, path = EXCLUDED.path,
markdown = EXCLUDED.markdown, markdown = EXCLUDED.markdown,
embedding = EXCLUDED.embedding embedding = EXCLUDED.embedding
...@@ -213,7 +211,6 @@ def upsert_docs(pg_url: str, docs: List[DocRecord], embeddings: List[List[float] ...@@ -213,7 +211,6 @@ def upsert_docs(pg_url: str, docs: List[DocRecord], embeddings: List[List[float]
"subsection_title": m.get("subsection_title"), "subsection_title": m.get("subsection_title"),
"title": m.get("title"), "title": m.get("title"),
"type": m.get("type"), "type": m.get("type"),
"box_hint": m.get("box_hint"),
"path": doc.path, "path": doc.path,
"markdown": doc.markdown, "markdown": doc.markdown,
"embedding": Vector(emb), "embedding": Vector(emb),
...@@ -294,7 +291,6 @@ def _row_to_retrieved(row: Dict[str, Any]) -> Retrieved: ...@@ -294,7 +291,6 @@ def _row_to_retrieved(row: Dict[str, Any]) -> Retrieved:
"subsection_title": row["subsection_title"], "subsection_title": row["subsection_title"],
"title": row["title"], "title": row["title"],
"type": row["type"], "type": row["type"],
"box_hint": row["box_hint"],
"path": row["path"], "path": row["path"],
} }
return Retrieved( return Retrieved(
...@@ -360,7 +356,7 @@ def retrieve( ...@@ -360,7 +356,7 @@ def retrieve(
SELECT SELECT
uid, doc_type, uid, doc_type,
section_index, subsection_index, child_index, section_index, subsection_index, child_index,
section_title, subsection_title, title, type, box_hint, section_title, subsection_title, title, type,
path, markdown, path, markdown,
1 - (embedding <=> %(qvec)s) AS score 1 - (embedding <=> %(qvec)s) AS score
FROM docs FROM docs
...@@ -402,7 +398,7 @@ def retrieve( ...@@ -402,7 +398,7 @@ def retrieve(
SELECT SELECT
d.uid, d.doc_type, d.uid, d.doc_type,
d.section_index, d.subsection_index, d.child_index, 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, d.path, d.markdown,
1.0 AS score 1.0 AS score
FROM docs d FROM docs d
...@@ -419,7 +415,7 @@ def retrieve( ...@@ -419,7 +415,7 @@ def retrieve(
SELECT SELECT
uid, doc_type, uid, doc_type,
section_index, subsection_index, child_index, section_index, subsection_index, child_index,
section_title, subsection_title, title, type, box_hint, section_title, subsection_title, title, type,
path, markdown, path, markdown,
1.0 AS score 1.0 AS score
FROM docs FROM docs
...@@ -435,7 +431,7 @@ def retrieve( ...@@ -435,7 +431,7 @@ def retrieve(
SELECT SELECT
d.uid, d.doc_type, d.uid, d.doc_type,
d.section_index, d.subsection_index, d.child_index, 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, d.path, d.markdown,
1 - (d.embedding <=> %(qvec)s) AS score 1 - (d.embedding <=> %(qvec)s) AS score
FROM docs d FROM docs d
...@@ -478,7 +474,7 @@ def retrieve( ...@@ -478,7 +474,7 @@ def retrieve(
SELECT SELECT
d.uid, d.doc_type, d.uid, d.doc_type,
d.section_index, d.subsection_index, d.child_index, 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, d.path, d.markdown,
0.9 AS score 0.9 AS score
FROM docs d FROM docs d
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment