Langchain
zenml.integrations.langchain
special
Initialization of the langchain integration.
LangchainIntegration (Integration)
Definition of langchain integration for ZenML.
Source code in zenml/integrations/langchain/__init__.py
class LangchainIntegration(Integration):
"""Definition of langchain integration for ZenML."""
NAME = LANGCHAIN
REQUIREMENTS = ["langchain>=0.0.116"]
@classmethod
def activate(cls) -> None:
"""Activates the integration."""
from zenml.integrations.langchain import materializers # noqa
activate()
classmethod
Activates the integration.
Source code in zenml/integrations/langchain/__init__.py
@classmethod
def activate(cls) -> None:
"""Activates the integration."""
from zenml.integrations.langchain import materializers # noqa
materializers
special
Initialization of the langchain materializer.
document_materializer
Implementation of ZenML's Langchain Document materializer.
LangchainDocumentMaterializer (PydanticMaterializer)
Handle Langchain Document objects.
Source code in zenml/integrations/langchain/materializers/document_materializer.py
class LangchainDocumentMaterializer(PydanticMaterializer):
"""Handle Langchain Document objects."""
ASSOCIATED_ARTIFACT_TYPE: ClassVar[ArtifactType] = ArtifactType.DATA
ASSOCIATED_TYPES: ClassVar[Tuple[Type[Any], ...]] = (Document,)
openai_embedding_materializer
Implementation of the Langchain OpenAI embedding materializer.
LangchainOpenaiEmbeddingMaterializer (CloudpickleMaterializer)
Handle langchain OpenAI embedding objects.
Source code in zenml/integrations/langchain/materializers/openai_embedding_materializer.py
class LangchainOpenaiEmbeddingMaterializer(CloudpickleMaterializer):
"""Handle langchain OpenAI embedding objects."""
ASSOCIATED_ARTIFACT_TYPE: ClassVar[ArtifactType] = ArtifactType.MODEL
ASSOCIATED_TYPES: ClassVar[Tuple[Type[Any], ...]] = (OpenAIEmbeddings,)
vector_store_materializer
Implementation of the langchain vector store materializer.
LangchainVectorStoreMaterializer (CloudpickleMaterializer)
Handle langchain vector store objects.
Source code in zenml/integrations/langchain/materializers/vector_store_materializer.py
class LangchainVectorStoreMaterializer(CloudpickleMaterializer):
"""Handle langchain vector store objects."""
ASSOCIATED_ARTIFACT_TYPE: ClassVar[ArtifactType] = ArtifactType.DATA
ASSOCIATED_TYPES: ClassVar[Tuple[Type[Any], ...]] = (VectorStore,)