Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

Vec port #465

Merged
merged 3 commits into from
Dec 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 13 additions & 11 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ greenlet = "^3.0.3"
aiosqlite = "^0.20.0"
ollama = ">=0.4.4"
pydantic-settings = "^2.7.0"
sqlite-vec = ">=0.1.0"
numpy = ">=1.24.0"
tree-sitter = ">=0.23.2"
tree-sitter-go = ">=0.23.4"
Expand All @@ -29,6 +28,7 @@ tree-sitter-javascript = ">=0.23.1"
tree-sitter-python = ">=0.23.6"
tree-sitter-rust = ">=0.23.2"

sqlite-vec-sl-tmp = "0.0.3"
[tool.poetry.group.dev.dependencies]
pytest = ">=7.4.0"
pytest-cov = ">=4.1.0"
Expand Down
4 changes: 2 additions & 2 deletions scripts/import_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import sqlite3

import numpy as np
import sqlite_vec
import sqlite_vec_sl_tmp

from codegate.inference.inference_engine import LlamaCppInferenceEngine
from codegate.utils.utils import generate_vector_string
Expand All @@ -27,7 +27,7 @@ def __init__(self, jsonl_dir="data", db_path="./sqlite_data/vectordb.db"):
def _get_connection(self):
conn = sqlite3.connect(self.db_path)
conn.enable_load_extension(True)
sqlite_vec.load(conn)
sqlite_vec_sl_tmp.load(conn)
conn.enable_load_extension(False)
return conn

Expand Down
4 changes: 2 additions & 2 deletions src/codegate/storage/storage_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from typing import List

import numpy as np
import sqlite_vec
import sqlite_vec_sl_tmp
import structlog

from codegate.config import Config
Expand Down Expand Up @@ -62,7 +62,7 @@ def _get_connection(self):
try:
conn = sqlite3.connect(self.db_path)
conn.enable_load_extension(True)
sqlite_vec.load(conn)
sqlite_vec_sl_tmp.load(conn)
conn.enable_load_extension(False)
return conn
except Exception as e:
Expand Down
2 changes: 1 addition & 1 deletion tests/vectordb/test_sqlitevec.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

@pytest.fixture(scope="module")
def mock_sqlite_vec():
with patch("sqlite_vec.load") as mock_load:
with patch("sqlite_vec_sl_tmp.load") as mock_load:
# Mock the vector similarity extension loading
def setup_vector_similarity(conn):
cursor = conn.cursor()
Expand Down
Loading