community: deprecate graph vector store (#30328)

- **Description:** mark GraphVectorStore `@deprecated`

---------

Co-authored-by: Chester Curme <chester.curme@gmail.com>
This commit is contained in:
Ben Chambers 2025-03-25 06:52:54 -07:00 committed by GitHub
parent a8ce63903d
commit c5e42a4027
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -11,7 +11,7 @@ from typing import (
cast,
)
from langchain_core._api import beta
from langchain_core._api import deprecated
from langchain_core.callbacks import (
AsyncCallbackManagerForRetrieverRun,
CallbackManagerForRetrieverRun,
@ -34,7 +34,17 @@ def _has_next(iterator: Iterator) -> bool:
return next(iterator, sentinel) is not sentinel
@beta()
DEPRECATION_ADDENDUM = (
"See https://datastax.github.io/graph-rag/guide/migration/"
"#from-langchain-graphvectorstore for migration instructions."
)
@deprecated(
since="0.3.21",
removal="0.5",
addendum=DEPRECATION_ADDENDUM,
)
class Node(Serializable):
"""Node in the GraphVectorStore.
@ -119,7 +129,11 @@ def _documents_to_nodes(documents: Iterable[Document]) -> Iterator[Node]:
)
@beta()
@deprecated(
since="0.3.21",
removal="0.5",
addendum=DEPRECATION_ADDENDUM,
)
def nodes_to_documents(nodes: Iterable[Node]) -> Iterator[Document]:
"""Convert nodes to documents.
@ -143,7 +157,11 @@ def nodes_to_documents(nodes: Iterable[Node]) -> Iterator[Document]:
)
@beta(message="Added in version 0.3.1 of langchain_community. API subject to change.")
@deprecated(
since="0.3.21",
removal="0.5",
addendum=DEPRECATION_ADDENDUM,
)
class GraphVectorStore(VectorStore):
"""A hybrid vector-and-graph graph store.
@ -705,7 +723,11 @@ class GraphVectorStore(VectorStore):
return GraphVectorStoreRetriever(vectorstore=self, **kwargs)
@beta(message="Added in version 0.3.1 of langchain_community. API subject to change.")
@deprecated(
since="0.3.21",
removal="0.5",
addendum=DEPRECATION_ADDENDUM,
)
class GraphVectorStoreRetriever(VectorStoreRetriever):
"""Retriever for GraphVectorStore.