mirror of
https://github.com/csunny/DB-GPT.git
synced 2025-09-05 02:51:07 +00:00
refactor(agent): Refactor resource of agents (#1518)
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
"""Postgres vector store."""
|
||||
|
||||
import logging
|
||||
from typing import List, Optional
|
||||
|
||||
@@ -67,10 +68,10 @@ class PGVectorStore(VectorStoreBase):
|
||||
self.collection_name = vector_store_config.name
|
||||
|
||||
self.vector_store_client = PGVector(
|
||||
embedding_function=self.embeddings,
|
||||
embedding_function=self.embeddings, # type: ignore
|
||||
collection_name=self.collection_name,
|
||||
connection_string=self.connection_string,
|
||||
) # mypy: ignore
|
||||
)
|
||||
|
||||
def similar_search(
|
||||
self, text: str, topk: int, filters: Optional[MetadataFilters] = None
|
||||
@@ -97,7 +98,7 @@ class PGVectorStore(VectorStoreBase):
|
||||
List[str]: chunk ids.
|
||||
"""
|
||||
lc_documents = [Chunk.chunk2langchain(chunk) for chunk in chunks]
|
||||
self.vector_store_client.from_documents(lc_documents)
|
||||
self.vector_store_client.from_documents(lc_documents) # type: ignore
|
||||
return [str(chunk.chunk_id) for chunk in lc_documents]
|
||||
|
||||
def delete_vector_name(self, vector_name: str):
|
||||
|
Reference in New Issue
Block a user