diff --git a/src/backend/langflow/field_typing/__init__.py b/src/backend/langflow/field_typing/__init__.py index 14cbba2d0..9a2161d3f 100644 --- a/src/backend/langflow/field_typing/__init__.py +++ b/src/backend/langflow/field_typing/__init__.py @@ -1,8 +1,53 @@ -from .base import NestedDict, Data -from .constants import * - -__all__ = ( - ["NestedDict", "Data"] - + list(LANGCHAIN_BASE_TYPES.keys()) - + list(CUSTOM_COMPONENT_SUPPORTED_TYPES.keys()) +# LANGCHAIN_BASE_TYPES = { +# "Chain": Chain, +# "AgentExecutor": AgentExecutor, +# "Tool": Tool, +# "BaseLLM": BaseLLM, +# "PromptTemplate": PromptTemplate, +# "BaseLoader": BaseLoader, +# "Document": Document, +# "TextSplitter": TextSplitter, +# "VectorStore": VectorStore, +# "Embeddings": Embeddings, +# "BaseRetriever": BaseRetriever, +# "BaseOutputParser": BaseOutputParser, +# "BaseMemory": BaseMemory, +# "BaseChatMemory": BaseChatMemory, +# } +from .constants import ( + Tool, + PromptTemplate, + Chain, + BaseChatMemory, + BaseLLM, + BaseLoader, + BaseMemory, + BaseOutputParser, + BaseRetriever, + VectorStore, + Embeddings, + TextSplitter, + Document, + AgentExecutor, + NestedDict, + Data, ) + +__all__ = [ + "NestedDict", + "Data", + "Tool", + "PromptTemplate", + "Chain", + "BaseChatMemory", + "BaseLLM", + "BaseLoader", + "BaseMemory", + "BaseOutputParser", + "BaseRetriever", + "VectorStore", + "Embeddings", + "TextSplitter", + "Document", + "AgentExecutor", +] diff --git a/src/backend/langflow/field_typing/base.py b/src/backend/langflow/field_typing/base.py deleted file mode 100644 index 48b737a63..000000000 --- a/src/backend/langflow/field_typing/base.py +++ /dev/null @@ -1,5 +0,0 @@ -from typing import Union, Dict, Any - -# Type alias for more complex dicts -NestedDict = Dict[str, Union[str, Dict]] -Data = Any diff --git a/src/backend/langflow/field_typing/constants.py b/src/backend/langflow/field_typing/constants.py index 4a8072b15..3ce429548 100644 --- a/src/backend/langflow/field_typing/constants.py +++ b/src/backend/langflow/field_typing/constants.py @@ -10,7 +10,14 @@ from langchain.schema.memory import BaseMemory from langchain.text_splitter import TextSplitter from langchain.tools import Tool from langchain.vectorstores.base import VectorStore -from langflow.field_typing import Data, NestedDict +from typing import Union, Dict + +# Type alias for more complex dicts +NestedDict = Dict[str, Union[str, Dict]] + + +class Data: + pass LANGCHAIN_BASE_TYPES = {