The agent engineering platform.
Python agentsaiai-agentsanthropicchatgptdeepagentsenterpriseframeworkgeminigenerative-ailangchainlanggraphllmmultiagentopen-sourceopenaipydanticpythonragtypescript
community[patch]: fix pgvector sqlalchemy (#14726)
Erick Friis9fb26a2a718b
diff --git a/libs/community/langchain_community/vectorstores/pgvector.py b/libs/community/langchain_community/vectorstores/pgvector.pyindex eb20095930..d5c2294b10 100644--- a/libs/community/langchain_community/vectorstores/pgvector.py+++ b/libs/community/langchain_community/vectorstores/pgvector.py@@ -60,7 +60,14 @@ class BaseModel(Base):uuid = sqlalchemy.Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)+_classes: Any = None++def _get_embedding_collection_store() -> Any:+ global _classes+ if _classes is not None:+ return _classes+from pgvector.sqlalchemy import Vectorclass CollectionStore(BaseModel):@@ -126,7 +133,9 @@ def _get_embedding_collection_store() -> Any:# custom_id : any user defined idcustom_id = sqlalchemy.Column(sqlalchemy.String, nullable=True)- return EmbeddingStore, CollectionStore+ _classes = (EmbeddingStore, CollectionStore)++ return _classesdef _results_to_docs(docs_and_scores: Any) -> List[Document]: