The agent engineering platform.
Python agentsaiai-agentsanthropicchatgptdeepagentsenterpriseframeworkgeminigenerative-ailangchainlanggraphllmmultiagentopen-sourceopenaipydanticpythonragtypescript
Make project compatible with SQLAlchemy 1.3.* (#3862)
Hristo Stoychev109927cdb29b
diff --git a/langchain/vectorstores/analyticdb.py b/langchain/vectorstores/analyticdb.pyindex 6ed8e5b0b5..6ec5fbade1 100644--- a/langchain/vectorstores/analyticdb.py+++ b/langchain/vectorstores/analyticdb.py@@ -8,7 +8,7 @@ from typing import Any, Dict, Iterable, List, Optional, Tupleimport sqlalchemyfrom sqlalchemy import REAL, Indexfrom sqlalchemy.dialects.postgresql import ARRAY, JSON, UUID-from sqlalchemy.orm import Mapped, Session, declarative_base, relationship+from sqlalchemy.orm import Session, declarative_base, relationshipfrom sqlalchemy.sql.expression import funcfrom langchain.docstore.document import Document@@ -70,7 +70,7 @@ class CollectionStore(BaseModel):class EmbeddingStore(BaseModel):__tablename__ = "langchain_pg_embedding"- collection_id: Mapped[UUID] = sqlalchemy.Column(+ collection_id = sqlalchemy.Column(UUID(as_uuid=True),sqlalchemy.ForeignKey(f"{CollectionStore.__tablename__}.uuid",diff --git a/langchain/vectorstores/pgvector.py b/langchain/vectorstores/pgvector.pyindex d0101771ac..a128241d51 100644--- a/langchain/vectorstores/pgvector.py+++ b/langchain/vectorstores/pgvector.py@@ -9,7 +9,7 @@ from typing import Any, Dict, Iterable, List, Optional, Tuple, Typeimport sqlalchemyfrom pgvector.sqlalchemy import Vectorfrom sqlalchemy.dialects.postgresql import JSON, UUID-from sqlalchemy.orm import Mapped, Session, declarative_base, relationship+from sqlalchemy.orm import Session, declarative_base, relationshipfrom langchain.docstore.document import Documentfrom langchain.embeddings.base import Embeddings@@ -70,7 +70,7 @@ class CollectionStore(BaseModel):class EmbeddingStore(BaseModel):__tablename__ = "langchain_pg_embedding"- collection_id: Mapped[UUID] = sqlalchemy.Column(+ collection_id = sqlalchemy.Column(UUID(as_uuid=True),sqlalchemy.ForeignKey(f"{CollectionStore.__tablename__}.uuid",diff --git a/pyproject.toml b/pyproject.tomlindex 5606e649d7..29e7be5af4 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -13,7 +13,7 @@ langchain-server = "langchain.server:main"[tool.poetry.dependencies]python = ">=3.8.1,<4.0"pydantic = "^1"-SQLAlchemy = ">1.4,<3"+SQLAlchemy = ">=1.3,<3"requests = "^2"PyYAML = ">=5.4.1"numpy = "^1"