Skip to content

Commit d72ea20

Browse files
author
Daniele Briggi
committed
fix(tests): missing context
1 parent af729d7 commit d72ea20

File tree

4 files changed

+8
-4
lines changed

4 files changed

+8
-4
lines changed

src/sqlite_rag/cli.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def set_settings(
5555
vector_type: Optional[str] = typer.Option(
5656
None, help="Vector storage type (FLOAT16, FLOAT32, etc.)"
5757
),
58-
other_vector_config: Optional[str] = typer.Option(
58+
other_vector_options: Optional[str] = typer.Option(
5959
None, help="Additional vector configuration"
6060
),
6161
chunk_size: Optional[int] = typer.Option(
@@ -89,7 +89,7 @@ def set_settings(
8989
"model_config": model_config,
9090
"embedding_dim": embedding_dim,
9191
"vector_type": vector_type,
92-
"other_vector_config": other_vector_config,
92+
"other_vector_options": other_vector_options,
9393
"chunk_size": chunk_size,
9494
"chunk_overlap": chunk_overlap,
9595
"quantize_scan": quantize_scan,

tests/conftest.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,6 @@ def engine(db_conn):
3131
engine = Engine(conn, settings, chunker=Chunker(conn, settings))
3232
engine.load_model()
3333
engine.quantize()
34+
engine.create_new_context()
3435

3536
return engine

tests/test_engine.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ def test_search_fts_results(self, db_conn):
104104

105105
engine = Engine(conn, settings, Chunker(conn, settings))
106106
engine.load_model()
107+
engine.create_new_context()
107108

108109
doc1 = Document(
109110
content="The quick brown fox jumps over the lazy dog.",
@@ -148,6 +149,7 @@ def test_search_without_quantization(self, db_conn):
148149
uri="document1.txt",
149150
)
150151

152+
engine.create_new_context()
151153
engine.process(doc)
152154

153155
repository = Repository(conn, settings)
@@ -162,10 +164,11 @@ def test_search_without_quantization(self, db_conn):
162164
def test_search_exact_match(self, db_conn):
163165
conn, settings = db_conn
164166
# cosin distance for searching embedding is exact 0.0 when strings match
165-
settings.other_vector_config = "distance=cosine"
167+
settings.other_vector_options = "distance=cosine"
166168

167169
engine = Engine(conn, settings, Chunker(conn, settings))
168170
engine.load_model()
171+
engine.create_new_context()
169172

170173
doc1 = Document(
171174
content="The quick brown fox jumps over the lazy dog",

tests/test_sqlite_rag.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,7 @@ def test_reset_database(self):
512512

513513
def test_search_exact_match(self):
514514
# cosin distance for searching embedding is exact 0.0 when strings match
515-
settings = {"other_vector_config": "distance=cosine"}
515+
settings = {"other_vector_options": "distance=cosine"}
516516

517517
temp_file_path = os.path.join(tempfile.mkdtemp(), "something")
518518

0 commit comments

Comments
 (0)