mirror of
https://github.com/zylon-ai/private-gpt.git
synced 2025-12-22 17:05:41 +01:00
feat(Vector): support pgvector (#1624)
This commit is contained in:
parent
066ea5bf28
commit
cd40e3982b
6 changed files with 323 additions and 59 deletions
|
|
@ -40,6 +40,21 @@ class VectorStoreComponent:
|
|||
@inject
|
||||
def __init__(self, settings: Settings) -> None:
|
||||
match settings.vectorstore.database:
|
||||
case "pgvector":
|
||||
from llama_index.vector_stores import PGVectorStore
|
||||
|
||||
if settings.pgvector is None:
|
||||
raise ValueError(
|
||||
"PGVectorStore settings not found. Please provide settings."
|
||||
)
|
||||
|
||||
self.vector_store = typing.cast(
|
||||
VectorStore,
|
||||
PGVectorStore.from_params(
|
||||
**settings.pgvector.model_dump(exclude_none=True)
|
||||
),
|
||||
)
|
||||
|
||||
case "chroma":
|
||||
try:
|
||||
import chromadb # type: ignore
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue