mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-10-26 12:20:39 +00:00
fix: pgvector_store read connection_string from env (#2887)
Co-authored-by: alanchen <40684202+chenliang15405@users.noreply.github.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
"""Postgres vector store."""
|
"""Postgres vector store."""
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
import os
|
||||||
from dataclasses import dataclass, field
|
from dataclasses import dataclass, field
|
||||||
from typing import Any, List, Optional
|
from typing import Any, List, Optional
|
||||||
|
|
||||||
@@ -99,8 +100,10 @@ class PGVectorStore(VectorStoreBase):
|
|||||||
max_chunks_once_load=max_chunks_once_load, max_threads=max_threads
|
max_chunks_once_load=max_chunks_once_load, max_threads=max_threads
|
||||||
)
|
)
|
||||||
self._vector_store_config = vector_store_config
|
self._vector_store_config = vector_store_config
|
||||||
|
self.connection_string = vector_store_config.connection_string or os.getenv(
|
||||||
|
"PGVECTOR_CONNECTION_STRING"
|
||||||
|
)
|
||||||
|
|
||||||
self.connection_string = vector_store_config.connection_string
|
|
||||||
self.embeddings = embedding_fn
|
self.embeddings = embedding_fn
|
||||||
self.collection_name = name
|
self.collection_name = name
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user