first commit
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from chromadb import PersistentClient
|
||||
from chromadb.api.models.Collection import Collection
|
||||
from chromadb.config import Settings as ChromaSettings
|
||||
|
||||
from .config import settings
|
||||
|
||||
|
||||
class VectorStore:
|
||||
def __init__(self) -> None:
|
||||
chroma_settings = ChromaSettings(
|
||||
anonymized_telemetry=False,
|
||||
chroma_product_telemetry_impl="app.noop_telemetry.NoOpProductTelemetry",
|
||||
chroma_telemetry_impl="app.noop_telemetry.NoOpProductTelemetry",
|
||||
)
|
||||
self.client = PersistentClient(
|
||||
path=settings.chroma_path,
|
||||
settings=chroma_settings,
|
||||
)
|
||||
|
||||
def get_collection(self, name: str) -> Collection:
|
||||
return self.client.get_or_create_collection(name=name)
|
||||
Reference in New Issue
Block a user