diff --git a/src/backend/base/langflow/api/v1/endpoints.py b/src/backend/base/langflow/api/v1/endpoints.py index 35a8f66375f0..05b637060c79 100644 --- a/src/backend/base/langflow/api/v1/endpoints.py +++ b/src/backend/base/langflow/api/v1/endpoints.py @@ -22,7 +22,7 @@ UploadFileResponse, ) from langflow.custom.custom_component.component import Component -from langflow.custom.utils import build_custom_component_template +from langflow.custom.utils import build_custom_component_template, get_instance_name from langflow.graph.graph.base import Graph from langflow.graph.schema import RunOutputs from langflow.helpers.flow import get_flow_by_id_or_endpoint_name @@ -519,7 +519,9 @@ async def custom_component( built_frontend_node, component_instance = build_custom_component_template(component, user_id=user.id) if raw_code.frontend_node is not None: built_frontend_node = component_instance.post_code_processing(built_frontend_node, raw_code.frontend_node) - return CustomComponentResponse(data=built_frontend_node, type=component_instance.__class__.__name__) + + _type = get_instance_name(component_instance) + return CustomComponentResponse(data=built_frontend_node, type=_type) @router.post("/custom_component/update", status_code=HTTPStatus.OK) diff --git a/src/backend/base/langflow/components/agents/CSVAgent.py b/src/backend/base/langflow/components/agents/CSVAgent.py index 21b285de2834..b336045703af 100644 --- a/src/backend/base/langflow/components/agents/CSVAgent.py +++ b/src/backend/base/langflow/components/agents/CSVAgent.py @@ -8,6 +8,7 @@ class CSVAgentComponent(CustomComponent): display_name = "CSVAgent" description = "Construct a CSV agent from a CSV and tools." documentation = "https://python.langchain.com/docs/modules/agents/toolkits/csv" + name = "CSVAgent" def build_config(self): return { diff --git a/src/backend/base/langflow/components/agents/JsonAgent.py b/src/backend/base/langflow/components/agents/JsonAgent.py index cadc684f8040..3746e989d511 100644 --- a/src/backend/base/langflow/components/agents/JsonAgent.py +++ b/src/backend/base/langflow/components/agents/JsonAgent.py @@ -9,6 +9,7 @@ class JsonAgentComponent(CustomComponent): display_name = "JsonAgent" description = "Construct a json agent from an LLM and tools." + name = "JsonAgent" def build_config(self): return { diff --git a/src/backend/base/langflow/components/agents/SQLAgent.py b/src/backend/base/langflow/components/agents/SQLAgent.py index 4f2a8e89ec5a..ddc6f49c6034 100644 --- a/src/backend/base/langflow/components/agents/SQLAgent.py +++ b/src/backend/base/langflow/components/agents/SQLAgent.py @@ -12,6 +12,7 @@ class SQLAgentComponent(CustomComponent): display_name = "SQLAgent" description = "Construct an SQL agent from an LLM and tools." + name = "SQLAgent" def build_config(self): return { diff --git a/src/backend/base/langflow/components/agents/ToolCallingAgent.py b/src/backend/base/langflow/components/agents/ToolCallingAgent.py index 7f390e8bee87..c08c97ca55cf 100644 --- a/src/backend/base/langflow/components/agents/ToolCallingAgent.py +++ b/src/backend/base/langflow/components/agents/ToolCallingAgent.py @@ -15,6 +15,7 @@ class ToolCallingAgentComponent(Component): description: str = "Agent that uses tools. Only models that are compatible with function calling are supported." icon = "LangChain" beta = True + name = "ToolCallingAgent" inputs = [ MessageTextInput( diff --git a/src/backend/base/langflow/components/agents/VectorStoreAgent.py b/src/backend/base/langflow/components/agents/VectorStoreAgent.py index 2bb324e50d68..1d3a5e890f9c 100644 --- a/src/backend/base/langflow/components/agents/VectorStoreAgent.py +++ b/src/backend/base/langflow/components/agents/VectorStoreAgent.py @@ -10,6 +10,7 @@ class VectorStoreAgentComponent(CustomComponent): display_name = "VectorStoreAgent" description = "Construct an agent from a Vector Store." + name = "VectorStoreAgent" def build_config(self): return { diff --git a/src/backend/base/langflow/components/agents/VectorStoreRouterAgent.py b/src/backend/base/langflow/components/agents/VectorStoreRouterAgent.py index a696a19c2c74..7750b2e01acb 100644 --- a/src/backend/base/langflow/components/agents/VectorStoreRouterAgent.py +++ b/src/backend/base/langflow/components/agents/VectorStoreRouterAgent.py @@ -10,6 +10,7 @@ class VectorStoreRouterAgentComponent(CustomComponent): display_name = "VectorStoreRouterAgent" description = "Construct an agent from a Vector Store Router." + name = "VectorStoreRouterAgent" def build_config(self): return { diff --git a/src/backend/base/langflow/components/agents/XMLAgent.py b/src/backend/base/langflow/components/agents/XMLAgent.py index b0a9b18732ba..7972f8dfb89c 100644 --- a/src/backend/base/langflow/components/agents/XMLAgent.py +++ b/src/backend/base/langflow/components/agents/XMLAgent.py @@ -11,6 +11,7 @@ class XMLAgentComponent(LCAgentComponent): display_name = "XMLAgent" description = "Construct an XML agent from an LLM and tools." + name = "XMLAgent" def build_config(self): return { diff --git a/src/backend/base/langflow/components/chains/ConversationChain.py b/src/backend/base/langflow/components/chains/ConversationChain.py index a400d4993d27..f4a6e1b392c5 100644 --- a/src/backend/base/langflow/components/chains/ConversationChain.py +++ b/src/backend/base/langflow/components/chains/ConversationChain.py @@ -9,6 +9,7 @@ class ConversationChainComponent(CustomComponent): display_name = "ConversationChain" description = "Chain to have a conversation and load context from memory." + name = "ConversationChain" def build_config(self): return { diff --git a/src/backend/base/langflow/components/chains/LLMChain.py b/src/backend/base/langflow/components/chains/LLMChain.py index b0f6913bf00c..d0f0c097523d 100644 --- a/src/backend/base/langflow/components/chains/LLMChain.py +++ b/src/backend/base/langflow/components/chains/LLMChain.py @@ -10,6 +10,7 @@ class LLMChainComponent(CustomComponent): display_name = "LLMChain" description = "Chain to run queries against LLMs" + name = "LLMChain" def build_config(self): return { diff --git a/src/backend/base/langflow/components/chains/LLMCheckerChain.py b/src/backend/base/langflow/components/chains/LLMCheckerChain.py index 63bf5613c50e..080a8d7dde5b 100644 --- a/src/backend/base/langflow/components/chains/LLMCheckerChain.py +++ b/src/backend/base/langflow/components/chains/LLMCheckerChain.py @@ -8,6 +8,7 @@ class LLMCheckerChainComponent(CustomComponent): display_name = "LLMCheckerChain" description = "" documentation = "https://python.langchain.com/docs/modules/chains/additional/llm_checker" + name = "LLMCheckerChain" def build_config(self): return { diff --git a/src/backend/base/langflow/components/chains/LLMMathChain.py b/src/backend/base/langflow/components/chains/LLMMathChain.py index 795b8ee087d1..b23ad6350b2d 100644 --- a/src/backend/base/langflow/components/chains/LLMMathChain.py +++ b/src/backend/base/langflow/components/chains/LLMMathChain.py @@ -10,6 +10,7 @@ class LLMMathChainComponent(CustomComponent): display_name = "LLMMathChain" description = "Chain that interprets a prompt and executes python code to do math." documentation = "https://python.langchain.com/docs/modules/chains/additional/llm_math" + name = "LLMMathChain" def build_config(self): return { diff --git a/src/backend/base/langflow/components/chains/RetrievalQA.py b/src/backend/base/langflow/components/chains/RetrievalQA.py index 295a03bfbedf..a15b358538ba 100644 --- a/src/backend/base/langflow/components/chains/RetrievalQA.py +++ b/src/backend/base/langflow/components/chains/RetrievalQA.py @@ -11,6 +11,7 @@ class RetrievalQAComponent(CustomComponent): display_name = "Retrieval QA" description = "Chain for question-answering against an index." + name = "RetrievalQA" def build_config(self): return { diff --git a/src/backend/base/langflow/components/chains/RetrievalQAWithSourcesChain.py b/src/backend/base/langflow/components/chains/RetrievalQAWithSourcesChain.py index fee16beaecf3..41efb1cc91e6 100644 --- a/src/backend/base/langflow/components/chains/RetrievalQAWithSourcesChain.py +++ b/src/backend/base/langflow/components/chains/RetrievalQAWithSourcesChain.py @@ -10,6 +10,7 @@ class RetrievalQAWithSourcesChainComponent(CustomComponent): display_name = "RetrievalQAWithSourcesChain" description = "Question-answering with sources over an index." + name = "RetrievalQAWithSourcesChain" def build_config(self): return { diff --git a/src/backend/base/langflow/components/chains/SQLGenerator.py b/src/backend/base/langflow/components/chains/SQLGenerator.py index dc085c46e058..b81b59470cb0 100644 --- a/src/backend/base/langflow/components/chains/SQLGenerator.py +++ b/src/backend/base/langflow/components/chains/SQLGenerator.py @@ -12,6 +12,7 @@ class SQLGeneratorComponent(CustomComponent): display_name = "Natural Language to SQL" description = "Generate SQL from natural language." + name = "SQLGenerator" def build_config(self): return { diff --git a/src/backend/base/langflow/components/data/APIRequest.py b/src/backend/base/langflow/components/data/APIRequest.py index e92dc210ed88..a7908ae21726 100644 --- a/src/backend/base/langflow/components/data/APIRequest.py +++ b/src/backend/base/langflow/components/data/APIRequest.py @@ -22,6 +22,7 @@ class APIRequestComponent(Component): "**Note:** Check advanced options for more settings." ) icon = "Globe" + name = "APIRequest" inputs = [ MessageTextInput( diff --git a/src/backend/base/langflow/components/data/Directory.py b/src/backend/base/langflow/components/data/Directory.py index 267869ebb34b..1c1e82890dd5 100644 --- a/src/backend/base/langflow/components/data/Directory.py +++ b/src/backend/base/langflow/components/data/Directory.py @@ -11,6 +11,7 @@ class DirectoryComponent(Component): display_name = "Directory" description = "Recursively load files from a directory." icon = "folder" + name = "Directory" inputs = [ MessageTextInput( diff --git a/src/backend/base/langflow/components/data/File.py b/src/backend/base/langflow/components/data/File.py index a0a4385e62da..f36c1846e566 100644 --- a/src/backend/base/langflow/components/data/File.py +++ b/src/backend/base/langflow/components/data/File.py @@ -10,6 +10,7 @@ class FileComponent(Component): display_name = "File" description = "A generic file loader." icon = "file-text" + name = "File" inputs = [ FileInput( diff --git a/src/backend/base/langflow/components/data/URL.py b/src/backend/base/langflow/components/data/URL.py index c475cc635599..f4e3c06433f6 100644 --- a/src/backend/base/langflow/components/data/URL.py +++ b/src/backend/base/langflow/components/data/URL.py @@ -11,6 +11,7 @@ class URLComponent(Component): display_name = "URL" description = "Fetch content from one or more URLs." icon = "layout-template" + name = "URL" inputs = [ MessageTextInput( diff --git a/src/backend/base/langflow/components/data/Webhook.py b/src/backend/base/langflow/components/data/Webhook.py index 67e188f6e003..e02367332fe7 100644 --- a/src/backend/base/langflow/components/data/Webhook.py +++ b/src/backend/base/langflow/components/data/Webhook.py @@ -8,6 +8,7 @@ class WebhookComponent(Component): display_name = "Webhook Input" description = "Defines a webhook input for the flow." + name = "Webhook" inputs = [ MultilineInput( diff --git a/src/backend/base/langflow/components/deactivated/AgentComponent.py b/src/backend/base/langflow/components/deactivated/AgentComponent.py index 117b9e676eac..a89213feadc2 100644 --- a/src/backend/base/langflow/components/deactivated/AgentComponent.py +++ b/src/backend/base/langflow/components/deactivated/AgentComponent.py @@ -23,6 +23,7 @@ class AgentComponent(LCAgentComponent): "memory", "input_value", ] + name = "AgentComponent" def build_config(self): return { diff --git a/src/backend/base/langflow/components/deactivated/CodeBlockExtractor.py b/src/backend/base/langflow/components/deactivated/CodeBlockExtractor.py index 316ed8a95fc9..f1383fc8ada1 100644 --- a/src/backend/base/langflow/components/deactivated/CodeBlockExtractor.py +++ b/src/backend/base/langflow/components/deactivated/CodeBlockExtractor.py @@ -7,6 +7,7 @@ class CodeBlockExtractor(Component): display_name = "Code Block Extractor" description = "Extracts code block from text." + name = "CodeBlockExtractor" inputs = [Input(name="text", field_type=Text, description="Text to extract code blocks from.")] diff --git a/src/backend/base/langflow/components/deactivated/DocumentsToData.py b/src/backend/base/langflow/components/deactivated/DocumentsToData.py index 13111db591fc..3d0f65970274 100644 --- a/src/backend/base/langflow/components/deactivated/DocumentsToData.py +++ b/src/backend/base/langflow/components/deactivated/DocumentsToData.py @@ -10,6 +10,7 @@ class DocumentsToDataComponent(CustomComponent): display_name = "Documents ⇢ Data" description = "Convert LangChain Documents into Data." icon = "LangChain" + name = "DocumentsToData" field_config = { "documents": {"display_name": "Documents"}, diff --git a/src/backend/base/langflow/components/deactivated/Embed.py b/src/backend/base/langflow/components/deactivated/Embed.py index a67c6c4cfa7f..dee38e2347f3 100644 --- a/src/backend/base/langflow/components/deactivated/Embed.py +++ b/src/backend/base/langflow/components/deactivated/Embed.py @@ -5,6 +5,7 @@ class EmbedComponent(CustomComponent): display_name = "Embed Texts" + name = "Embed" def build_config(self): return {"texts": {"display_name": "Texts"}, "embbedings": {"display_name": "Embeddings"}} diff --git a/src/backend/base/langflow/components/deactivated/ExtractKeyFromData.py b/src/backend/base/langflow/components/deactivated/ExtractKeyFromData.py index a8ca78262620..01f7abd008c5 100644 --- a/src/backend/base/langflow/components/deactivated/ExtractKeyFromData.py +++ b/src/backend/base/langflow/components/deactivated/ExtractKeyFromData.py @@ -6,6 +6,7 @@ class ExtractKeyFromDataComponent(CustomComponent): display_name = "Extract Key From Data" description = "Extracts a key from a data." beta: bool = True + name = "ExtractKeyFromData" field_config = { "data": {"display_name": "Data"}, diff --git a/src/backend/base/langflow/components/deactivated/ListFlows.py b/src/backend/base/langflow/components/deactivated/ListFlows.py index 38fb2b967d9f..fa46839a2633 100644 --- a/src/backend/base/langflow/components/deactivated/ListFlows.py +++ b/src/backend/base/langflow/components/deactivated/ListFlows.py @@ -9,6 +9,7 @@ class ListFlowsComponent(CustomComponent): description = "A component to list all available flows." icon = "ListFlows" beta: bool = True + name = "ListFlows" def build_config(self): return {} diff --git a/src/backend/base/langflow/components/deactivated/MergeData.py b/src/backend/base/langflow/components/deactivated/MergeData.py index 51dfc4a6a710..3d2ac582c81d 100644 --- a/src/backend/base/langflow/components/deactivated/MergeData.py +++ b/src/backend/base/langflow/components/deactivated/MergeData.py @@ -6,6 +6,7 @@ class MergeDataComponent(CustomComponent): display_name = "Merge Data" description = "Merges data." beta: bool = True + name = "MergeData" field_config = { "data": {"display_name": "Data"}, diff --git a/src/backend/base/langflow/components/deactivated/Message.py b/src/backend/base/langflow/components/deactivated/Message.py index 9fdd8a0da52f..b5eecf19d2ec 100644 --- a/src/backend/base/langflow/components/deactivated/Message.py +++ b/src/backend/base/langflow/components/deactivated/Message.py @@ -7,6 +7,7 @@ class MessageComponent(CustomComponent): display_name = "Message" description = "Creates a Message object given a Session ID." + name = "Message" def build_config(self): return { diff --git a/src/backend/base/langflow/components/deactivated/SelectivePassThrough.py b/src/backend/base/langflow/components/deactivated/SelectivePassThrough.py index 605b54dfebdb..4a33418953d1 100644 --- a/src/backend/base/langflow/components/deactivated/SelectivePassThrough.py +++ b/src/backend/base/langflow/components/deactivated/SelectivePassThrough.py @@ -7,6 +7,7 @@ class SelectivePassThroughComponent(Component): display_name = "Selective Pass Through" description = "Passes the specified value if a specified condition is met." icon = "filter" + name = "SelectivePassThrough" inputs = [ MessageTextInput( diff --git a/src/backend/base/langflow/components/deactivated/ShouldRunNext.py b/src/backend/base/langflow/components/deactivated/ShouldRunNext.py index 7ca5651a7c14..5723c1486846 100644 --- a/src/backend/base/langflow/components/deactivated/ShouldRunNext.py +++ b/src/backend/base/langflow/components/deactivated/ShouldRunNext.py @@ -8,6 +8,7 @@ class ShouldRunNextComponent(CustomComponent): display_name = "Should Run Next" description = "Determines if a vertex is runnable." + name = "ShouldRunNext" def build(self, llm: LanguageModel, question: str, context: str, retries: int = 3) -> Text: template = "Given the following question and the context below, answer with a yes or no.\n\n{error_message}\n\nQuestion: {question}\n\nContext: {context}\n\nAnswer:" diff --git a/src/backend/base/langflow/components/deactivated/SplitText.py b/src/backend/base/langflow/components/deactivated/SplitText.py index f3529baf3ff4..88f911057e91 100644 --- a/src/backend/base/langflow/components/deactivated/SplitText.py +++ b/src/backend/base/langflow/components/deactivated/SplitText.py @@ -12,6 +12,7 @@ class SplitTextComponent(Component): display_name: str = "Split Text" description: str = "Split text into chunks based on specified criteria." icon = "scissors-line-dashed" + name = "SplitText" inputs = [ HandleInput( diff --git a/src/backend/base/langflow/components/deactivated/StoreMessage.py b/src/backend/base/langflow/components/deactivated/StoreMessage.py index 5d0abfbb9777..64a770aeadfa 100644 --- a/src/backend/base/langflow/components/deactivated/StoreMessage.py +++ b/src/backend/base/langflow/components/deactivated/StoreMessage.py @@ -6,6 +6,7 @@ class StoreMessageComponent(CustomComponent): display_name = "Store Message" description = "Stores a chat message." + name = "StoreMessage" def build_config(self): return { diff --git a/src/backend/base/langflow/components/deactivated/SubFlow.py b/src/backend/base/langflow/components/deactivated/SubFlow.py index b0631ee99101..6207e85f069b 100644 --- a/src/backend/base/langflow/components/deactivated/SubFlow.py +++ b/src/backend/base/langflow/components/deactivated/SubFlow.py @@ -19,6 +19,7 @@ class SubFlowComponent(CustomComponent): ) beta: bool = True field_order = ["flow_name"] + name = "SubFlow" def get_flow_names(self) -> List[str]: flow_datas = self.list_flows() diff --git a/src/backend/base/langflow/components/embeddings/AmazonBedrockEmbeddings.py b/src/backend/base/langflow/components/embeddings/AmazonBedrockEmbeddings.py index 9578bedc5f9a..5e91e801ac7b 100644 --- a/src/backend/base/langflow/components/embeddings/AmazonBedrockEmbeddings.py +++ b/src/backend/base/langflow/components/embeddings/AmazonBedrockEmbeddings.py @@ -10,6 +10,7 @@ class AmazonBedrockEmbeddingsComponent(LCModelComponent): description: str = "Generate embeddings using Amazon Bedrock models." documentation = "https://python.langchain.com/docs/modules/data_connection/text_embedding/integrations/bedrock" icon = "Amazon" + name = "AmazonBedrockEmbeddings" inputs = [ DropdownInput( diff --git a/src/backend/base/langflow/components/embeddings/AstraVectorize.py b/src/backend/base/langflow/components/embeddings/AstraVectorize.py index cd618f346594..7b3feab31db7 100644 --- a/src/backend/base/langflow/components/embeddings/AstraVectorize.py +++ b/src/backend/base/langflow/components/embeddings/AstraVectorize.py @@ -9,6 +9,7 @@ class AstraVectorize(Component): description: str = "Configuration options for Astra Vectorize server-side embeddings." documentation: str = "https://docs.datastax.com/en/astra-db-serverless/databases/embedding-generation.html" icon = "AstraDB" + name = "AstraVectorize" VECTORIZE_PROVIDERS_MAPPING = { "Azure OpenAI": ["azureOpenAI", ["text-embedding-3-small", "text-embedding-3-large", "text-embedding-ada-002"]], diff --git a/src/backend/base/langflow/components/embeddings/AzureOpenAIEmbeddings.py b/src/backend/base/langflow/components/embeddings/AzureOpenAIEmbeddings.py index c838b328e154..e206074a6807 100644 --- a/src/backend/base/langflow/components/embeddings/AzureOpenAIEmbeddings.py +++ b/src/backend/base/langflow/components/embeddings/AzureOpenAIEmbeddings.py @@ -11,6 +11,7 @@ class AzureOpenAIEmbeddingsComponent(LCModelComponent): description: str = "Generate embeddings using Azure OpenAI models." documentation: str = "https://python.langchain.com/docs/integrations/text_embedding/azureopenai" icon = "Azure" + name = "AzureOpenAIEmbeddings" API_VERSION_OPTIONS = [ "2022-12-01", diff --git a/src/backend/base/langflow/components/embeddings/CohereEmbeddings.py b/src/backend/base/langflow/components/embeddings/CohereEmbeddings.py index 80967becf954..6c72563389b9 100644 --- a/src/backend/base/langflow/components/embeddings/CohereEmbeddings.py +++ b/src/backend/base/langflow/components/embeddings/CohereEmbeddings.py @@ -9,6 +9,8 @@ class CohereEmbeddingsComponent(LCModelComponent): display_name = "Cohere Embeddings" description = "Generate embeddings using Cohere models." icon = "Cohere" + name = "CohereEmbeddings" + inputs = [ SecretStrInput(name="cohere_api_key", display_name="Cohere API Key"), DropdownInput( diff --git a/src/backend/base/langflow/components/embeddings/HuggingFaceEmbeddings.py b/src/backend/base/langflow/components/embeddings/HuggingFaceEmbeddings.py index fda48b2a38ef..bf2bdfd0f47f 100644 --- a/src/backend/base/langflow/components/embeddings/HuggingFaceEmbeddings.py +++ b/src/backend/base/langflow/components/embeddings/HuggingFaceEmbeddings.py @@ -12,6 +12,7 @@ class HuggingFaceEmbeddingsComponent(LCModelComponent): "https://python.langchain.com/docs/modules/data_connection/text_embedding/integrations/sentence_transformers" ) icon = "HuggingFace" + name = "HuggingFaceEmbeddings" inputs = [ MessageTextInput(name="cache_folder", display_name="Cache Folder", advanced=True), diff --git a/src/backend/base/langflow/components/embeddings/HuggingFaceInferenceAPIEmbeddings.py b/src/backend/base/langflow/components/embeddings/HuggingFaceInferenceAPIEmbeddings.py index 215ba9442833..54b6c312c13e 100644 --- a/src/backend/base/langflow/components/embeddings/HuggingFaceInferenceAPIEmbeddings.py +++ b/src/backend/base/langflow/components/embeddings/HuggingFaceInferenceAPIEmbeddings.py @@ -11,6 +11,7 @@ class HuggingFaceInferenceAPIEmbeddingsComponent(LCModelComponent): description = "Generate embeddings using Hugging Face Inference API models." documentation = "https://github.com/huggingface/text-embeddings-inference" icon = "HuggingFace" + name = "HuggingFaceInferenceAPIEmbeddings" inputs = [ SecretStrInput(name="api_key", display_name="API Key", advanced=True), diff --git a/src/backend/base/langflow/components/embeddings/MistalAIEmbeddings.py b/src/backend/base/langflow/components/embeddings/MistalAIEmbeddings.py index 39e63c53ccf7..f46a81f96ef9 100644 --- a/src/backend/base/langflow/components/embeddings/MistalAIEmbeddings.py +++ b/src/backend/base/langflow/components/embeddings/MistalAIEmbeddings.py @@ -10,6 +10,7 @@ class MistralAIEmbeddingsComponent(LCModelComponent): display_name = "MistralAI Embeddings" description = "Generate embeddings using MistralAI models." icon = "MistralAI" + name = "MistalAIEmbeddings" inputs = [ DropdownInput( diff --git a/src/backend/base/langflow/components/embeddings/OllamaEmbeddings.py b/src/backend/base/langflow/components/embeddings/OllamaEmbeddings.py index 103ca3f1bdef..5a17c0ed455c 100644 --- a/src/backend/base/langflow/components/embeddings/OllamaEmbeddings.py +++ b/src/backend/base/langflow/components/embeddings/OllamaEmbeddings.py @@ -10,6 +10,7 @@ class OllamaEmbeddingsComponent(LCModelComponent): description: str = "Generate embeddings using Ollama models." documentation = "https://python.langchain.com/docs/integrations/text_embedding/ollama" icon = "Ollama" + name = "OllamaEmbeddings" inputs = [ MessageTextInput( diff --git a/src/backend/base/langflow/components/embeddings/OpenAIEmbeddings.py b/src/backend/base/langflow/components/embeddings/OpenAIEmbeddings.py index 7f56874be217..7fde4c326963 100644 --- a/src/backend/base/langflow/components/embeddings/OpenAIEmbeddings.py +++ b/src/backend/base/langflow/components/embeddings/OpenAIEmbeddings.py @@ -9,6 +9,8 @@ class OpenAIEmbeddingsComponent(LCEmbeddingsModel): display_name = "OpenAI Embeddings" description = "Generate embeddings using OpenAI models." icon = "OpenAI" + name = "OpenAIEmbeddings" + inputs = [ DictInput( name="default_headers", diff --git a/src/backend/base/langflow/components/embeddings/VertexAIEmbeddings.py b/src/backend/base/langflow/components/embeddings/VertexAIEmbeddings.py index 31c1ae528672..7b2374482aa1 100644 --- a/src/backend/base/langflow/components/embeddings/VertexAIEmbeddings.py +++ b/src/backend/base/langflow/components/embeddings/VertexAIEmbeddings.py @@ -7,6 +7,7 @@ class VertexAIEmbeddingsComponent(LCModelComponent): display_name = "VertexAI Embeddings" description = "Generate embeddings using Google Cloud VertexAI models." icon = "VertexAI" + name = "VertexAIEmbeddings" inputs = [ FileInput( diff --git a/src/backend/base/langflow/components/helpers/CombineText.py b/src/backend/base/langflow/components/helpers/CombineText.py index 6bb3246c0726..251d337cc429 100644 --- a/src/backend/base/langflow/components/helpers/CombineText.py +++ b/src/backend/base/langflow/components/helpers/CombineText.py @@ -7,6 +7,7 @@ class CombineTextComponent(Component): display_name = "Combine Text" description = "Concatenate two text sources into a single text chunk using a specified delimiter." icon = "merge" + name = "CombineText" inputs = [ MessageTextInput( diff --git a/src/backend/base/langflow/components/helpers/CreateList.py b/src/backend/base/langflow/components/helpers/CreateList.py index ea0130eccee2..678500b2381b 100644 --- a/src/backend/base/langflow/components/helpers/CreateList.py +++ b/src/backend/base/langflow/components/helpers/CreateList.py @@ -8,6 +8,7 @@ class CreateListComponent(Component): display_name = "Create List" description = "Creates a list of texts." icon = "list" + name = "CreateList" inputs = [ StrInput( diff --git a/src/backend/base/langflow/components/helpers/CustomComponent.py b/src/backend/base/langflow/components/helpers/CustomComponent.py index 1ff54fe80554..df5db7dc0137 100644 --- a/src/backend/base/langflow/components/helpers/CustomComponent.py +++ b/src/backend/base/langflow/components/helpers/CustomComponent.py @@ -9,6 +9,7 @@ class CustomComponent(Component): description = "Use as a template to create your own component." documentation: str = "http://docs.langflow.org/components/custom" icon = "custom_components" + name = "CustomComponent" inputs = [ MessageTextInput(name="input_value", display_name="Input Value", value="Hello, World!"), diff --git a/src/backend/base/langflow/components/helpers/FilterData.py b/src/backend/base/langflow/components/helpers/FilterData.py index 94551854d7b3..3832e4e84df4 100644 --- a/src/backend/base/langflow/components/helpers/FilterData.py +++ b/src/backend/base/langflow/components/helpers/FilterData.py @@ -10,6 +10,7 @@ class FilterDataComponent(Component): description = "Filters a Data object based on a list of keys." icon = "filter" beta = True + name = "FilterData" inputs = [ DataInput( diff --git a/src/backend/base/langflow/components/helpers/IDGenerator.py b/src/backend/base/langflow/components/helpers/IDGenerator.py index 7e63f870b434..5dd5ebe90e59 100644 --- a/src/backend/base/langflow/components/helpers/IDGenerator.py +++ b/src/backend/base/langflow/components/helpers/IDGenerator.py @@ -8,6 +8,7 @@ class IDGeneratorComponent(CustomComponent): display_name = "ID Generator" description = "Generates a unique ID." + name = "IDGenerator" def update_build_config( # type: ignore self, build_config: dotdict, field_value: Any, field_name: Optional[str] = None diff --git a/src/backend/base/langflow/components/helpers/Memory.py b/src/backend/base/langflow/components/helpers/Memory.py index 757526bbab49..db5fe6acc439 100644 --- a/src/backend/base/langflow/components/helpers/Memory.py +++ b/src/backend/base/langflow/components/helpers/Memory.py @@ -10,6 +10,7 @@ class MemoryComponent(Component): display_name = "Chat Memory" description = "Retrieves stored chat messages." icon = "message-square-more" + name = "Memory" inputs = [ DropdownInput( diff --git a/src/backend/base/langflow/components/helpers/MergeData.py b/src/backend/base/langflow/components/helpers/MergeData.py index 5d434d3cf6f3..9d4847f0868c 100644 --- a/src/backend/base/langflow/components/helpers/MergeData.py +++ b/src/backend/base/langflow/components/helpers/MergeData.py @@ -6,6 +6,7 @@ class MergeDataComponent(CustomComponent): display_name = "Merge Data" description = "Combines multiple data sources into a single unified Data object." beta: bool = True + name = "MergeData" field_config = { "data": {"display_name": "Data"}, diff --git a/src/backend/base/langflow/components/helpers/ParseData.py b/src/backend/base/langflow/components/helpers/ParseData.py index 32482bcdb56c..62f757d49cfd 100644 --- a/src/backend/base/langflow/components/helpers/ParseData.py +++ b/src/backend/base/langflow/components/helpers/ParseData.py @@ -8,6 +8,7 @@ class ParseDataComponent(Component): display_name = "Parse Data" description = "Convert Data into plain text following a specified template." icon = "braces" + name = "ParseData" inputs = [ DataInput(name="data", display_name="Data", info="The data to convert to text."), diff --git a/src/backend/base/langflow/components/helpers/SplitText.py b/src/backend/base/langflow/components/helpers/SplitText.py index f3529baf3ff4..88f911057e91 100644 --- a/src/backend/base/langflow/components/helpers/SplitText.py +++ b/src/backend/base/langflow/components/helpers/SplitText.py @@ -12,6 +12,7 @@ class SplitTextComponent(Component): display_name: str = "Split Text" description: str = "Split text into chunks based on specified criteria." icon = "scissors-line-dashed" + name = "SplitText" inputs = [ HandleInput( diff --git a/src/backend/base/langflow/components/helpers/StoreMessage.py b/src/backend/base/langflow/components/helpers/StoreMessage.py index ce1abbe29e9c..ce138bb9cb08 100644 --- a/src/backend/base/langflow/components/helpers/StoreMessage.py +++ b/src/backend/base/langflow/components/helpers/StoreMessage.py @@ -9,6 +9,7 @@ class StoreMessageComponent(Component): display_name = "Store Message" description = "Stores a chat message or text." icon = "save" + name = "StoreMessage" inputs = [ MessageInput(name="message", display_name="Message", info="The chat message to be stored.", required=True), diff --git a/src/backend/base/langflow/components/inputs/ChatInput.py b/src/backend/base/langflow/components/inputs/ChatInput.py index 4d42dece4f24..b921b1673788 100644 --- a/src/backend/base/langflow/components/inputs/ChatInput.py +++ b/src/backend/base/langflow/components/inputs/ChatInput.py @@ -8,6 +8,7 @@ class ChatInput(ChatComponent): display_name = "Chat Input" description = "Get chat inputs from the Playground." icon = "ChatInput" + name = "ChatInput" inputs = [ MultilineInput( diff --git a/src/backend/base/langflow/components/inputs/TextInput.py b/src/backend/base/langflow/components/inputs/TextInput.py index f05398369ed8..6495f9ab63f5 100644 --- a/src/backend/base/langflow/components/inputs/TextInput.py +++ b/src/backend/base/langflow/components/inputs/TextInput.py @@ -7,6 +7,7 @@ class TextInputComponent(TextComponent): display_name = "Text Input" description = "Get text inputs from the Playground." icon = "type" + name = "TextInput" inputs = [ MessageTextInput( diff --git a/src/backend/base/langflow/components/langchain_utilities/BingSearchAPIWrapper.py b/src/backend/base/langflow/components/langchain_utilities/BingSearchAPIWrapper.py index 848d10985870..04520dd33494 100644 --- a/src/backend/base/langflow/components/langchain_utilities/BingSearchAPIWrapper.py +++ b/src/backend/base/langflow/components/langchain_utilities/BingSearchAPIWrapper.py @@ -9,6 +9,7 @@ class BingSearchAPIWrapperComponent(CustomComponent): display_name = "BingSearchAPIWrapper" description = "Wrapper for Bing Search API." + name = "BingSearchAPIWrapper" def build_config(self): return { diff --git a/src/backend/base/langflow/components/langchain_utilities/FirecrawlCrawlApi.py b/src/backend/base/langflow/components/langchain_utilities/FirecrawlCrawlApi.py index 7b48677b0fa0..e152b797edc6 100644 --- a/src/backend/base/langflow/components/langchain_utilities/FirecrawlCrawlApi.py +++ b/src/backend/base/langflow/components/langchain_utilities/FirecrawlCrawlApi.py @@ -8,6 +8,8 @@ class FirecrawlCrawlApi(CustomComponent): display_name: str = "FirecrawlCrawlApi" description: str = "Firecrawl Crawl API." + name = "FirecrawlCrawlApi" + output_types: list[str] = ["Document"] documentation: str = "https://docs.firecrawl.dev/api-reference/endpoint/crawl" field_config = { diff --git a/src/backend/base/langflow/components/langchain_utilities/FirecrawlScrapeApi.py b/src/backend/base/langflow/components/langchain_utilities/FirecrawlScrapeApi.py index ae5fbe784a2f..9ed720a6770c 100644 --- a/src/backend/base/langflow/components/langchain_utilities/FirecrawlScrapeApi.py +++ b/src/backend/base/langflow/components/langchain_utilities/FirecrawlScrapeApi.py @@ -7,6 +7,8 @@ class FirecrawlScrapeApi(CustomComponent): display_name: str = "FirecrawlScrapeApi" description: str = "Firecrawl Scrape API." + name = "FirecrawlScrapeApi" + output_types: list[str] = ["Document"] documentation: str = "https://docs.firecrawl.dev/api-reference/endpoint/scrape" field_config = { diff --git a/src/backend/base/langflow/components/langchain_utilities/GoogleSearchAPIWrapper.py b/src/backend/base/langflow/components/langchain_utilities/GoogleSearchAPIWrapper.py index 5e45219ccdec..fe804961e3b4 100644 --- a/src/backend/base/langflow/components/langchain_utilities/GoogleSearchAPIWrapper.py +++ b/src/backend/base/langflow/components/langchain_utilities/GoogleSearchAPIWrapper.py @@ -8,6 +8,7 @@ class GoogleSearchAPIWrapperComponent(CustomComponent): display_name = "GoogleSearchAPIWrapper" description = "Wrapper for Google Search API." + name = "GoogleSearchAPIWrapper" def build_config(self): return { diff --git a/src/backend/base/langflow/components/langchain_utilities/GoogleSerperAPIWrapper.py b/src/backend/base/langflow/components/langchain_utilities/GoogleSerperAPIWrapper.py index 2b9a494582c5..2f52614113bf 100644 --- a/src/backend/base/langflow/components/langchain_utilities/GoogleSerperAPIWrapper.py +++ b/src/backend/base/langflow/components/langchain_utilities/GoogleSerperAPIWrapper.py @@ -10,6 +10,7 @@ class GoogleSerperAPIWrapperComponent(CustomComponent): display_name = "GoogleSerperAPIWrapper" description = "Wrapper around the Serper.dev Google Search API." + name = "GoogleSerperAPIWrapper" def build_config(self) -> Dict[str, Dict]: return { diff --git a/src/backend/base/langflow/components/langchain_utilities/JSONDocumentBuilder.py b/src/backend/base/langflow/components/langchain_utilities/JSONDocumentBuilder.py index c0300cff0563..e4d3300641d7 100644 --- a/src/backend/base/langflow/components/langchain_utilities/JSONDocumentBuilder.py +++ b/src/backend/base/langflow/components/langchain_utilities/JSONDocumentBuilder.py @@ -20,6 +20,8 @@ class JSONDocumentBuilder(CustomComponent): display_name: str = "JSON Document Builder" description: str = "Build a Document containing a JSON object using a key and another Document page content." + name = "JSONDocumentBuilder" + output_types: list[str] = ["Document"] documentation: str = "https://docs.langflow.org/components/utilities#json-document-builder" diff --git a/src/backend/base/langflow/components/langchain_utilities/SQLDatabase.py b/src/backend/base/langflow/components/langchain_utilities/SQLDatabase.py index 93c46087dfd6..e9c7565d6e47 100644 --- a/src/backend/base/langflow/components/langchain_utilities/SQLDatabase.py +++ b/src/backend/base/langflow/components/langchain_utilities/SQLDatabase.py @@ -6,6 +6,7 @@ class SQLDatabaseComponent(CustomComponent): display_name = "SQLDatabase" description = "SQL Database" + name = "SQLDatabase" def build_config(self): return { diff --git a/src/backend/base/langflow/components/langchain_utilities/SearchApi.py b/src/backend/base/langflow/components/langchain_utilities/SearchApi.py index 5dfd5525019f..2b6f54de7a2b 100644 --- a/src/backend/base/langflow/components/langchain_utilities/SearchApi.py +++ b/src/backend/base/langflow/components/langchain_utilities/SearchApi.py @@ -10,6 +10,8 @@ class SearchApi(CustomComponent): display_name: str = "SearchApi" description: str = "Real-time search engine results API." + name = "SearchApi" + output_types: list[str] = ["Document"] documentation: str = "https://www.searchapi.io/docs/google" field_config = { diff --git a/src/backend/base/langflow/components/langchain_utilities/SearxSearchWrapper.py b/src/backend/base/langflow/components/langchain_utilities/SearxSearchWrapper.py index 4fe0706f88a8..90c1f6b55372 100644 --- a/src/backend/base/langflow/components/langchain_utilities/SearxSearchWrapper.py +++ b/src/backend/base/langflow/components/langchain_utilities/SearxSearchWrapper.py @@ -8,6 +8,7 @@ class SearxSearchWrapperComponent(CustomComponent): display_name = "SearxSearchWrapper" description = "Wrapper for Searx API." + name = "SearxSearchWrapper" def build_config(self): return { diff --git a/src/backend/base/langflow/components/langchain_utilities/SerpAPIWrapper.py b/src/backend/base/langflow/components/langchain_utilities/SerpAPIWrapper.py index d8aa404cb901..7bd8d911bcba 100644 --- a/src/backend/base/langflow/components/langchain_utilities/SerpAPIWrapper.py +++ b/src/backend/base/langflow/components/langchain_utilities/SerpAPIWrapper.py @@ -8,6 +8,7 @@ class SerpAPIWrapperComponent(CustomComponent): display_name = "SerpAPIWrapper" description = "Wrapper around SerpAPI" + name = "SerpAPIWrapper" def build_config(self): return { diff --git a/src/backend/base/langflow/components/langchain_utilities/WikipediaAPIWrapper.py b/src/backend/base/langflow/components/langchain_utilities/WikipediaAPIWrapper.py index 1c10dd4bdcee..ef1485532cd2 100644 --- a/src/backend/base/langflow/components/langchain_utilities/WikipediaAPIWrapper.py +++ b/src/backend/base/langflow/components/langchain_utilities/WikipediaAPIWrapper.py @@ -12,6 +12,7 @@ class WikipediaAPIWrapperComponent(CustomComponent): display_name = "WikipediaAPIWrapper" description = "Wrapper around WikipediaAPI." + name = "WikipediaAPIWrapper" def build_config(self): return {} diff --git a/src/backend/base/langflow/components/langchain_utilities/WolframAlphaAPIWrapper.py b/src/backend/base/langflow/components/langchain_utilities/WolframAlphaAPIWrapper.py index 42be1f1995c8..f8771d0ce571 100644 --- a/src/backend/base/langflow/components/langchain_utilities/WolframAlphaAPIWrapper.py +++ b/src/backend/base/langflow/components/langchain_utilities/WolframAlphaAPIWrapper.py @@ -11,6 +11,7 @@ class WolframAlphaAPIWrapperComponent(CustomComponent): display_name = "WolframAlphaAPIWrapper" description = "Wrapper for Wolfram Alpha." + name = "WolframAlphaAPIWrapper" def build_config(self): return {"appid": {"display_name": "App ID", "type": "str", "password": True}} diff --git a/src/backend/base/langflow/components/memories/AstraDBMessageReader.py b/src/backend/base/langflow/components/memories/AstraDBMessageReader.py index dfb8ef86a27f..52cdccdca159 100644 --- a/src/backend/base/langflow/components/memories/AstraDBMessageReader.py +++ b/src/backend/base/langflow/components/memories/AstraDBMessageReader.py @@ -7,6 +7,7 @@ class AstraDBMessageReaderComponent(BaseMemoryComponent): display_name = "Astra DB Message Reader" description = "Retrieves stored chat messages from Astra DB." + name = "AstraDBMessageReader" def build_config(self): return { diff --git a/src/backend/base/langflow/components/memories/AstraDBMessageWriter.py b/src/backend/base/langflow/components/memories/AstraDBMessageWriter.py index c929aca9e55b..b36b32882e6a 100644 --- a/src/backend/base/langflow/components/memories/AstraDBMessageWriter.py +++ b/src/backend/base/langflow/components/memories/AstraDBMessageWriter.py @@ -9,6 +9,7 @@ class AstraDBMessageWriterComponent(BaseMemoryComponent): display_name = "Astra DB Message Writer" description = "Writes a message to Astra DB." + name = "AstraDBMessageWriter" def build_config(self): return { diff --git a/src/backend/base/langflow/components/memories/CassandraMessageReader.py b/src/backend/base/langflow/components/memories/CassandraMessageReader.py index a8bd1c365848..889be0a9a02f 100644 --- a/src/backend/base/langflow/components/memories/CassandraMessageReader.py +++ b/src/backend/base/langflow/components/memories/CassandraMessageReader.py @@ -9,6 +9,7 @@ class CassandraMessageReaderComponent(BaseMemoryComponent): display_name = "Cassandra Message Reader" description = "Retrieves stored chat messages from a Cassandra table on Astra DB." + name = "CassandraMessageReader" def build_config(self): return { diff --git a/src/backend/base/langflow/components/memories/CassandraMessageWriter.py b/src/backend/base/langflow/components/memories/CassandraMessageWriter.py index 15da272749a8..33ca0fed1f1c 100644 --- a/src/backend/base/langflow/components/memories/CassandraMessageWriter.py +++ b/src/backend/base/langflow/components/memories/CassandraMessageWriter.py @@ -10,6 +10,7 @@ class CassandraMessageWriterComponent(BaseMemoryComponent): display_name = "Cassandra Message Writer" description = "Writes a message to a Cassandra table on Astra DB." + name = "CassandraMessageWriter" def build_config(self): return { diff --git a/src/backend/base/langflow/components/memories/ZepMessageReader.py b/src/backend/base/langflow/components/memories/ZepMessageReader.py index 89a16587bceb..935706794616 100644 --- a/src/backend/base/langflow/components/memories/ZepMessageReader.py +++ b/src/backend/base/langflow/components/memories/ZepMessageReader.py @@ -10,6 +10,7 @@ class ZepMessageReaderComponent(BaseMemoryComponent): display_name = "Zep Message Reader" description = "Retrieves stored chat messages from Zep." + name = "ZepMessageReader" def build_config(self): return { diff --git a/src/backend/base/langflow/components/memories/ZepMessageWriter.py b/src/backend/base/langflow/components/memories/ZepMessageWriter.py index cc343488e9e1..82382e701724 100644 --- a/src/backend/base/langflow/components/memories/ZepMessageWriter.py +++ b/src/backend/base/langflow/components/memories/ZepMessageWriter.py @@ -11,6 +11,7 @@ class ZepMessageWriterComponent(BaseMemoryComponent): display_name = "Zep Message Writer" description = "Writes a message to Zep." + name = "ZepMessageWriter" def build_config(self): return { diff --git a/src/backend/base/langflow/components/models/AmazonBedrockModel.py b/src/backend/base/langflow/components/models/AmazonBedrockModel.py index 168b689d9b4f..d21546502bed 100644 --- a/src/backend/base/langflow/components/models/AmazonBedrockModel.py +++ b/src/backend/base/langflow/components/models/AmazonBedrockModel.py @@ -11,6 +11,7 @@ class AmazonBedrockComponent(LCModelComponent): display_name: str = "Amazon Bedrock" description: str = "Generate text using Amazon Bedrock LLMs." icon = "Amazon" + name = "AmazonBedrockModel" inputs = [ MessageInput(name="input_value", display_name="Input"), diff --git a/src/backend/base/langflow/components/models/AnthropicModel.py b/src/backend/base/langflow/components/models/AnthropicModel.py index a8b7360c0144..0972dd577475 100644 --- a/src/backend/base/langflow/components/models/AnthropicModel.py +++ b/src/backend/base/langflow/components/models/AnthropicModel.py @@ -11,6 +11,7 @@ class AnthropicModelComponent(LCModelComponent): display_name = "Anthropic" description = "Generate text using Anthropic Chat&Completion LLMs with prefill support." icon = "Anthropic" + name = "AnthropicModel" inputs = [ MessageTextInput(name="input_value", display_name="Input"), diff --git a/src/backend/base/langflow/components/models/AzureOpenAIModel.py b/src/backend/base/langflow/components/models/AzureOpenAIModel.py index fabcf25a9e42..57b488cfae72 100644 --- a/src/backend/base/langflow/components/models/AzureOpenAIModel.py +++ b/src/backend/base/langflow/components/models/AzureOpenAIModel.py @@ -12,6 +12,7 @@ class AzureChatOpenAIComponent(LCModelComponent): documentation: str = "https://python.langchain.com/docs/integrations/llms/azure_openai" beta = False icon = "Azure" + name = "AzureOpenAIModel" AZURE_OPENAI_API_VERSIONS = [ "2023-03-15-preview", diff --git a/src/backend/base/langflow/components/models/BaiduQianfanChatModel.py b/src/backend/base/langflow/components/models/BaiduQianfanChatModel.py index efaa6a74f711..15ede57f7a32 100644 --- a/src/backend/base/langflow/components/models/BaiduQianfanChatModel.py +++ b/src/backend/base/langflow/components/models/BaiduQianfanChatModel.py @@ -12,6 +12,7 @@ class QianfanChatEndpointComponent(LCModelComponent): description: str = "Generate text using Baidu Qianfan LLMs." documentation: str = "https://python.langchain.com/docs/integrations/chat/baidu_qianfan_endpoint" icon = "BaiduQianfan" + name = "BaiduQianfanChatModel" inputs = [ MessageTextInput( diff --git a/src/backend/base/langflow/components/models/CohereModel.py b/src/backend/base/langflow/components/models/CohereModel.py index 2305533eff9e..890f916061ac 100644 --- a/src/backend/base/langflow/components/models/CohereModel.py +++ b/src/backend/base/langflow/components/models/CohereModel.py @@ -12,6 +12,7 @@ class CohereComponent(LCModelComponent): description = "Generate text using Cohere LLMs." documentation = "https://python.langchain.com/docs/modules/model_io/models/llms/integrations/cohere" icon = "Cohere" + name = "CohereModel" inputs = [ SecretStrInput( diff --git a/src/backend/base/langflow/components/models/GoogleGenerativeAIModel.py b/src/backend/base/langflow/components/models/GoogleGenerativeAIModel.py index 7bcaf0b0760d..e20f3150c1e9 100644 --- a/src/backend/base/langflow/components/models/GoogleGenerativeAIModel.py +++ b/src/backend/base/langflow/components/models/GoogleGenerativeAIModel.py @@ -10,6 +10,7 @@ class GoogleGenerativeAIComponent(LCModelComponent): display_name = "Google Generative AI" description = "Generate text using Google Generative AI." icon = "GoogleGenerativeAI" + name = "GoogleGenerativeAIModel" inputs = [ MessageInput(name="input_value", display_name="Input"), diff --git a/src/backend/base/langflow/components/models/GroqModel.py b/src/backend/base/langflow/components/models/GroqModel.py index fa8765a26465..d24ba3cf6228 100644 --- a/src/backend/base/langflow/components/models/GroqModel.py +++ b/src/backend/base/langflow/components/models/GroqModel.py @@ -12,6 +12,7 @@ class GroqModel(LCModelComponent): display_name: str = "Groq" description: str = "Generate text using Groq." icon = "Groq" + name = "GroqModel" inputs = [ SecretStrInput( diff --git a/src/backend/base/langflow/components/models/HuggingFaceModel.py b/src/backend/base/langflow/components/models/HuggingFaceModel.py index ff7b440fe64a..6995eb765029 100644 --- a/src/backend/base/langflow/components/models/HuggingFaceModel.py +++ b/src/backend/base/langflow/components/models/HuggingFaceModel.py @@ -11,6 +11,7 @@ class HuggingFaceEndpointsComponent(LCModelComponent): display_name: str = "Hugging Face API" description: str = "Generate text using Hugging Face Inference APIs." icon = "HuggingFace" + name = "HuggingFaceModel" inputs = [ MessageInput(name="input_value", display_name="Input"), diff --git a/src/backend/base/langflow/components/models/MistralModel.py b/src/backend/base/langflow/components/models/MistralModel.py index aeeca80a266f..3aa9fcb3a4fc 100644 --- a/src/backend/base/langflow/components/models/MistralModel.py +++ b/src/backend/base/langflow/components/models/MistralModel.py @@ -11,6 +11,7 @@ class MistralAIModelComponent(LCModelComponent): display_name = "MistralAI" description = "Generates text using MistralAI LLMs." icon = "MistralAI" + name = "MistralModel" inputs = [ MessageInput(name="input_value", display_name="Input"), diff --git a/src/backend/base/langflow/components/models/OllamaModel.py b/src/backend/base/langflow/components/models/OllamaModel.py index d58736ecd99b..3419aace27a3 100644 --- a/src/backend/base/langflow/components/models/OllamaModel.py +++ b/src/backend/base/langflow/components/models/OllamaModel.py @@ -13,6 +13,7 @@ class ChatOllamaComponent(LCModelComponent): display_name = "Ollama" description = "Generate text using Ollama Local LLMs." icon = "Ollama" + name = "OllamaModel" def update_build_config(self, build_config: dict, field_value: Any, field_name: str | None = None): if field_name == "mirostat": diff --git a/src/backend/base/langflow/components/models/OpenAIModel.py b/src/backend/base/langflow/components/models/OpenAIModel.py index 0cdc8fdf9e21..9c5fc1d48326 100644 --- a/src/backend/base/langflow/components/models/OpenAIModel.py +++ b/src/backend/base/langflow/components/models/OpenAIModel.py @@ -24,6 +24,7 @@ class OpenAIModelComponent(LCModelComponent): display_name = "OpenAI" description = "Generates text using OpenAI LLMs." icon = "OpenAI" + name = "OpenAIModel" inputs = [ MessageInput(name="input_value", display_name="Input"), diff --git a/src/backend/base/langflow/components/models/VertexAiModel.py b/src/backend/base/langflow/components/models/VertexAiModel.py index 11bf63f6eb4a..32cb8f51dd00 100644 --- a/src/backend/base/langflow/components/models/VertexAiModel.py +++ b/src/backend/base/langflow/components/models/VertexAiModel.py @@ -10,6 +10,7 @@ class ChatVertexAIComponent(LCModelComponent): display_name = "Vertex AI" description = "Generate text using Vertex AI LLMs." icon = "VertexAI" + name = "VertexAiModel" inputs = [ MessageInput(name="input_value", display_name="Input"), diff --git a/src/backend/base/langflow/components/outputs/ChatOutput.py b/src/backend/base/langflow/components/outputs/ChatOutput.py index 534ccf2f0359..e1f40ec76390 100644 --- a/src/backend/base/langflow/components/outputs/ChatOutput.py +++ b/src/backend/base/langflow/components/outputs/ChatOutput.py @@ -7,6 +7,7 @@ class ChatOutput(ChatComponent): display_name = "Chat Output" description = "Display a chat message in the Playground." icon = "ChatOutput" + name = "ChatOutput" inputs = [ MessageTextInput( diff --git a/src/backend/base/langflow/components/outputs/TextOutput.py b/src/backend/base/langflow/components/outputs/TextOutput.py index 4bd03e2e0273..ee8276b42b77 100644 --- a/src/backend/base/langflow/components/outputs/TextOutput.py +++ b/src/backend/base/langflow/components/outputs/TextOutput.py @@ -7,6 +7,7 @@ class TextOutputComponent(TextComponent): display_name = "Text Output" description = "Display a text output in the Playground." icon = "type" + name = "TextOutput" inputs = [ MessageTextInput( diff --git a/src/backend/base/langflow/components/prompts/Prompt.py b/src/backend/base/langflow/components/prompts/Prompt.py index 8f8d3d6a2691..c102fba3b5a5 100644 --- a/src/backend/base/langflow/components/prompts/Prompt.py +++ b/src/backend/base/langflow/components/prompts/Prompt.py @@ -10,6 +10,7 @@ class PromptComponent(Component): description: str = "Create a prompt template with dynamic variables." icon = "prompts" trace_type = "prompt" + name = "Prompt" inputs = [ PromptInput(name="template", display_name="Template"), diff --git a/src/backend/base/langflow/components/prototypes/ConditionalRouter.py b/src/backend/base/langflow/components/prototypes/ConditionalRouter.py index 6d24bfa5e1ea..133a84867e30 100644 --- a/src/backend/base/langflow/components/prototypes/ConditionalRouter.py +++ b/src/backend/base/langflow/components/prototypes/ConditionalRouter.py @@ -7,6 +7,7 @@ class ConditionalRouterComponent(Component): display_name = "Conditional Router" description = "Routes an input message to a corresponding output based on text comparison." icon = "equal" + name = "ConditionalRouter" inputs = [ MessageTextInput( diff --git a/src/backend/base/langflow/components/prototypes/CreateData.py b/src/backend/base/langflow/components/prototypes/CreateData.py index 3b0a31083b99..17a75962b730 100644 --- a/src/backend/base/langflow/components/prototypes/CreateData.py +++ b/src/backend/base/langflow/components/prototypes/CreateData.py @@ -13,6 +13,7 @@ class CreateDataComponent(Component): display_name: str = "Create Data" description: str = "Dynamically create a Data with a specified number of fields." + name: str = "CreateData" inputs = [ IntInput( diff --git a/src/backend/base/langflow/components/prototypes/FlowTool.py b/src/backend/base/langflow/components/prototypes/FlowTool.py index a1c9bc4eb6d2..d4a038e6f30e 100644 --- a/src/backend/base/langflow/components/prototypes/FlowTool.py +++ b/src/backend/base/langflow/components/prototypes/FlowTool.py @@ -16,6 +16,7 @@ class FlowToolComponent(CustomComponent): description = "Construct a Tool from a function that runs the loaded Flow." field_order = ["flow_name", "name", "description", "return_direct"] trace_type = "tool" + name = "FlowTool" beta = True def get_flow_names(self) -> List[str]: diff --git a/src/backend/base/langflow/components/prototypes/Listen.py b/src/backend/base/langflow/components/prototypes/Listen.py index 03a81d130ee5..23b9c3ee13db 100644 --- a/src/backend/base/langflow/components/prototypes/Listen.py +++ b/src/backend/base/langflow/components/prototypes/Listen.py @@ -5,6 +5,7 @@ class ListenComponent(CustomComponent): display_name = "Listen" description = "A component to listen for a notification." + name = "Listen" beta: bool = True def build_config(self): diff --git a/src/backend/base/langflow/components/prototypes/Notify.py b/src/backend/base/langflow/components/prototypes/Notify.py index e4bd0b090b19..c07baae34eb3 100644 --- a/src/backend/base/langflow/components/prototypes/Notify.py +++ b/src/backend/base/langflow/components/prototypes/Notify.py @@ -8,6 +8,7 @@ class NotifyComponent(CustomComponent): display_name = "Notify" description = "A component to generate a notification to Get Notified component." icon = "Notify" + name = "Notify" beta: bool = True def build_config(self): diff --git a/src/backend/base/langflow/components/prototypes/Pass.py b/src/backend/base/langflow/components/prototypes/Pass.py index 28e9ea524e45..ae527976c1cf 100644 --- a/src/backend/base/langflow/components/prototypes/Pass.py +++ b/src/backend/base/langflow/components/prototypes/Pass.py @@ -7,6 +7,7 @@ class PassMessageComponent(Component): display_name = "Pass" description = "Forwards the input message, unchanged." + name = "Pass" icon = "arrow-right" inputs = [ diff --git a/src/backend/base/langflow/components/prototypes/PythonFunction.py b/src/backend/base/langflow/components/prototypes/PythonFunction.py index f0f2386366c5..bc5576f89c33 100644 --- a/src/backend/base/langflow/components/prototypes/PythonFunction.py +++ b/src/backend/base/langflow/components/prototypes/PythonFunction.py @@ -9,6 +9,7 @@ class PythonFunctionComponent(CustomComponent): display_name = "Python Function" description = "Define a Python function." icon = "Python" + name = "PythonFunction" beta = True def build_config(self): diff --git a/src/backend/base/langflow/components/prototypes/RunFlow.py b/src/backend/base/langflow/components/prototypes/RunFlow.py index d5b2362fb802..2114cdc557b3 100644 --- a/src/backend/base/langflow/components/prototypes/RunFlow.py +++ b/src/backend/base/langflow/components/prototypes/RunFlow.py @@ -10,6 +10,7 @@ class RunFlowComponent(CustomComponent): display_name = "Run Flow" description = "A component to run a flow." + name = "RunFlow" beta: bool = True def get_flow_names(self) -> List[str]: diff --git a/src/backend/base/langflow/components/prototypes/RunnableExecutor.py b/src/backend/base/langflow/components/prototypes/RunnableExecutor.py index 82260b76b8ae..ab85e1e9c864 100644 --- a/src/backend/base/langflow/components/prototypes/RunnableExecutor.py +++ b/src/backend/base/langflow/components/prototypes/RunnableExecutor.py @@ -7,6 +7,7 @@ class RunnableExecComponent(CustomComponent): description = "Execute a runnable. It will try to guess the input and output keys." display_name = "Runnable Executor" + name = "RunnableExecutor" beta: bool = True field_order = [ "input_key", diff --git a/src/backend/base/langflow/components/prototypes/SQLExecutor.py b/src/backend/base/langflow/components/prototypes/SQLExecutor.py index 6ef92ba6dcfe..cafc92fb4095 100644 --- a/src/backend/base/langflow/components/prototypes/SQLExecutor.py +++ b/src/backend/base/langflow/components/prototypes/SQLExecutor.py @@ -8,6 +8,7 @@ class SQLExecutorComponent(CustomComponent): display_name = "SQL Executor" description = "Execute SQL query." + name = "SQLExecutor" beta: bool = True def build_config(self): diff --git a/src/backend/base/langflow/components/prototypes/SubFlow.py b/src/backend/base/langflow/components/prototypes/SubFlow.py index b0631ee99101..f3f0b46232f2 100644 --- a/src/backend/base/langflow/components/prototypes/SubFlow.py +++ b/src/backend/base/langflow/components/prototypes/SubFlow.py @@ -17,6 +17,7 @@ class SubFlowComponent(CustomComponent): description = ( "Dynamically Generates a Component from a Flow. The output is a list of data with keys 'result' and 'message'." ) + name = "SubFlow" beta: bool = True field_order = ["flow_name"] diff --git a/src/backend/base/langflow/components/prototypes/UpdateData.py b/src/backend/base/langflow/components/prototypes/UpdateData.py index eebd35ec8b49..10355d2df225 100644 --- a/src/backend/base/langflow/components/prototypes/UpdateData.py +++ b/src/backend/base/langflow/components/prototypes/UpdateData.py @@ -5,6 +5,7 @@ class UpdateDataComponent(CustomComponent): display_name = "Update Data" description = "Update Data with text-based key/value pairs, similar to updating a Python dictionary." + name = "UpdateData" def build_config(self): return { diff --git a/src/backend/base/langflow/components/retrievers/AmazonKendra.py b/src/backend/base/langflow/components/retrievers/AmazonKendra.py index 90c70a7bc010..8c4252c26481 100644 --- a/src/backend/base/langflow/components/retrievers/AmazonKendra.py +++ b/src/backend/base/langflow/components/retrievers/AmazonKendra.py @@ -9,6 +9,7 @@ class AmazonKendraRetrieverComponent(CustomComponent): display_name: str = "Amazon Kendra Retriever" description: str = "Retriever that uses the Amazon Kendra API." + name = "AmazonKendra" icon = "Amazon" def build_config(self): diff --git a/src/backend/base/langflow/components/retrievers/CohereRerank.py b/src/backend/base/langflow/components/retrievers/CohereRerank.py index 7eedc1ee068f..f7f22e4a1716 100644 --- a/src/backend/base/langflow/components/retrievers/CohereRerank.py +++ b/src/backend/base/langflow/components/retrievers/CohereRerank.py @@ -12,6 +12,7 @@ class CohereRerankComponent(LCVectorStoreComponent): display_name = "Cohere Rerank" description = "Rerank documents using the Cohere API and a retriever." + name = "CohereRerank" icon = "Cohere" inputs = [ diff --git a/src/backend/base/langflow/components/retrievers/MetalRetriever.py b/src/backend/base/langflow/components/retrievers/MetalRetriever.py index f3af0ebb0569..f5ce37d05e1a 100644 --- a/src/backend/base/langflow/components/retrievers/MetalRetriever.py +++ b/src/backend/base/langflow/components/retrievers/MetalRetriever.py @@ -10,6 +10,7 @@ class MetalRetrieverComponent(CustomComponent): display_name: str = "Metal Retriever" description: str = "Retriever that uses the Metal API." + name = "MetalRetriever" def build_config(self): return { diff --git a/src/backend/base/langflow/components/retrievers/MultiQueryRetriever.py b/src/backend/base/langflow/components/retrievers/MultiQueryRetriever.py index f7b2eda6ba98..c662f701e339 100644 --- a/src/backend/base/langflow/components/retrievers/MultiQueryRetriever.py +++ b/src/backend/base/langflow/components/retrievers/MultiQueryRetriever.py @@ -10,6 +10,7 @@ class MultiQueryRetrieverComponent(CustomComponent): display_name = "MultiQueryRetriever" description = "Initialize from llm using default template." documentation = "https://python.langchain.com/docs/modules/data_connection/retrievers/how_to/MultiQueryRetriever" + name = "MultiQueryRetriever" def build_config(self): return { diff --git a/src/backend/base/langflow/components/retrievers/SelfQueryRetriever.py b/src/backend/base/langflow/components/retrievers/SelfQueryRetriever.py index fd61a32deafc..405e8fc70b79 100644 --- a/src/backend/base/langflow/components/retrievers/SelfQueryRetriever.py +++ b/src/backend/base/langflow/components/retrievers/SelfQueryRetriever.py @@ -12,6 +12,7 @@ class SelfQueryRetrieverComponent(CustomComponent): display_name: str = "Self Query Retriever" description: str = "Retriever that uses a vector store and an LLM to generate the vector store queries." + name = "SelfQueryRetriever" icon = "LangChain" def build_config(self): diff --git a/src/backend/base/langflow/components/retrievers/VectaraSelfQueryRetriver.py b/src/backend/base/langflow/components/retrievers/VectaraSelfQueryRetriver.py index a328b2b20f7b..d8580b55a3e9 100644 --- a/src/backend/base/langflow/components/retrievers/VectaraSelfQueryRetriver.py +++ b/src/backend/base/langflow/components/retrievers/VectaraSelfQueryRetriver.py @@ -18,6 +18,7 @@ class VectaraSelfQueryRetriverComponent(CustomComponent): display_name: str = "Vectara Self Query Retriever for Vectara Vector Store" description: str = "Implementation of Vectara Self Query Retriever" documentation = "https://python.langchain.com/docs/integrations/retrievers/self_query/vectara_self_query" + name = "VectaraSelfQueryRetriver" icon = "Vectara" field_config = { diff --git a/src/backend/base/langflow/components/retrievers/VectorStoreRetriever.py b/src/backend/base/langflow/components/retrievers/VectorStoreRetriever.py index 6460e04582fe..b4ef2c846495 100644 --- a/src/backend/base/langflow/components/retrievers/VectorStoreRetriever.py +++ b/src/backend/base/langflow/components/retrievers/VectorStoreRetriever.py @@ -7,6 +7,7 @@ class VectoStoreRetrieverComponent(CustomComponent): display_name = "VectorStore Retriever" description = "A vector store retriever" + name = "VectorStoreRetriever" def build_config(self): return { diff --git a/src/backend/base/langflow/components/textsplitters/CharacterTextSplitter.py b/src/backend/base/langflow/components/textsplitters/CharacterTextSplitter.py index c0f00b07867b..1a17b0cf72e9 100644 --- a/src/backend/base/langflow/components/textsplitters/CharacterTextSplitter.py +++ b/src/backend/base/langflow/components/textsplitters/CharacterTextSplitter.py @@ -10,6 +10,7 @@ class CharacterTextSplitterComponent(CustomComponent): display_name = "CharacterTextSplitter" description = "Splitting text that looks at characters." + name = "CharacterTextSplitter" def build_config(self): return { diff --git a/src/backend/base/langflow/components/textsplitters/LanguageRecursiveTextSplitter.py b/src/backend/base/langflow/components/textsplitters/LanguageRecursiveTextSplitter.py index 4c074e8616be..39988aafa3ce 100644 --- a/src/backend/base/langflow/components/textsplitters/LanguageRecursiveTextSplitter.py +++ b/src/backend/base/langflow/components/textsplitters/LanguageRecursiveTextSplitter.py @@ -10,6 +10,7 @@ class LanguageRecursiveTextSplitterComponent(CustomComponent): display_name: str = "Language Recursive Text Splitter" description: str = "Split text into chunks of a specified length based on language." documentation: str = "https://docs.langflow.org/components/text-splitters#languagerecursivetextsplitter" + name = "LanguageRecursiveTextSplitter" def build_config(self): options = [x.value for x in Language] diff --git a/src/backend/base/langflow/components/textsplitters/RecursiveCharacterTextSplitter.py b/src/backend/base/langflow/components/textsplitters/RecursiveCharacterTextSplitter.py index f1385f16532c..02aba8a666ad 100644 --- a/src/backend/base/langflow/components/textsplitters/RecursiveCharacterTextSplitter.py +++ b/src/backend/base/langflow/components/textsplitters/RecursiveCharacterTextSplitter.py @@ -11,6 +11,7 @@ class RecursiveCharacterTextSplitterComponent(Component): display_name: str = "Recursive Character Text Splitter" description: str = "Split text into chunks of a specified length." documentation: str = "https://docs.langflow.org/components/text-splitters#recursivecharactertextsplitter" + name = "RecursiveCharacterTextSplitter" inputs = [ IntInput( diff --git a/src/backend/base/langflow/components/toolkits/JsonToolkit.py b/src/backend/base/langflow/components/toolkits/JsonToolkit.py index 09a613336a5e..96dc3324853c 100644 --- a/src/backend/base/langflow/components/toolkits/JsonToolkit.py +++ b/src/backend/base/langflow/components/toolkits/JsonToolkit.py @@ -10,6 +10,7 @@ class JsonToolkitComponent(CustomComponent): display_name = "JsonToolkit" description = "Toolkit for interacting with a JSON spec." + name = "JsonToolkit" def build_config(self): return { diff --git a/src/backend/base/langflow/components/toolkits/Metaphor.py b/src/backend/base/langflow/components/toolkits/Metaphor.py index 9ebd4f7713d0..73c7645120a5 100644 --- a/src/backend/base/langflow/components/toolkits/Metaphor.py +++ b/src/backend/base/langflow/components/toolkits/Metaphor.py @@ -12,6 +12,7 @@ class MetaphorToolkit(CustomComponent): description: str = "Metaphor Toolkit" documentation = "https://python.langchain.com/docs/integrations/tools/metaphor_search" beta: bool = True + name = "Metaphor" # api key should be password = True field_config = { "metaphor_api_key": {"display_name": "Metaphor API Key", "password": True}, diff --git a/src/backend/base/langflow/components/toolkits/OpenAPIToolkit.py b/src/backend/base/langflow/components/toolkits/OpenAPIToolkit.py index 0639dae0ca5b..5a72c7f2f3cd 100644 --- a/src/backend/base/langflow/components/toolkits/OpenAPIToolkit.py +++ b/src/backend/base/langflow/components/toolkits/OpenAPIToolkit.py @@ -12,6 +12,7 @@ class OpenAPIToolkitComponent(CustomComponent): display_name = "OpenAPIToolkit" description = "Toolkit for interacting with an OpenAPI API." + name = "OpenAPIToolkit" def build_config(self): return { diff --git a/src/backend/base/langflow/components/toolkits/VectorStoreInfo.py b/src/backend/base/langflow/components/toolkits/VectorStoreInfo.py index 60bd6598ece9..c1c47e45f028 100644 --- a/src/backend/base/langflow/components/toolkits/VectorStoreInfo.py +++ b/src/backend/base/langflow/components/toolkits/VectorStoreInfo.py @@ -7,6 +7,7 @@ class VectorStoreInfoComponent(CustomComponent): display_name = "VectorStoreInfo" description = "Information about a VectorStore" + name = "VectorStoreInfo" def build_config(self): return { diff --git a/src/backend/base/langflow/components/toolkits/VectorStoreRouterToolkit.py b/src/backend/base/langflow/components/toolkits/VectorStoreRouterToolkit.py index 6e5b5d6137f6..0676312a2de0 100644 --- a/src/backend/base/langflow/components/toolkits/VectorStoreRouterToolkit.py +++ b/src/backend/base/langflow/components/toolkits/VectorStoreRouterToolkit.py @@ -9,6 +9,7 @@ class VectorStoreRouterToolkitComponent(CustomComponent): display_name = "VectorStoreRouterToolkit" description = "Toolkit for routing between Vector Stores." + name = "VectorStoreRouterToolkit" def build_config(self): return { diff --git a/src/backend/base/langflow/components/toolkits/VectorStoreToolkit.py b/src/backend/base/langflow/components/toolkits/VectorStoreToolkit.py index fc63bb66f140..74fe5d33c268 100644 --- a/src/backend/base/langflow/components/toolkits/VectorStoreToolkit.py +++ b/src/backend/base/langflow/components/toolkits/VectorStoreToolkit.py @@ -9,6 +9,7 @@ class VectorStoreToolkitComponent(CustomComponent): display_name = "VectorStoreToolkit" description = "Toolkit for interacting with a Vector Store." + name = "VectorStoreToolkit" def build_config(self): return { diff --git a/src/backend/base/langflow/components/tools/PythonCodeStructuredTool.py b/src/backend/base/langflow/components/tools/PythonCodeStructuredTool.py index 84392cbdb4aa..ef3c3b8a854a 100644 --- a/src/backend/base/langflow/components/tools/PythonCodeStructuredTool.py +++ b/src/backend/base/langflow/components/tools/PythonCodeStructuredTool.py @@ -12,6 +12,7 @@ class PythonCodeStructuredTool(CustomComponent): display_name = "PythonCodeTool" description = "structuredtool dataclass code to tool" documentation = "https://python.langchain.com/docs/modules/tools/custom_tools/#structuredtool-dataclass" + name = "PythonCodeStructuredTool" icon = "🐍" field_order = ["name", "description", "tool_code", "return_direct", "tool_function", "tool_class"] diff --git a/src/backend/base/langflow/components/tools/PythonREPLTool.py b/src/backend/base/langflow/components/tools/PythonREPLTool.py index 914b6b965a0e..070630a75883 100644 --- a/src/backend/base/langflow/components/tools/PythonREPLTool.py +++ b/src/backend/base/langflow/components/tools/PythonREPLTool.py @@ -9,6 +9,7 @@ class PythonREPLToolComponent(CustomComponent): display_name = "Python REPL Tool" description = "A tool for running Python code in a REPL environment." + name = "PythonREPLTool" def build_config(self): return { diff --git a/src/backend/base/langflow/components/tools/RetrieverTool.py b/src/backend/base/langflow/components/tools/RetrieverTool.py index 28829321e0c2..6a87bcbf983c 100644 --- a/src/backend/base/langflow/components/tools/RetrieverTool.py +++ b/src/backend/base/langflow/components/tools/RetrieverTool.py @@ -7,6 +7,7 @@ class RetrieverToolComponent(CustomComponent): display_name = "RetrieverTool" description = "Tool for interacting with retriever" + name = "RetrieverTool" def build_config(self): return { diff --git a/src/backend/base/langflow/components/tools/SearchAPITool.py b/src/backend/base/langflow/components/tools/SearchAPITool.py index e0658c8c8d54..3c8058ee9e7e 100644 --- a/src/backend/base/langflow/components/tools/SearchAPITool.py +++ b/src/backend/base/langflow/components/tools/SearchAPITool.py @@ -8,6 +8,7 @@ class SearchApiToolComponent(CustomComponent): display_name: str = "SearchApi Tool" description: str = "Real-time search engine results API." + name = "SearchAPITool" documentation: str = "https://www.searchapi.io/docs/google" field_config = { "engine": { diff --git a/src/backend/base/langflow/components/tools/SearchApi.py b/src/backend/base/langflow/components/tools/SearchApi.py index 5dfd5525019f..2b6f54de7a2b 100644 --- a/src/backend/base/langflow/components/tools/SearchApi.py +++ b/src/backend/base/langflow/components/tools/SearchApi.py @@ -10,6 +10,8 @@ class SearchApi(CustomComponent): display_name: str = "SearchApi" description: str = "Real-time search engine results API." + name = "SearchApi" + output_types: list[str] = ["Document"] documentation: str = "https://www.searchapi.io/docs/google" field_config = { diff --git a/src/backend/base/langflow/components/vectorstores/AstraDB.py b/src/backend/base/langflow/components/vectorstores/AstraDB.py index d29dbd2358fc..6ed4ec7ab96b 100644 --- a/src/backend/base/langflow/components/vectorstores/AstraDB.py +++ b/src/backend/base/langflow/components/vectorstores/AstraDB.py @@ -21,6 +21,7 @@ class AstraVectorStoreComponent(LCVectorStoreComponent): display_name: str = "Astra DB" description: str = "Implementation of Vector Store using Astra DB with search capabilities" documentation: str = "https://python.langchain.com/docs/integrations/vectorstores/astradb" + name = "AstraDB" icon: str = "AstraDB" _cached_vectorstore: VectorStore | None = None diff --git a/src/backend/base/langflow/components/vectorstores/Cassandra.py b/src/backend/base/langflow/components/vectorstores/Cassandra.py index 9442822f96cc..746783af97d2 100644 --- a/src/backend/base/langflow/components/vectorstores/Cassandra.py +++ b/src/backend/base/langflow/components/vectorstores/Cassandra.py @@ -22,6 +22,7 @@ class CassandraVectorStoreComponent(LCVectorStoreComponent): display_name = "Cassandra" description = "Cassandra Vector Store with search capabilities" documentation = "https://python.langchain.com/docs/modules/data_connection/vectorstores/integrations/cassandra" + name = "Cassandra" icon = "Cassandra" _cached_vectorstore: Cassandra | None = None diff --git a/src/backend/base/langflow/components/vectorstores/Chroma.py b/src/backend/base/langflow/components/vectorstores/Chroma.py index ae2964ea6eb8..aa666f429ff8 100644 --- a/src/backend/base/langflow/components/vectorstores/Chroma.py +++ b/src/backend/base/langflow/components/vectorstores/Chroma.py @@ -22,6 +22,7 @@ class ChromaVectorStoreComponent(LCVectorStoreComponent): display_name: str = "Chroma DB" description: str = "Chroma Vector Store with search capabilities" documentation = "https://python.langchain.com/docs/integrations/vectorstores/chroma" + name = "Chroma" icon = "Chroma" inputs = [ diff --git a/src/backend/base/langflow/components/vectorstores/Couchbase.py b/src/backend/base/langflow/components/vectorstores/Couchbase.py index a25fa0479c1a..8adf642c4dd1 100644 --- a/src/backend/base/langflow/components/vectorstores/Couchbase.py +++ b/src/backend/base/langflow/components/vectorstores/Couchbase.py @@ -13,6 +13,7 @@ class CouchbaseVectorStoreComponent(LCVectorStoreComponent): display_name = "Couchbase" description = "Couchbase Vector Store with search capabilities" documentation = "https://python.langchain.com/v0.1/docs/integrations/document_loaders/couchbase/" + name = "Couchbase" icon = "Couchbase" inputs = [ diff --git a/src/backend/base/langflow/components/vectorstores/FAISS.py b/src/backend/base/langflow/components/vectorstores/FAISS.py index 24b6e6a7665f..68aa148d0fad 100644 --- a/src/backend/base/langflow/components/vectorstores/FAISS.py +++ b/src/backend/base/langflow/components/vectorstores/FAISS.py @@ -17,6 +17,7 @@ class FaissVectorStoreComponent(LCVectorStoreComponent): display_name: str = "FAISS" description: str = "FAISS Vector Store with search capabilities" documentation = "https://python.langchain.com/docs/modules/data_connection/vectorstores/integrations/faiss" + name = "FAISS" icon = "FAISS" inputs = [ diff --git a/src/backend/base/langflow/components/vectorstores/MongoDBAtlasVector.py b/src/backend/base/langflow/components/vectorstores/MongoDBAtlasVector.py index 4833a4feef57..c3bb0666fc86 100644 --- a/src/backend/base/langflow/components/vectorstores/MongoDBAtlasVector.py +++ b/src/backend/base/langflow/components/vectorstores/MongoDBAtlasVector.py @@ -12,6 +12,7 @@ class MongoVectorStoreComponent(LCVectorStoreComponent): display_name = "MongoDB Atlas" description = "MongoDB Atlas Vector Store with search capabilities" documentation = "https://python.langchain.com/docs/modules/data_connection/vectorstores/integrations/mongodb_atlas" + name = "MongoDBAtlasVector" icon = "MongoDB" inputs = [ diff --git a/src/backend/base/langflow/components/vectorstores/Pinecone.py b/src/backend/base/langflow/components/vectorstores/Pinecone.py index bf5d0d546f6f..e09711d0878a 100644 --- a/src/backend/base/langflow/components/vectorstores/Pinecone.py +++ b/src/backend/base/langflow/components/vectorstores/Pinecone.py @@ -20,6 +20,7 @@ class PineconeVectorStoreComponent(LCVectorStoreComponent): display_name = "Pinecone" description = "Pinecone Vector Store with search capabilities" documentation = "https://python.langchain.com/v0.2/docs/integrations/vectorstores/pinecone/" + name = "Pinecone" icon = "Pinecone" inputs = [ diff --git a/src/backend/base/langflow/components/vectorstores/Qdrant.py b/src/backend/base/langflow/components/vectorstores/Qdrant.py index 15282c0331c0..bf106cd51664 100644 --- a/src/backend/base/langflow/components/vectorstores/Qdrant.py +++ b/src/backend/base/langflow/components/vectorstores/Qdrant.py @@ -21,6 +21,7 @@ class QdrantVectorStoreComponent(LCVectorStoreComponent): display_name = "Qdrant" description = "Qdrant Vector Store with search capabilities" documentation = "https://python.langchain.com/docs/modules/data_connection/vectorstores/integrations/qdrant" + name = "Qdrant" icon = "Qdrant" inputs = [ diff --git a/src/backend/base/langflow/components/vectorstores/Redis.py b/src/backend/base/langflow/components/vectorstores/Redis.py index 9ce42b412559..43c50de2b359 100644 --- a/src/backend/base/langflow/components/vectorstores/Redis.py +++ b/src/backend/base/langflow/components/vectorstores/Redis.py @@ -17,6 +17,7 @@ class RedisVectorStoreComponent(LCVectorStoreComponent): display_name: str = "Redis" description: str = "Implementation of Vector Store using Redis" documentation = "https://python.langchain.com/docs/integrations/vectorstores/redis" + name = "Redis" inputs = [ SecretStrInput(name="redis_server_url", display_name="Redis Server Connection String", required=True), diff --git a/src/backend/base/langflow/components/vectorstores/SupabaseVectorStore.py b/src/backend/base/langflow/components/vectorstores/SupabaseVectorStore.py index 4c9d89669a37..d4c210f599f1 100644 --- a/src/backend/base/langflow/components/vectorstores/SupabaseVectorStore.py +++ b/src/backend/base/langflow/components/vectorstores/SupabaseVectorStore.py @@ -13,6 +13,7 @@ class SupabaseVectorStoreComponent(LCVectorStoreComponent): display_name = "Supabase" description = "Supabase Vector Store with search capabilities" documentation = "https://python.langchain.com/v0.2/docs/integrations/vectorstores/supabase/" + name = "SupabaseVectorStore" icon = "Supabase" inputs = [ diff --git a/src/backend/base/langflow/components/vectorstores/Upstash.py b/src/backend/base/langflow/components/vectorstores/Upstash.py index 951bea0206be..bc39bde834d3 100644 --- a/src/backend/base/langflow/components/vectorstores/Upstash.py +++ b/src/backend/base/langflow/components/vectorstores/Upstash.py @@ -12,6 +12,7 @@ class UpstashVectorStoreComponent(LCVectorStoreComponent): display_name = "Upstash" description = "Upstash Vector Store with search capabilities" documentation = "https://python.langchain.com/v0.2/docs/integrations/vectorstores/upstash/" + name = "Upstash" icon = "Upstash" inputs = [ diff --git a/src/backend/base/langflow/components/vectorstores/Vectara.py b/src/backend/base/langflow/components/vectorstores/Vectara.py index 4945eb902f7e..3513ccd98dff 100644 --- a/src/backend/base/langflow/components/vectorstores/Vectara.py +++ b/src/backend/base/langflow/components/vectorstores/Vectara.py @@ -20,6 +20,7 @@ class VectaraVectorStoreComponent(LCVectorStoreComponent): display_name: str = "Vectara" description: str = "Vectara Vector Store with search capabilities" documentation = "https://python.langchain.com/docs/modules/data_connection/vectorstores/integrations/vectara" + name = "Vectara" icon = "Vectara" inputs = [ diff --git a/src/backend/base/langflow/components/vectorstores/Weaviate.py b/src/backend/base/langflow/components/vectorstores/Weaviate.py index 2292af672f18..6a2e69fe95fd 100644 --- a/src/backend/base/langflow/components/vectorstores/Weaviate.py +++ b/src/backend/base/langflow/components/vectorstores/Weaviate.py @@ -13,6 +13,7 @@ class WeaviateVectorStoreComponent(LCVectorStoreComponent): display_name = "Weaviate" description = "Weaviate Vector Store with search capabilities" documentation = "https://python.langchain.com/docs/modules/data_connection/vectorstores/integrations/weaviate" + name = "Weaviate" icon = "Weaviate" inputs = [ diff --git a/src/backend/base/langflow/components/vectorstores/pgvector.py b/src/backend/base/langflow/components/vectorstores/pgvector.py index e4f1211a5ee0..5b0825d82dae 100644 --- a/src/backend/base/langflow/components/vectorstores/pgvector.py +++ b/src/backend/base/langflow/components/vectorstores/pgvector.py @@ -12,6 +12,7 @@ class PGVectorStoreComponent(LCVectorStoreComponent): display_name = "PGVector" description = "PGVector Vector Store with search capabilities" documentation = "https://python.langchain.com/v0.2/docs/integrations/vectorstores/pgvector/" + name = "pgvector" icon = "PGVector" inputs = [ diff --git a/src/backend/base/langflow/custom/custom_component/custom_component.py b/src/backend/base/langflow/custom/custom_component/custom_component.py index 51cbb0b5615c..eca85c1c81b2 100644 --- a/src/backend/base/langflow/custom/custom_component/custom_component.py +++ b/src/backend/base/langflow/custom/custom_component/custom_component.py @@ -36,6 +36,7 @@ class CustomComponent(BaseComponent): Represents a custom component in Langflow. Attributes: + name (Optional[str]): This attribute helps the frontend apply styles to known components. display_name (Optional[str]): The display name of the custom component. description (Optional[str]): The description of the custom component. code (Optional[str]): The code of the custom component. @@ -49,6 +50,8 @@ class CustomComponent(BaseComponent): _tree (Optional[dict]): The code tree of the custom component. """ + name: Optional[str] = None + """The name of the component used to styles. Defaults to None.""" display_name: Optional[str] = None """The display name of the component. Defaults to None.""" description: Optional[str] = None diff --git a/src/backend/base/langflow/custom/utils.py b/src/backend/base/langflow/custom/utils.py index 0b2da65f849a..c5f2d9f3cc74 100644 --- a/src/backend/base/langflow/custom/utils.py +++ b/src/backend/base/langflow/custom/utils.py @@ -15,7 +15,6 @@ from langflow.custom.directory_reader.utils import ( abuild_custom_component_list_from_path, build_custom_component_list_from_path, - determine_component_name, merge_nested_dicts_with_renaming, ) from langflow.custom.eval import eval_custom_component_code @@ -439,11 +438,11 @@ def create_component_template(component): component_extractor = Component(code=component_code) - component_template, _ = build_custom_component_template(component_extractor) + component_template, component_instance = build_custom_component_template(component_extractor) if not component_template["output_types"] and component_output_types: component_template["output_types"] = component_output_types - return component_template + return component_template, component_instance def build_custom_components(components_paths: List[str]): @@ -554,9 +553,8 @@ def sanitize_field_config(field_config: Union[Dict, Input]): def build_component(component): """Build a single component.""" - component_name = determine_component_name(component) - component_template = create_component_template(component) - + component_template, component_instance = create_component_template(component) + component_name = get_instance_name(component_instance) return component_name, component_template @@ -565,3 +563,10 @@ def get_function(code): function_name = validate.extract_function_name(code) return validate.create_function(code, function_name) + + +def get_instance_name(instance): + name = instance.__class__.__name__ + if hasattr(instance, "name") and instance.name: + name = instance.name + return name diff --git a/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx b/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx index 10e5aa3e4a8f..a2233070edc2 100644 --- a/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx +++ b/src/frontend/src/CustomNodes/GenericNode/components/parameterComponent/index.tsx @@ -180,8 +180,12 @@ export default function ParameterComponent({ handleOnNewValueHook(newValue, dbValue, skipSnapshot); }; - const handleNodeClass = (newNodeClass: APIClassType, code?: string): void => { - handleNodeClassHook(newNodeClass, code); + const handleNodeClass = ( + newNodeClass: APIClassType, + code?: string, + type?: string, + ): void => { + handleNodeClassHook(newNodeClass, code, type); }; useEffect(() => { diff --git a/src/frontend/src/CustomNodes/hooks/use-check-code-validity.tsx b/src/frontend/src/CustomNodes/hooks/use-check-code-validity.tsx index bcad57ecae5a..49f6de757e2e 100644 --- a/src/frontend/src/CustomNodes/hooks/use-check-code-validity.tsx +++ b/src/frontend/src/CustomNodes/hooks/use-check-code-validity.tsx @@ -1,6 +1,6 @@ import { useEffect } from "react"; -import { NATIVE_CATEGORIES } from "../../constants/constants"; import { NodeDataType } from "../../types/flow"; +import { nodeNames } from "../../utils/styleUtils"; const useCheckCodeValidity = ( data: NodeDataType, @@ -14,7 +14,7 @@ const useCheckCodeValidity = ( // first check if data.type in NATIVE_CATEGORIES // if not return if ( - !NATIVE_CATEGORIES.includes(types[data.type]) || + !Object.keys(nodeNames).includes(types[data.type]) || !data.node?.template?.code?.value ) return; diff --git a/src/frontend/src/CustomNodes/hooks/use-handle-node-class.tsx b/src/frontend/src/CustomNodes/hooks/use-handle-node-class.tsx index e82c06e72a99..0827c0b4ebb2 100644 --- a/src/frontend/src/CustomNodes/hooks/use-handle-node-class.tsx +++ b/src/frontend/src/CustomNodes/hooks/use-handle-node-class.tsx @@ -24,7 +24,7 @@ const useHandleNodeClass = ( display_name: newNodeClass.display_name ?? data.node!.display_name, }; if (type) { - newNode.data.node.template[name].type = type; + newNode.data.type = type; } newNode.data.node.template[name].value = code; diff --git a/src/frontend/src/CustomNodes/hooks/use-update-node-code.tsx b/src/frontend/src/CustomNodes/hooks/use-update-node-code.tsx index 1e8e79a1f200..beb0430c89ca 100644 --- a/src/frontend/src/CustomNodes/hooks/use-update-node-code.tsx +++ b/src/frontend/src/CustomNodes/hooks/use-update-node-code.tsx @@ -17,10 +17,9 @@ const useUpdateNodeCode = ( newNode.data = { ...newNode.data, - node: newNodeClass, + node: { ...newNodeClass, edited: false }, description: newNodeClass.description ?? dataNode.description, display_name: newNodeClass.display_name ?? dataNode.display_name, - edited: false, }; if (type) { newNode.data.type = type; diff --git a/src/frontend/src/constants/constants.ts b/src/frontend/src/constants/constants.ts index e74bdd4da90f..1de79a73706b 100644 --- a/src/frontend/src/constants/constants.ts +++ b/src/frontend/src/constants/constants.ts @@ -1,6 +1,7 @@ // src/constants/constants.ts import { languageMap } from "../types/components"; +import { nodeNames } from "../utils/styleUtils"; /** * invalid characters for flow name @@ -723,27 +724,6 @@ export const PRIORITY_SIDEBAR_ORDER = [ "vectorstores", "embeddings", ]; -export const NATIVE_CATEGORIES = [ - "inputs", - "outputs", - "prompts", - "data", - "prompt", - "models", - "helpers", - "experimental", - "agents", - "vectorstores", - "retrievers", - "embeddings", - "chains", - "tools", - "memories", - "textsplitters", - "toolkits", - "prototypes", - "langchain_utilities", -]; export const AUTHORIZED_DUPLICATE_REQUESTS = [ "/health", diff --git a/src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/index.tsx b/src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/index.tsx index 3f1a1baa54a4..ceb79f5a0e0f 100644 --- a/src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/index.tsx +++ b/src/frontend/src/pages/FlowPage/components/nodeToolbarComponent/index.tsx @@ -390,7 +390,11 @@ export default function NodeToolbarComponent({ }); }; - const handleNodeClass = (newNodeClass: APIClassType, code?: string): void => { + const handleNodeClass = ( + newNodeClass: APIClassType, + code?: string, + type?: string, + ): void => { if (!data.node) return; if (data.node!.template[name].value !== code) { takeSnapshot(); @@ -406,6 +410,10 @@ export default function NodeToolbarComponent({ display_name: newNodeClass.display_name ?? data.node!.display_name, }; + if (type) { + newNode.data.type = type; + } + newNode.data.node.template[name].value = code; return newNode;