diff --git a/365085a8-a90a-43f9-a779-f8769ec7eca1.html b/365085a8-a90a-43f9-a779-f8769ec7eca1.html index 8217f3a84c..966ea6b66b 100644 --- a/365085a8-a90a-43f9-a779-f8769ec7eca1.html +++ b/365085a8-a90a-43f9-a779-f8769ec7eca1.html @@ -10,7 +10,7 @@ - + diff --git a/404.html b/404.html index 22b9b11b66..4b1279ab08 100644 --- a/404.html +++ b/404.html @@ -10,7 +10,7 @@ - + diff --git a/Starter-Projects/starter-projects-complex-agent.html b/Starter-Projects/starter-projects-complex-agent.html index ea87bbd77b..16d8c5c20d 100644 --- a/Starter-Projects/starter-projects-complex-agent.html +++ b/Starter-Projects/starter-projects-complex-agent.html @@ -10,7 +10,7 @@ - + diff --git a/Starter-Projects/starter-projects-hierarchical-crew.html b/Starter-Projects/starter-projects-hierarchical-crew.html index bfd0915435..88f9ae491c 100644 --- a/Starter-Projects/starter-projects-hierarchical-crew.html +++ b/Starter-Projects/starter-projects-hierarchical-crew.html @@ -10,7 +10,7 @@ - + diff --git a/Starter-Projects/starter-projects-sequential-crew.html b/Starter-Projects/starter-projects-sequential-crew.html index a0e4a23587..09e76d4de1 100644 --- a/Starter-Projects/starter-projects-sequential-crew.html +++ b/Starter-Projects/starter-projects-sequential-crew.html @@ -10,7 +10,7 @@ - + diff --git a/assets/images/1028644105-85667a76353aa8f1527cdfc0f05b85be.png b/assets/images/1028644105-85667a76353aa8f1527cdfc0f05b85be.png deleted file mode 100644 index 8ae6499639..0000000000 Binary files a/assets/images/1028644105-85667a76353aa8f1527cdfc0f05b85be.png and /dev/null differ diff --git a/assets/images/241280398-3d8a5879a54500d5767f7baa3b146760.png b/assets/images/241280398-3d8a5879a54500d5767f7baa3b146760.png deleted file mode 100644 index 27e83c9698..0000000000 Binary files a/assets/images/241280398-3d8a5879a54500d5767f7baa3b146760.png and /dev/null differ diff --git a/assets/images/custom-component-chat-d0dfdbf518bf952bea86568d55cda744.png b/assets/images/custom-component-chat-d0dfdbf518bf952bea86568d55cda744.png new file mode 100644 index 0000000000..aaf70c2e39 Binary files /dev/null and b/assets/images/custom-component-chat-d0dfdbf518bf952bea86568d55cda744.png differ diff --git a/assets/images/custom-component-inputs-chat-f737c3b81c6cc0bbccd9ff8f108322a2.png b/assets/images/custom-component-inputs-chat-f737c3b81c6cc0bbccd9ff8f108322a2.png new file mode 100644 index 0000000000..9179753043 Binary files /dev/null and b/assets/images/custom-component-inputs-chat-f737c3b81c6cc0bbccd9ff8f108322a2.png differ diff --git a/assets/js/22dd74f7.6bb59f33.js b/assets/js/22dd74f7.6bb59f33.js new file mode 100644 index 0000000000..c11f0e4ffd --- /dev/null +++ b/assets/js/22dd74f7.6bb59f33.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[1567],{5226:e=>{e.exports=JSON.parse('{"version":{"pluginId":"default","version":"current","label":"Next","banner":null,"badge":false,"noIndex":false,"className":"docs-version-current","isLast":true,"docsSidebars":{"defaultSidebar":[{"type":"category","label":"What\u2019s New?","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"1.0 - A new chapter for Langflow","href":"/whats-new-a-new-chapter-langflow","docId":"What\u2019s-New/whats-new-a-new-chapter-langflow","unlisted":false}]},{"type":"category","label":"Getting Started","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"\ud83d\udc4b\xa0Welcome to Langflow","href":"/","docId":"Getting-Started/\ud83d\udc4b\xa0Welcome-to-Langflow","unlisted":false},{"type":"link","label":"\ud83d\udce6\xa0Installation","href":"/getting-started-installation","docId":"Getting-Started/getting-started-installation","unlisted":false},{"type":"link","label":"\u26a1\ufe0f Quickstart","href":"/getting-started-quickstart","docId":"Getting-Started/getting-started-quickstart","unlisted":false},{"type":"link","label":"\u2757\ufe0f Common Installation Issues","href":"/getting-started-common-installation-issues","docId":"Getting-Started/getting-started-common-installation-issues","unlisted":false}]},{"type":"category","label":"Starter Projects","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Basic Prompting","href":"/starter-projects-basic-prompting","docId":"Starter-Projects/starter-projects-basic-prompting","unlisted":false},{"type":"link","label":"Blog Writer","href":"/starter-projects-blog-writer","docId":"Starter-Projects/starter-projects-blog-writer","unlisted":false},{"type":"link","label":"Document QA","href":"/starter-projects-document-qa","docId":"Starter-Projects/starter-projects-document-qa","unlisted":false},{"type":"link","label":"Memory Chatbot","href":"/starter-projects-memory-chatbot","docId":"Starter-Projects/starter-projects-memory-chatbot","unlisted":false},{"type":"link","label":"Vector Store RAG","href":"/starter-projects-vector-store-rag","docId":"Starter-Projects/starter-projects-vector-store-rag","unlisted":false},{"type":"link","label":"Complex Agent","href":"/Starter-Projects/starter-projects-complex-agent","docId":"Starter-Projects/starter-projects-complex-agent","unlisted":false},{"type":"link","label":"Hierarchical Tasks Agent","href":"/Starter-Projects/starter-projects-hierarchical-crew","docId":"Starter-Projects/starter-projects-hierarchical-crew","unlisted":false},{"type":"link","label":"Sequential Tasks Agent","href":"/Starter-Projects/starter-projects-sequential-crew","docId":"Starter-Projects/starter-projects-sequential-crew","unlisted":false}]},{"type":"category","label":"Guides","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"\ud83d\udcda New to LLMs?","href":"/guides-new-to-llms","docId":"Guides/guides-new-to-llms","unlisted":false},{"type":"link","label":"Chat Memory","href":"/guides-chat-memory","docId":"Guides/guides-chat-memory","unlisted":false},{"type":"link","label":"Data & Message","href":"/guides-data-message","docId":"Guides/guides-data-message","unlisted":false}]},{"type":"category","label":"Workspace","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Playground","href":"/workspace-playground","docId":"Workspace/workspace-playground","unlisted":false},{"type":"link","label":"API","href":"/workspace-api","docId":"Workspace/workspace-api","unlisted":false},{"type":"link","label":"Logs","href":"/workspace-logs","docId":"Workspace/workspace-logs","unlisted":false}],"href":"/workspace"},{"type":"category","label":"Components","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Inputs & Outputs","href":"/components-io","docId":"Components/components-io","unlisted":false},{"type":"link","label":"Prompts","href":"/components-prompts","docId":"Components/components-prompts","unlisted":false},{"type":"link","label":"Data","href":"/components-data","docId":"Components/components-data","unlisted":false},{"type":"link","label":"Helpers","href":"/components-helpers","docId":"Components/components-helpers","unlisted":false},{"type":"link","label":"Models","href":"/components-models","docId":"Components/components-models","unlisted":false},{"type":"link","label":"Embedding Models","href":"/components-embedding-models","docId":"Components/components-embedding-models","unlisted":false},{"type":"link","label":"Vector Stores","href":"/components-vector-stores","docId":"Components/components-vector-stores","unlisted":false},{"type":"link","label":"Custom Components","href":"/components-custom-components","docId":"Components/components-custom-components","unlisted":false},{"type":"link","label":"RAG","href":"/components-rag","docId":"Components/components-rag","unlisted":false},{"type":"link","label":"Loaders","href":"/components-loaders","docId":"Components/components-loaders","unlisted":false}],"href":"/components"},{"type":"category","label":"Deployment","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"\ud83e\udd17\xa0Spaces","href":"/deployment-hugging-face-spaces","docId":"Deployment/deployment-hugging-face-spaces","unlisted":false},{"type":"link","label":"Kubernetes","href":"/deployment-kubernetes","docId":"Deployment/deployment-kubernetes","unlisted":false},{"type":"link","label":"Docker","href":"/deployment-docker","docId":"Deployment/deployment-docker","unlisted":false},{"type":"link","label":"GCP","href":"/deployment-gcp","docId":"Deployment/deployment-gcp","unlisted":false},{"type":"link","label":"Render","href":"/deployment-render","docId":"Deployment/deployment-render","unlisted":false},{"type":"link","label":"Railway","href":"/deployment-railway","docId":"Deployment/deployment-railway","unlisted":false}]},{"type":"category","label":"Settings","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Global Variables","href":"/settings-global-variables","docId":"Settings/settings-global-variables","unlisted":false},{"type":"link","label":"Project & General Settings","href":"/settings-project-general-settings","docId":"Settings/settings-project-general-settings","unlisted":false}]},{"type":"category","label":"Configuration","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Authentication","href":"/configuration-authentication","docId":"Configuration/configuration-authentication","unlisted":false},{"type":"link","label":"API Keys","href":"/configuration-api-keys","docId":"Configuration/configuration-api-keys","unlisted":false},{"type":"link","label":"Command Line Interface (CLI)","href":"/configuration-cli","docId":"Configuration/configuration-cli","unlisted":false},{"type":"link","label":"My Collection","href":"/365085a8-a90a-43f9-a779-f8769ec7eca1","docId":"Configuration/My-Collection","unlisted":false},{"type":"link","label":"Backend-Only","href":"/configuration-backend-only","docId":"Configuration/configuration-backend-only","unlisted":false},{"type":"link","label":"Auto-saving","href":"/configuration-auto-save","docId":"Configuration/configuration-auto-saving","unlisted":false}]},{"type":"category","label":"Integrations","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"LangSmith","href":"/integrations-langsmith","docId":"Integrations/integrations-langsmith","unlisted":false},{"type":"link","label":"LangWatch","href":"/integrations-langwatch","docId":"Integrations/integrations-langwatch","unlisted":false}]},{"type":"category","label":"Contributing","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Telemetry","href":"/contributing-telemetry","docId":"Contributing/contributing-telemetry","unlisted":false},{"type":"link","label":"How to contribute?","href":"/contributing-how-to-contribute","docId":"Contributing/contributing-how-to-contribute","unlisted":false},{"type":"link","label":"GitHub Issues","href":"/contributing-github-issues","docId":"Contributing/contributing-github-issues","unlisted":false},{"type":"link","label":"Community","href":"/contributing-community","docId":"Contributing/contributing-community","unlisted":false}]}]},"docs":{"Components/components":{"id":"Components/components","title":"Intro to Components","description":"Component","sidebar":"defaultSidebar"},"Components/components-custom-components":{"id":"Components/components-custom-components","title":"Custom Components","description":"Custom components are created within Langflow and extend the platform\'s functionality with custom, resusable Python code.","sidebar":"defaultSidebar"},"Components/components-data":{"id":"Components/components-data","title":"Data","description":"This page may contain outdated information. It will be updated as soon as possible.","sidebar":"defaultSidebar"},"Components/components-embedding-models":{"id":"Components/components-embedding-models","title":"Embedding Models","description":"This page may contain outdated information. It will be updated as soon as possible.","sidebar":"defaultSidebar"},"Components/components-helpers":{"id":"Components/components-helpers","title":"Helpers","description":"This page may contain outdated information. It will be updated as soon as possible.","sidebar":"defaultSidebar"},"Components/components-io":{"id":"Components/components-io","title":"Inputs & Outputs","description":"Inputs and Outputs are a category of components that are used to define where data comes in and out of your flow. They also dynamically change the Playground and can be renamed to facilitate building and maintaining your flows.","sidebar":"defaultSidebar"},"Components/components-loaders":{"id":"Components/components-loaders","title":"Loaders","description":"Loaders are components used to load documents from various sources, such as databases, websites, and local files. They can be used to fetch data from external sources and convert it into a format that can be processed by other components.","sidebar":"defaultSidebar"},"Components/components-models":{"id":"Components/components-models","title":"Models","description":"This page may contain outdated information. It will be updated as soon as possible.","sidebar":"defaultSidebar"},"Components/components-prompts":{"id":"Components/components-prompts","title":"Prompts","description":"This page may contain outdated information. It will be updated as soon as possible.","sidebar":"defaultSidebar"},"Components/components-rag":{"id":"Components/components-rag","title":"RAG","description":"RAG (Retrieval-Augmented Generation) components process a user query by retrieving relevant documents and generating a concise summary that addresses the user\'s question.","sidebar":"defaultSidebar"},"Components/components-vector-stores":{"id":"Components/components-vector-stores","title":"Vector Stores","description":"This page may contain outdated information. It will be updated as soon as possible.","sidebar":"defaultSidebar"},"Configuration/configuration-api-keys":{"id":"Configuration/configuration-api-keys","title":"API Keys","description":"This page may contain outdated information. It will be updated as soon as possible.","sidebar":"defaultSidebar"},"Configuration/configuration-authentication":{"id":"Configuration/configuration-authentication","title":"Authentication","description":"This page may contain outdated information. It will be updated as soon as possible.","sidebar":"defaultSidebar"},"Configuration/configuration-auto-saving":{"id":"Configuration/configuration-auto-saving","title":"Auto-saving","description":"Langflow currently supports both manual and auto-saving functionality.","sidebar":"defaultSidebar"},"Configuration/configuration-backend-only":{"id":"Configuration/configuration-backend-only","title":"Backend-Only","description":"This page may contain outdated information. It will be updated as soon as possible.","sidebar":"defaultSidebar"},"Configuration/configuration-cli":{"id":"Configuration/configuration-cli","title":"Command Line Interface (CLI)","description":"This page may contain outdated information. It will be updated as soon as possible.","sidebar":"defaultSidebar"},"Configuration/My-Collection":{"id":"Configuration/My-Collection","title":"My Collection","description":"This page may contain outdated information. It will be updated as soon as possible.","sidebar":"defaultSidebar"},"Contributing/contributing-community":{"id":"Contributing/contributing-community","title":"Community","description":"\ud83e\udd16 Join\xa0Langflow\xa0Discord server","sidebar":"defaultSidebar"},"Contributing/contributing-github-issues":{"id":"Contributing/contributing-github-issues","title":"GitHub Issues","description":"Our\xa0issues\xa0page is kept up to date with bugs, improvements, and feature requests. There is a taxonomy of labels to help with sorting and discovery of issues of interest.","sidebar":"defaultSidebar"},"Contributing/contributing-how-to-contribute":{"id":"Contributing/contributing-how-to-contribute","title":"How to contribute?","description":"This page may contain outdated information. It will be updated as soon as possible.","sidebar":"defaultSidebar"},"Contributing/contributing-telemetry":{"id":"Contributing/contributing-telemetry","title":"Telemetry","description":"This page may contain outdated information. It will be updated as soon as possible.","sidebar":"defaultSidebar"},"Deployment/deployment-docker":{"id":"Deployment/deployment-docker","title":"Docker","description":"This guide will help you get LangFlow up and running using Docker and Docker Compose.","sidebar":"defaultSidebar"},"Deployment/deployment-gcp":{"id":"Deployment/deployment-gcp","title":"GCP","description":"This page may contain outdated information. It will be updated as soon as possible.","sidebar":"defaultSidebar"},"Deployment/deployment-hugging-face-spaces":{"id":"Deployment/deployment-hugging-face-spaces","title":"\ud83e\udd17\xa0Spaces","description":"HuggingFace Spaces","sidebar":"defaultSidebar"},"Deployment/deployment-kubernetes":{"id":"Deployment/deployment-kubernetes","title":"Kubernetes","description":"This guide will help you get LangFlow up and running in Kubernetes cluster, including the following steps:","sidebar":"defaultSidebar"},"Deployment/deployment-railway":{"id":"Deployment/deployment-railway","title":"Railway","description":"Deploy on Railway","sidebar":"defaultSidebar"},"Deployment/deployment-render":{"id":"Deployment/deployment-render","title":"Render","description":"Deploy on Render","sidebar":"defaultSidebar"},"Getting-Started/\ud83d\udc4b\xa0Welcome-to-Langflow":{"id":"Getting-Started/\ud83d\udc4b\xa0Welcome-to-Langflow","title":"\ud83d\udc4b\xa0Welcome to Langflow","description":"Introduction","sidebar":"defaultSidebar"},"Getting-Started/getting-started-common-installation-issues":{"id":"Getting-Started/getting-started-common-installation-issues","title":"\u2757\ufe0f Common Installation Issues","description":"This is a list of possible issues that you may encounter when installing Langflow and how to solve them.","sidebar":"defaultSidebar"},"Getting-Started/getting-started-installation":{"id":"Getting-Started/getting-started-installation","title":"\ud83d\udce6\xa0Installation","description":"DataStax Langflow","sidebar":"defaultSidebar"},"Getting-Started/getting-started-quickstart":{"id":"Getting-Started/getting-started-quickstart","title":"\u26a1\ufe0f Quickstart","description":"Prerequisites","sidebar":"defaultSidebar"},"Guides/guides-chat-memory":{"id":"Guides/guides-chat-memory","title":"Chat Memory","description":"Langflow allows every chat message to be stored, and a single flow can have multiple memory sessions. This enables you to create separate memories for agents to store and recall information as needed.","sidebar":"defaultSidebar"},"Guides/guides-data-message":{"id":"Guides/guides-data-message","title":"Data & Message","description":"In Langflow, the\xa0Data\xa0and\xa0Message\xa0objects serve as structured, functional representations of data that enhance the capabilities and reliability of the platform.","sidebar":"defaultSidebar"},"Guides/guides-new-to-llms":{"id":"Guides/guides-new-to-llms","title":"\ud83d\udcda New to LLMs?","description":"Large Language Models, or LLMs, are part of an exciting new world in computing.","sidebar":"defaultSidebar"},"Integrations/integrations-langsmith":{"id":"Integrations/integrations-langsmith","title":"LangSmith","description":"LangSmith is a full-lifecycle DevOps service from LangChain that provides monitoring and observability. To integrate with Langflow, just add your LangChain API key as a Langflow environment variable and you are good to go!","sidebar":"defaultSidebar"},"Integrations/integrations-langwatch":{"id":"Integrations/integrations-langwatch","title":"LangWatch","description":"938674091aac4d9d9aa4aa6eb5c215b4}","sidebar":"defaultSidebar"},"Settings/settings-global-variables":{"id":"Settings/settings-global-variables","title":"Global Variables","description":"This page may contain outdated information. It will be updated as soon as possible.","sidebar":"defaultSidebar"},"Settings/settings-project-general-settings":{"id":"Settings/settings-project-general-settings","title":"Project & General Settings","description":"This page may contain outdated information. It will be updated as soon as possible.","sidebar":"defaultSidebar"},"Starter-Projects/starter-projects-basic-prompting":{"id":"Starter-Projects/starter-projects-basic-prompting","title":"Basic Prompting","description":"Prompts serve as the inputs to a large language model (LLM), acting as the interface between human instructions and computational tasks.","sidebar":"defaultSidebar"},"Starter-Projects/starter-projects-blog-writer":{"id":"Starter-Projects/starter-projects-blog-writer","title":"Blog Writer","description":"Build a blog writer with OpenAI that uses URLs for reference content.","sidebar":"defaultSidebar"},"Starter-Projects/starter-projects-complex-agent":{"id":"Starter-Projects/starter-projects-complex-agent","title":"Complex Agent","description":"Build a Complex Agent flow for a chatbot application using CrewAI. This flow uses CrewAI to manage a Hierarchical Crew of Agents as they perform a sequence of Tasks.","sidebar":"defaultSidebar"},"Starter-Projects/starter-projects-document-qa":{"id":"Starter-Projects/starter-projects-document-qa","title":"Document QA","description":"Build a question-and-answer chatbot with a document loaded from local memory.","sidebar":"defaultSidebar"},"Starter-Projects/starter-projects-hierarchical-crew":{"id":"Starter-Projects/starter-projects-hierarchical-crew","title":"Hierarchical Tasks Agent","description":"Build a Hierarchical Tasks Agent flow for a multi-shot application using CrewAI. This flow uses CrewAI to manage a Hierarchical Crew of Agents as they perform disparate tasks under the control of a Manager Agent.","sidebar":"defaultSidebar"},"Starter-Projects/starter-projects-memory-chatbot":{"id":"Starter-Projects/starter-projects-memory-chatbot","title":"Memory Chatbot","description":"This flow extends the\xa0Basic Prompting\xa0flow to include a chat memory. This makes the AI remember previous user inputs.","sidebar":"defaultSidebar"},"Starter-Projects/starter-projects-sequential-crew":{"id":"Starter-Projects/starter-projects-sequential-crew","title":"Sequential Tasks Agent","description":"Build a Sequential Tasks Agent flow for a multi-shot application using CrewAI. This flow uses CrewAI to manage a Crew of Agents as they perform a sequence of Tasks.","sidebar":"defaultSidebar"},"Starter-Projects/starter-projects-vector-store-rag":{"id":"Starter-Projects/starter-projects-vector-store-rag","title":"Vector Store RAG","description":"Retrieval Augmented Generation, or RAG, is a pattern for training LLMs on your data and querying it.","sidebar":"defaultSidebar"},"What\u2019s-New/whats-new-a-new-chapter-langflow":{"id":"What\u2019s-New/whats-new-a-new-chapter-langflow","title":"1.0 - A new chapter for Langflow","description":"First things first","sidebar":"defaultSidebar"},"Workspace/workspace":{"id":"Workspace/workspace","title":"Workspace Overview","description":"The Langflow Workspace","sidebar":"defaultSidebar"},"Workspace/workspace-api":{"id":"Workspace/workspace-api","title":"API","description":"The\xa0API\xa0section presents code templates for integrating your flow into external applications.","sidebar":"defaultSidebar"},"Workspace/workspace-logs":{"id":"Workspace/workspace-logs","title":"Logs","description":"The\xa0Logs\xa0page provides a detailed record of all component executions within a workspace. It is designed to help you track actions, debug issues, and understand the flow of data through various components.","sidebar":"defaultSidebar"},"Workspace/workspace-playground":{"id":"Workspace/workspace-playground","title":"Playground","description":"The\xa0Playground\xa0is a dynamic interface designed for real-time interaction with AIs, allowing users to chat, access memories and monitor inputs and outputs. Here, users can directly prototype and their models, making adjustments and observing different outcomes.","sidebar":"defaultSidebar"}}}}')}}]); \ No newline at end of file diff --git a/assets/js/22dd74f7.9e01eda7.js b/assets/js/22dd74f7.9e01eda7.js deleted file mode 100644 index 85c73eec69..0000000000 --- a/assets/js/22dd74f7.9e01eda7.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[1567],{5226:e=>{e.exports=JSON.parse('{"version":{"pluginId":"default","version":"current","label":"Next","banner":null,"badge":false,"noIndex":false,"className":"docs-version-current","isLast":true,"docsSidebars":{"defaultSidebar":[{"type":"category","label":"What\u2019s New?","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"1.0 - A new chapter for Langflow","href":"/whats-new-a-new-chapter-langflow","docId":"What\u2019s-New/whats-new-a-new-chapter-langflow","unlisted":false}]},{"type":"category","label":"Getting Started","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"\ud83d\udc4b\xa0Welcome to Langflow","href":"/","docId":"Getting-Started/\ud83d\udc4b\xa0Welcome-to-Langflow","unlisted":false},{"type":"link","label":"\ud83d\udce6\xa0Installation","href":"/getting-started-installation","docId":"Getting-Started/getting-started-installation","unlisted":false},{"type":"link","label":"\u26a1\ufe0f Quickstart","href":"/getting-started-quickstart","docId":"Getting-Started/getting-started-quickstart","unlisted":false},{"type":"link","label":"\u2757\ufe0f Common Installation Issues","href":"/getting-started-common-installation-issues","docId":"Getting-Started/getting-started-common-installation-issues","unlisted":false}]},{"type":"category","label":"Starter Projects","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Basic Prompting","href":"/starter-projects-basic-prompting","docId":"Starter-Projects/starter-projects-basic-prompting","unlisted":false},{"type":"link","label":"Blog Writer","href":"/starter-projects-blog-writer","docId":"Starter-Projects/starter-projects-blog-writer","unlisted":false},{"type":"link","label":"Document QA","href":"/starter-projects-document-qa","docId":"Starter-Projects/starter-projects-document-qa","unlisted":false},{"type":"link","label":"Memory Chatbot","href":"/starter-projects-memory-chatbot","docId":"Starter-Projects/starter-projects-memory-chatbot","unlisted":false},{"type":"link","label":"Vector Store RAG","href":"/starter-projects-vector-store-rag","docId":"Starter-Projects/starter-projects-vector-store-rag","unlisted":false},{"type":"link","label":"Complex Agent","href":"/Starter-Projects/starter-projects-complex-agent","docId":"Starter-Projects/starter-projects-complex-agent","unlisted":false},{"type":"link","label":"Hierarchical Tasks Agent","href":"/Starter-Projects/starter-projects-hierarchical-crew","docId":"Starter-Projects/starter-projects-hierarchical-crew","unlisted":false},{"type":"link","label":"Sequential Tasks Agent","href":"/Starter-Projects/starter-projects-sequential-crew","docId":"Starter-Projects/starter-projects-sequential-crew","unlisted":false}]},{"type":"category","label":"Guides","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"\ud83d\udcda New to LLMs?","href":"/guides-new-to-llms","docId":"Guides/guides-new-to-llms","unlisted":false},{"type":"link","label":"Chat Memory","href":"/guides-chat-memory","docId":"Guides/guides-chat-memory","unlisted":false},{"type":"link","label":"Data & Message","href":"/guides-data-message","docId":"Guides/guides-data-message","unlisted":false}]},{"type":"category","label":"Workspace","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Playground","href":"/workspace-playground","docId":"Workspace/workspace-playground","unlisted":false},{"type":"link","label":"API","href":"/workspace-api","docId":"Workspace/workspace-api","unlisted":false},{"type":"link","label":"Logs","href":"/workspace-logs","docId":"Workspace/workspace-logs","unlisted":false}],"href":"/workspace"},{"type":"category","label":"Components","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Inputs & Outputs","href":"/components-io","docId":"Components/components-io","unlisted":false},{"type":"link","label":"Prompts","href":"/components-prompts","docId":"Components/components-prompts","unlisted":false},{"type":"link","label":"Data","href":"/components-data","docId":"Components/components-data","unlisted":false},{"type":"link","label":"Helpers","href":"/components-helpers","docId":"Components/components-helpers","unlisted":false},{"type":"link","label":"Models","href":"/components-models","docId":"Components/components-models","unlisted":false},{"type":"link","label":"Embedding Models","href":"/components-embedding-models","docId":"Components/components-embedding-models","unlisted":false},{"type":"link","label":"Vector Stores","href":"/components-vector-stores","docId":"Components/components-vector-stores","unlisted":false},{"type":"link","label":"Custom Components","href":"/components-custom-components","docId":"Components/components-custom-components","unlisted":false},{"type":"link","label":"RAG","href":"/components-rag","docId":"Components/components-rag","unlisted":false},{"type":"link","label":"Loaders","href":"/components-loaders","docId":"Components/components-loaders","unlisted":false}],"href":"/components"},{"type":"category","label":"Deployment","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"\ud83e\udd17\xa0Spaces","href":"/deployment-hugging-face-spaces","docId":"Deployment/deployment-hugging-face-spaces","unlisted":false},{"type":"link","label":"Kubernetes","href":"/deployment-kubernetes","docId":"Deployment/deployment-kubernetes","unlisted":false},{"type":"link","label":"Docker","href":"/deployment-docker","docId":"Deployment/deployment-docker","unlisted":false},{"type":"link","label":"GCP","href":"/deployment-gcp","docId":"Deployment/deployment-gcp","unlisted":false},{"type":"link","label":"Render","href":"/deployment-render","docId":"Deployment/deployment-render","unlisted":false},{"type":"link","label":"Railway","href":"/deployment-railway","docId":"Deployment/deployment-railway","unlisted":false}]},{"type":"category","label":"Settings","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Global Variables","href":"/settings-global-variables","docId":"Settings/settings-global-variables","unlisted":false},{"type":"link","label":"Project & General Settings","href":"/settings-project-general-settings","docId":"Settings/settings-project-general-settings","unlisted":false}]},{"type":"category","label":"Configuration","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Authentication","href":"/configuration-authentication","docId":"Configuration/configuration-authentication","unlisted":false},{"type":"link","label":"API Keys","href":"/configuration-api-keys","docId":"Configuration/configuration-api-keys","unlisted":false},{"type":"link","label":"Command Line Interface (CLI)","href":"/configuration-cli","docId":"Configuration/configuration-cli","unlisted":false},{"type":"link","label":"My Collection","href":"/365085a8-a90a-43f9-a779-f8769ec7eca1","docId":"Configuration/My-Collection","unlisted":false},{"type":"link","label":"Backend-Only","href":"/configuration-backend-only","docId":"Configuration/configuration-backend-only","unlisted":false},{"type":"link","label":"Auto-saving","href":"/configuration-auto-save","docId":"Configuration/configuration-auto-saving","unlisted":false}]},{"type":"category","label":"Integrations","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"LangSmith","href":"/integrations-langsmith","docId":"Integrations/integrations-langsmith","unlisted":false},{"type":"link","label":"LangWatch","href":"/integrations-langwatch","docId":"Integrations/integrations-langwatch","unlisted":false}]},{"type":"category","label":"Contributing","collapsible":true,"collapsed":false,"items":[{"type":"link","label":"Telemetry","href":"/contributing-telemetry","docId":"Contributing/contributing-telemetry","unlisted":false},{"type":"link","label":"How to contribute?","href":"/contributing-how-to-contribute","docId":"Contributing/contributing-how-to-contribute","unlisted":false},{"type":"link","label":"GitHub Issues","href":"/contributing-github-issues","docId":"Contributing/contributing-github-issues","unlisted":false},{"type":"link","label":"Community","href":"/contributing-community","docId":"Contributing/contributing-community","unlisted":false}]}]},"docs":{"Components/components":{"id":"Components/components","title":"Intro to Components","description":"Component","sidebar":"defaultSidebar"},"Components/components-custom-components":{"id":"Components/components-custom-components","title":"Custom Components","description":"Langflow components can be created from within the platform, allowing users to extend the platform\'s functionality using Python code. They encapsulate are designed to be independent units, reusable across different workflows.","sidebar":"defaultSidebar"},"Components/components-data":{"id":"Components/components-data","title":"Data","description":"This page may contain outdated information. It will be updated as soon as possible.","sidebar":"defaultSidebar"},"Components/components-embedding-models":{"id":"Components/components-embedding-models","title":"Embedding Models","description":"This page may contain outdated information. It will be updated as soon as possible.","sidebar":"defaultSidebar"},"Components/components-helpers":{"id":"Components/components-helpers","title":"Helpers","description":"This page may contain outdated information. It will be updated as soon as possible.","sidebar":"defaultSidebar"},"Components/components-io":{"id":"Components/components-io","title":"Inputs & Outputs","description":"Inputs and Outputs are a category of components that are used to define where data comes in and out of your flow. They also dynamically change the Playground and can be renamed to facilitate building and maintaining your flows.","sidebar":"defaultSidebar"},"Components/components-loaders":{"id":"Components/components-loaders","title":"Loaders","description":"Loaders are components used to load documents from various sources, such as databases, websites, and local files. They can be used to fetch data from external sources and convert it into a format that can be processed by other components.","sidebar":"defaultSidebar"},"Components/components-models":{"id":"Components/components-models","title":"Models","description":"This page may contain outdated information. It will be updated as soon as possible.","sidebar":"defaultSidebar"},"Components/components-prompts":{"id":"Components/components-prompts","title":"Prompts","description":"This page may contain outdated information. It will be updated as soon as possible.","sidebar":"defaultSidebar"},"Components/components-rag":{"id":"Components/components-rag","title":"RAG","description":"RAG (Retrieval-Augmented Generation) components process a user query by retrieving relevant documents and generating a concise summary that addresses the user\'s question.","sidebar":"defaultSidebar"},"Components/components-vector-stores":{"id":"Components/components-vector-stores","title":"Vector Stores","description":"This page may contain outdated information. It will be updated as soon as possible.","sidebar":"defaultSidebar"},"Configuration/configuration-api-keys":{"id":"Configuration/configuration-api-keys","title":"API Keys","description":"This page may contain outdated information. It will be updated as soon as possible.","sidebar":"defaultSidebar"},"Configuration/configuration-authentication":{"id":"Configuration/configuration-authentication","title":"Authentication","description":"This page may contain outdated information. It will be updated as soon as possible.","sidebar":"defaultSidebar"},"Configuration/configuration-auto-saving":{"id":"Configuration/configuration-auto-saving","title":"Auto-saving","description":"Langflow currently supports both manual and auto-saving functionality.","sidebar":"defaultSidebar"},"Configuration/configuration-backend-only":{"id":"Configuration/configuration-backend-only","title":"Backend-Only","description":"This page may contain outdated information. It will be updated as soon as possible.","sidebar":"defaultSidebar"},"Configuration/configuration-cli":{"id":"Configuration/configuration-cli","title":"Command Line Interface (CLI)","description":"This page may contain outdated information. It will be updated as soon as possible.","sidebar":"defaultSidebar"},"Configuration/My-Collection":{"id":"Configuration/My-Collection","title":"My Collection","description":"This page may contain outdated information. It will be updated as soon as possible.","sidebar":"defaultSidebar"},"Contributing/contributing-community":{"id":"Contributing/contributing-community","title":"Community","description":"\ud83e\udd16 Join\xa0Langflow\xa0Discord server","sidebar":"defaultSidebar"},"Contributing/contributing-github-issues":{"id":"Contributing/contributing-github-issues","title":"GitHub Issues","description":"Our\xa0issues\xa0page is kept up to date with bugs, improvements, and feature requests. There is a taxonomy of labels to help with sorting and discovery of issues of interest.","sidebar":"defaultSidebar"},"Contributing/contributing-how-to-contribute":{"id":"Contributing/contributing-how-to-contribute","title":"How to contribute?","description":"This page may contain outdated information. It will be updated as soon as possible.","sidebar":"defaultSidebar"},"Contributing/contributing-telemetry":{"id":"Contributing/contributing-telemetry","title":"Telemetry","description":"This page may contain outdated information. It will be updated as soon as possible.","sidebar":"defaultSidebar"},"Deployment/deployment-docker":{"id":"Deployment/deployment-docker","title":"Docker","description":"This guide will help you get LangFlow up and running using Docker and Docker Compose.","sidebar":"defaultSidebar"},"Deployment/deployment-gcp":{"id":"Deployment/deployment-gcp","title":"GCP","description":"This page may contain outdated information. It will be updated as soon as possible.","sidebar":"defaultSidebar"},"Deployment/deployment-hugging-face-spaces":{"id":"Deployment/deployment-hugging-face-spaces","title":"\ud83e\udd17\xa0Spaces","description":"HuggingFace Spaces","sidebar":"defaultSidebar"},"Deployment/deployment-kubernetes":{"id":"Deployment/deployment-kubernetes","title":"Kubernetes","description":"This guide will help you get LangFlow up and running in Kubernetes cluster, including the following steps:","sidebar":"defaultSidebar"},"Deployment/deployment-railway":{"id":"Deployment/deployment-railway","title":"Railway","description":"Deploy on Railway","sidebar":"defaultSidebar"},"Deployment/deployment-render":{"id":"Deployment/deployment-render","title":"Render","description":"Deploy on Render","sidebar":"defaultSidebar"},"Getting-Started/\ud83d\udc4b\xa0Welcome-to-Langflow":{"id":"Getting-Started/\ud83d\udc4b\xa0Welcome-to-Langflow","title":"\ud83d\udc4b\xa0Welcome to Langflow","description":"Introduction","sidebar":"defaultSidebar"},"Getting-Started/getting-started-common-installation-issues":{"id":"Getting-Started/getting-started-common-installation-issues","title":"\u2757\ufe0f Common Installation Issues","description":"This is a list of possible issues that you may encounter when installing Langflow and how to solve them.","sidebar":"defaultSidebar"},"Getting-Started/getting-started-installation":{"id":"Getting-Started/getting-started-installation","title":"\ud83d\udce6\xa0Installation","description":"DataStax Langflow","sidebar":"defaultSidebar"},"Getting-Started/getting-started-quickstart":{"id":"Getting-Started/getting-started-quickstart","title":"\u26a1\ufe0f Quickstart","description":"Prerequisites","sidebar":"defaultSidebar"},"Guides/guides-chat-memory":{"id":"Guides/guides-chat-memory","title":"Chat Memory","description":"Langflow allows every chat message to be stored, and a single flow can have multiple memory sessions. This enables you to create separate memories for agents to store and recall information as needed.","sidebar":"defaultSidebar"},"Guides/guides-data-message":{"id":"Guides/guides-data-message","title":"Data & Message","description":"In Langflow, the\xa0Data\xa0and\xa0Message\xa0objects serve as structured, functional representations of data that enhance the capabilities and reliability of the platform.","sidebar":"defaultSidebar"},"Guides/guides-new-to-llms":{"id":"Guides/guides-new-to-llms","title":"\ud83d\udcda New to LLMs?","description":"Large Language Models, or LLMs, are part of an exciting new world in computing.","sidebar":"defaultSidebar"},"Integrations/integrations-langsmith":{"id":"Integrations/integrations-langsmith","title":"LangSmith","description":"LangSmith is a full-lifecycle DevOps service from LangChain that provides monitoring and observability. To integrate with Langflow, just add your LangChain API key as a Langflow environment variable and you are good to go!","sidebar":"defaultSidebar"},"Integrations/integrations-langwatch":{"id":"Integrations/integrations-langwatch","title":"LangWatch","description":"938674091aac4d9d9aa4aa6eb5c215b4}","sidebar":"defaultSidebar"},"Settings/settings-global-variables":{"id":"Settings/settings-global-variables","title":"Global Variables","description":"This page may contain outdated information. It will be updated as soon as possible.","sidebar":"defaultSidebar"},"Settings/settings-project-general-settings":{"id":"Settings/settings-project-general-settings","title":"Project & General Settings","description":"This page may contain outdated information. It will be updated as soon as possible.","sidebar":"defaultSidebar"},"Starter-Projects/starter-projects-basic-prompting":{"id":"Starter-Projects/starter-projects-basic-prompting","title":"Basic Prompting","description":"Prompts serve as the inputs to a large language model (LLM), acting as the interface between human instructions and computational tasks.","sidebar":"defaultSidebar"},"Starter-Projects/starter-projects-blog-writer":{"id":"Starter-Projects/starter-projects-blog-writer","title":"Blog Writer","description":"Build a blog writer with OpenAI that uses URLs for reference content.","sidebar":"defaultSidebar"},"Starter-Projects/starter-projects-complex-agent":{"id":"Starter-Projects/starter-projects-complex-agent","title":"Complex Agent","description":"Build a Complex Agent flow for a chatbot application using CrewAI. This flow uses CrewAI to manage a Hierarchical Crew of Agents as they perform a sequence of Tasks.","sidebar":"defaultSidebar"},"Starter-Projects/starter-projects-document-qa":{"id":"Starter-Projects/starter-projects-document-qa","title":"Document QA","description":"Build a question-and-answer chatbot with a document loaded from local memory.","sidebar":"defaultSidebar"},"Starter-Projects/starter-projects-hierarchical-crew":{"id":"Starter-Projects/starter-projects-hierarchical-crew","title":"Hierarchical Tasks Agent","description":"Build a Hierarchical Tasks Agent flow for a multi-shot application using CrewAI. This flow uses CrewAI to manage a Hierarchical Crew of Agents as they perform disparate tasks under the control of a Manager Agent.","sidebar":"defaultSidebar"},"Starter-Projects/starter-projects-memory-chatbot":{"id":"Starter-Projects/starter-projects-memory-chatbot","title":"Memory Chatbot","description":"This flow extends the\xa0Basic Prompting\xa0flow to include a chat memory. This makes the AI remember previous user inputs.","sidebar":"defaultSidebar"},"Starter-Projects/starter-projects-sequential-crew":{"id":"Starter-Projects/starter-projects-sequential-crew","title":"Sequential Tasks Agent","description":"Build a Sequential Tasks Agent flow for a multi-shot application using CrewAI. This flow uses CrewAI to manage a Crew of Agents as they perform a sequence of Tasks.","sidebar":"defaultSidebar"},"Starter-Projects/starter-projects-vector-store-rag":{"id":"Starter-Projects/starter-projects-vector-store-rag","title":"Vector Store RAG","description":"Retrieval Augmented Generation, or RAG, is a pattern for training LLMs on your data and querying it.","sidebar":"defaultSidebar"},"What\u2019s-New/whats-new-a-new-chapter-langflow":{"id":"What\u2019s-New/whats-new-a-new-chapter-langflow","title":"1.0 - A new chapter for Langflow","description":"First things first","sidebar":"defaultSidebar"},"Workspace/workspace":{"id":"Workspace/workspace","title":"Workspace Overview","description":"The Langflow Workspace","sidebar":"defaultSidebar"},"Workspace/workspace-api":{"id":"Workspace/workspace-api","title":"API","description":"The\xa0API\xa0section presents code templates for integrating your flow into external applications.","sidebar":"defaultSidebar"},"Workspace/workspace-logs":{"id":"Workspace/workspace-logs","title":"Logs","description":"The\xa0Logs\xa0page provides a detailed record of all component executions within a workspace. It is designed to help you track actions, debug issues, and understand the flow of data through various components.","sidebar":"defaultSidebar"},"Workspace/workspace-playground":{"id":"Workspace/workspace-playground","title":"Playground","description":"The\xa0Playground\xa0is a dynamic interface designed for real-time interaction with AIs, allowing users to chat, access memories and monitor inputs and outputs. Here, users can directly prototype and their models, making adjustments and observing different outcomes.","sidebar":"defaultSidebar"}}}}')}}]); \ No newline at end of file diff --git a/assets/js/873ebc27.9f836f52.js b/assets/js/873ebc27.9f836f52.js deleted file mode 100644 index 5db8750dac..0000000000 --- a/assets/js/873ebc27.9f836f52.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[5572],{2511:(o,e,t)=>{t.r(e),t.d(e,{CH:()=>d,assets:()=>i,chCodeConfig:()=>a,contentTitle:()=>c,default:()=>u,frontMatter:()=>l,metadata:()=>p,toc:()=>h});var n=t(4848),s=t(8453),r=t(4754);const l={title:"Custom Components",sidebar_position:8,slug:"/components-custom-components"},c=void 0,p={id:"Components/components-custom-components",title:"Custom Components",description:"Langflow components can be created from within the platform, allowing users to extend the platform's functionality using Python code. They encapsulate are designed to be independent units, reusable across different workflows.",source:"@site/docs/Components/components-custom-components.md",sourceDirName:"Components",slug:"/components-custom-components",permalink:"/components-custom-components",draft:!1,unlisted:!1,tags:[],version:"current",sidebarPosition:8,frontMatter:{title:"Custom Components",sidebar_position:8,slug:"/components-custom-components"},sidebar:"defaultSidebar",previous:{title:"Vector Stores",permalink:"/components-vector-stores"},next:{title:"RAG",permalink:"/components-rag"}},i={},d={annotations:r.hk,Code:r.Cy},a={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},h=[{value:"Key Characteristics:",id:"d3a151089a9e4584bd420461cd1432c6",level:3},{value:"Why Use Custom Components?",id:"827a2b5acec94426a4a2106a8332622d",level:3},{value:"How to Write Them",id:"2088ade519514bb3923cdf7f2ac2089a",level:3},{value:"Input Types",id:"3815589831f24ab792328ed233c8b00d",level:2},{value:"HandleInput",id:"fb06c48a326043ffa46badc1ab3ba467",level:3},{value:"DataInput",id:"0e1dcb768e38487180d720b0884a90f5",level:3},{value:"StrInput",id:"4ec6e68ad9ab4cd194e8e607bc5b3411",level:3},{value:"MessageInput",id:"9292ac0105e14177af5eff2131b9c71b",level:3},{value:"MessageTextInput",id:"5511f5e32b944b4e973379a6bd5405e4",level:3},{value:"MultilineInput",id:"e6d8315b0fb44a2fb8c62c3f3184bbe9",level:3},{value:"SecretStrInput",id:"2283c13aa5f745b8b0009f7d40e59419",level:3},{value:"IntInput",id:"612680db6578451daef695bd19827a56",level:3},{value:"FloatInput",id:"a15e1fdae15b49fc9bfbf38f8bd7b203",level:3},{value:"BoolInput",id:"3083671e0e7f4390a03396485114be66",level:3},{value:"NestedDictInput",id:"2866fc4018e743d8a45afde53f1e57be",level:3},{value:"DictInput",id:"daa2c2398f694ec199b425e2ed4bcf93",level:3},{value:"DropdownInput",id:"14dcdef11bab4d3f8127eaf2e36a77b9",level:3},{value:"FileInput",id:"73e6377dc5f446f39517a558a1291410",level:3},{value:"Generic Input",id:"278e2027493e45b68746af0a5b6c06f6",level:3},{value:"Multiple Outputs",id:"6f225be8a142450aa19ee8e46a3b3c8c",level:3},{value:"Special Operations",id:"b1ef2d18e2694b93927ae9403d24b96b",level:2}];function y(o){const e={code:"code",h2:"h2",h3:"h3",hr:"hr",img:"img",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,s.R)(),...o.components};return d||F("CH",!1),d.Code||F("CH.Code",!0),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n",(0,n.jsx)(e.p,{children:"Langflow components can be created from within the platform, allowing users to extend the platform's functionality using Python code. They encapsulate are designed to be independent units, reusable across different workflows."}),"\n",(0,n.jsx)(e.p,{children:"These components can be easily connected within a language model pipeline, adding freedom and flexibility to what can be included in between user and AI messages."}),"\n",(0,n.jsx)(e.p,{children:(0,n.jsx)(e.img,{src:t(2224).A+"",width:"1984",height:"1116"})}),"\n",(0,n.jsx)(e.p,{children:"Since Langflow operates with Python behind the scenes, you can implement any Python function within a Custom Component. This means you can leverage the power of libraries such as Pandas, Scikit-learn, Numpy, and thousands of packages to create components that handle data processing in unlimited ways."}),"\n",(0,n.jsx)(e.p,{children:"Custom Components are not just about extending functionality; they also streamline the development process. By creating reusable and configurable components, you can enhance the capabilities of Langflow, making it a powerful tool for developing complex workflows."}),"\n",(0,n.jsx)(e.h3,{id:"d3a151089a9e4584bd420461cd1432c6",children:"Key Characteristics:"}),"\n",(0,n.jsxs)(e.ol,{children:["\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:"Modular and Reusable"}),": Designed as independent units, components encapsulate specific functionality, making them reusable across different projects and workflows."]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:"Integration with Python Libraries"}),": You can import libraries like Pandas, Scikit-learn, Numpy, etc., to build components that handle data processing, machine learning, numerical computations, and more."]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:"Flexible Inputs and Outputs"}),": While Langflow offers native input and output types, you can use any type as long as they are properly annotated in the output methods (e.g.,\xa0",(0,n.jsx)(e.code,{children:"> list[int]"}),")."]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:"Python-Powered"}),": Since Langflow operates with Python behind the scenes, any Python function can be implemented within a custom component."]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:"Enhanced Workflow"}),": Custom components serve as reusable building blocks, enabling you to create pre-processing visual blocks with ease and integrate them into your language model pipeline."]}),"\n"]}),"\n",(0,n.jsx)(e.h3,{id:"827a2b5acec94426a4a2106a8332622d",children:"Why Use Custom Components?"}),"\n",(0,n.jsxs)(e.ul,{children:["\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:"Customization"}),": Tailor the functionality to your specific needs by writing Python code that suits your workflow."]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:"Flexibility"}),": Add any Python-based logic or processing step between user/AI messages, enhancing the flexibility of Langflow."]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:"Efficiency"}),": Streamline your development process by creating reusable, configurable components that can be easily deployed."]}),"\n"]}),"\n",(0,n.jsx)(e.h3,{id:"2088ade519514bb3923cdf7f2ac2089a",children:"How to Write Them"}),"\n",(0,n.jsx)(e.hr,{}),"\n",(0,n.jsx)(e.p,{children:"Writing custom components in Langflow involves creating a Python class that defines the component's functionality, inputs, and outputs. The process involves a few key steps:"}),"\n",(0,n.jsxs)(e.ol,{children:["\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:"Define the Class"}),": Start by defining a Python class that inherits from\xa0",(0,n.jsx)(e.code,{children:"Component"}),". This class will encapsulate the functionality of your custom component."]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:"Specify Inputs and Outputs"}),": Use Langflow's input and output classes to define the inputs and outputs of your component. They should be declared as class attributes."]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:"Implement Output Methods"}),": Implement\xa0methods for each output, which contains the logic of your component. These methods can access input values using\xa0",(0,n.jsx)(e.code,{children:"self."})," , return processed values and define what to be displayed in the component with the\xa0",(0,n.jsx)(e.code,{children:"self.status"}),"\xa0attribute."]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:"Use Proper Annotations"}),": Ensure that output methods are properly annotated with their types. Langflow uses these annotations to validate and handle data correctly."]}),"\n"]}),"\n",(0,n.jsx)(e.p,{children:"Here's a basic structure of a custom component:"}),"\n",(0,n.jsx)(d.Code,{codeConfig:a,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"from",props:{style:{color:"#FF7B72"}}},{content:" langflow.custom ",props:{style:{color:"#C9D1D9"}}},{content:"import",props:{style:{color:"#FF7B72"}}},{content:" Component",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"from",props:{style:{color:"#FF7B72"}}},{content:" langflow.inputs ",props:{style:{color:"#C9D1D9"}}},{content:"import",props:{style:{color:"#FF7B72"}}},{content:" StrInput, IntInput",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"from",props:{style:{color:"#FF7B72"}}},{content:" langflow.template ",props:{style:{color:"#C9D1D9"}}},{content:"import",props:{style:{color:"#FF7B72"}}},{content:" Output",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"class ",props:{style:{color:"#FF7B72"}}},{content:"MyCustomComponent",props:{style:{color:"#FFA657"}}},{content:"(",props:{style:{color:"#C9D1D9"}}},{content:"Component",props:{style:{color:"#79C0FF"}}},{content:"):",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" icon ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:'"coffee" ',props:{style:{color:"#A5D6FF"}}},{content:"# check lucide.dev/icons or pass an emoji",props:{style:{color:"#8B949E"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" inputs ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" [",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" StrInput(",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"input_text"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Input Text"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" info",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Text to be processed."',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" IntInput(",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"input_number"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Input Number"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" info",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Number to be processed."',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ]",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" outputs ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" [",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" Output(",props:{style:{color:"#C9D1D9"}}},{content:"display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Processed Text"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"processed_text"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"method",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"process_text"',props:{style:{color:"#A5D6FF"}}},{content:"),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ]",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" def ",props:{style:{color:"#FF7B72"}}},{content:"process_text",props:{style:{color:"#D2A8FF"}}},{content:"(self) -> ",props:{style:{color:"#C9D1D9"}}},{content:"str",props:{style:{color:"#79C0FF"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" input_text ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:"self",props:{style:{color:"#79C0FF"}}},{content:".input_text",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" input_number ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:"self",props:{style:{color:"#79C0FF"}}},{content:".input_number",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" # Implement your logic here",props:{style:{color:"#8B949E"}}}]},{tokens:[{content:" processed_text ",props:{style:{color:"#C9D1D9"}}},{content:"= f",props:{style:{color:"#FF7B72"}}},{content:'"',props:{style:{color:"#A5D6FF"}}},{content:"{",props:{style:{color:"#79C0FF"}}},{content:"input_text",props:{style:{color:"#C9D1D9"}}},{content:"}",props:{style:{color:"#79C0FF"}}},{content:" processed with number ",props:{style:{color:"#A5D6FF"}}},{content:"{",props:{style:{color:"#79C0FF"}}},{content:"input_number",props:{style:{color:"#C9D1D9"}}},{content:"}",props:{style:{color:"#79C0FF"}}},{content:'"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" self",props:{style:{color:"#79C0FF"}}},{content:".status ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" processed_text",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" return",props:{style:{color:"#FF7B72"}}},{content:" processed_text",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]}],lang:"python"},annotations:[]}]}),"\n",(0,n.jsxs)(e.p,{children:["Paste that code into the Custom Component code snippet and click ",(0,n.jsx)(e.strong,{children:"Check & Save."})]}),"\n",(0,n.jsx)(e.p,{children:(0,n.jsx)(e.img,{src:t(8582).A+"",width:"2976",height:"1674"})}),"\n",(0,n.jsx)(e.p,{children:"You should see something like the component below. Double click the name or description areas to edit them."}),"\n",(0,n.jsx)(e.p,{children:(0,n.jsx)(e.img,{src:t(6928).A+"",width:"2144",height:"1206"})}),"\n",(0,n.jsx)(e.h2,{id:"3815589831f24ab792328ed233c8b00d",children:"Input Types"}),"\n",(0,n.jsx)(e.hr,{}),"\n",(0,n.jsx)(e.p,{children:"Langflow provides several higher-level input types to simplify the creation of custom components. These input types standardize how inputs are defined, validated, and used. Here\u2019s a guide on how to use these inputs and their primary purposes:"}),"\n",(0,n.jsx)(e.h3,{id:"fb06c48a326043ffa46badc1ab3ba467",children:(0,n.jsx)(e.strong,{children:"HandleInput"})}),"\n",(0,n.jsxs)(e.p,{children:["Represents an input that has a handle to a specific type (e.g.,\xa0",(0,n.jsx)(e.code,{children:"BaseLanguageModel"}),",\xa0",(0,n.jsx)(e.code,{children:"BaseRetriever"}),", etc.)."]}),"\n",(0,n.jsxs)(e.ul,{children:["\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:"Usage:"}),"\xa0Useful for connecting to specific component types in a flow."]}),"\n"]}),"\n",(0,n.jsx)(e.h3,{id:"0e1dcb768e38487180d720b0884a90f5",children:(0,n.jsx)(e.strong,{children:"DataInput"})}),"\n",(0,n.jsxs)(e.p,{children:["Represents an input that receives a\xa0",(0,n.jsx)(e.code,{children:"Data"}),"\xa0object."]}),"\n",(0,n.jsxs)(e.ul,{children:["\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:"Usage:"}),"\xa0Ideal for components that process or manipulate data objects."]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:"Input Types:"}),"\xa0",(0,n.jsx)(e.code,{children:'["Data"]'})]}),"\n"]}),"\n",(0,n.jsx)(e.h3,{id:"4ec6e68ad9ab4cd194e8e607bc5b3411",children:(0,n.jsx)(e.strong,{children:"StrInput"})}),"\n",(0,n.jsx)(e.p,{children:"Represents a standard string input field."}),"\n",(0,n.jsxs)(e.ul,{children:["\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:"Usage:"}),"\xa0Used for any text input where the user needs to provide a string."]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:"Input Types:"}),"\xa0",(0,n.jsx)(e.code,{children:'["Text"]'})]}),"\n"]}),"\n",(0,n.jsx)(e.h3,{id:"9292ac0105e14177af5eff2131b9c71b",children:(0,n.jsx)(e.strong,{children:"MessageInput"})}),"\n",(0,n.jsxs)(e.p,{children:["Represents an input field specifically for\xa0",(0,n.jsx)(e.code,{children:"Message"}),"\xa0objects."]}),"\n",(0,n.jsxs)(e.ul,{children:["\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:"Usage:"}),"\xa0Used in components that handle or process messages."]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:"Input Types:"}),"\xa0",(0,n.jsx)(e.code,{children:'["Message"]'})]}),"\n"]}),"\n",(0,n.jsx)(e.h3,{id:"5511f5e32b944b4e973379a6bd5405e4",children:(0,n.jsx)(e.strong,{children:"MessageTextInput"})}),"\n",(0,n.jsx)(e.p,{children:"Represents a text input for messages."}),"\n",(0,n.jsxs)(e.ul,{children:["\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:"Usage:"}),"\xa0Suitable for components that need to extract text from message objects."]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:"Input Types:"}),"\xa0",(0,n.jsx)(e.code,{children:'["Message"]'})]}),"\n"]}),"\n",(0,n.jsx)(e.h3,{id:"e6d8315b0fb44a2fb8c62c3f3184bbe9",children:(0,n.jsx)(e.strong,{children:"MultilineInput"})}),"\n",(0,n.jsx)(e.p,{children:"Represents a text field that supports multiple lines."}),"\n",(0,n.jsxs)(e.ul,{children:["\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:"Usage:"}),"\xa0Ideal for longer text inputs where the user might need to write extended text."]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:"Input Types:"}),"\xa0",(0,n.jsx)(e.code,{children:'["Text"]'})]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:"Attributes:"}),"\xa0",(0,n.jsx)(e.code,{children:"multiline=True"})]}),"\n"]}),"\n",(0,n.jsx)(e.h3,{id:"2283c13aa5f745b8b0009f7d40e59419",children:(0,n.jsx)(e.strong,{children:"SecretStrInput"})}),"\n",(0,n.jsx)(e.p,{children:"Represents a password input field."}),"\n",(0,n.jsxs)(e.ul,{children:["\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:"Usage:"}),"\xa0Used for sensitive text inputs where the input should be hidden (e.g., passwords, API keys)."]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:"Attributes:"}),"\xa0",(0,n.jsx)(e.code,{children:"password=True"})]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:"Input Types:"}),"\xa0Does not accept input types, meaning it has no input handles for previous nodes/components to connect to it."]}),"\n"]}),"\n",(0,n.jsx)(e.h3,{id:"612680db6578451daef695bd19827a56",children:(0,n.jsx)(e.strong,{children:"IntInput"})}),"\n",(0,n.jsx)(e.p,{children:"Represents an integer input field."}),"\n",(0,n.jsxs)(e.ul,{children:["\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:"Usage:"}),"\xa0Used for numeric inputs where the value should be an integer."]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:"Input Types:"}),"\xa0",(0,n.jsx)(e.code,{children:'["Integer"]'})]}),"\n"]}),"\n",(0,n.jsx)(e.h3,{id:"a15e1fdae15b49fc9bfbf38f8bd7b203",children:(0,n.jsx)(e.strong,{children:"FloatInput"})}),"\n",(0,n.jsx)(e.p,{children:"Represents a float input field."}),"\n",(0,n.jsxs)(e.ul,{children:["\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:"Usage:"}),"\xa0Used for numeric inputs where the value should be a floating-point number."]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:"Input Types:"}),"\xa0",(0,n.jsx)(e.code,{children:'["Float"]'})]}),"\n"]}),"\n",(0,n.jsx)(e.h3,{id:"3083671e0e7f4390a03396485114be66",children:(0,n.jsx)(e.strong,{children:"BoolInput"})}),"\n",(0,n.jsx)(e.p,{children:"Represents a boolean input field."}),"\n",(0,n.jsxs)(e.ul,{children:["\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:"Usage:"}),"\xa0Used for true/false or yes/no type inputs."]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:"Input Types:"}),"\xa0",(0,n.jsx)(e.code,{children:'["Boolean"]'})]}),"\n"]}),"\n",(0,n.jsx)(e.h3,{id:"2866fc4018e743d8a45afde53f1e57be",children:(0,n.jsx)(e.strong,{children:"NestedDictInput"})}),"\n",(0,n.jsx)(e.p,{children:"Represents an input field for nested dictionaries."}),"\n",(0,n.jsxs)(e.ul,{children:["\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:"Usage:"}),"\xa0Used for more complex data structures where the input needs to be a dictionary."]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:"Input Types:"}),"\xa0",(0,n.jsx)(e.code,{children:'["NestedDict"]'})]}),"\n"]}),"\n",(0,n.jsx)(e.h3,{id:"daa2c2398f694ec199b425e2ed4bcf93",children:(0,n.jsx)(e.strong,{children:"DictInput"})}),"\n",(0,n.jsx)(e.p,{children:"Represents an input field for dictionaries."}),"\n",(0,n.jsxs)(e.ul,{children:["\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:"Usage:"}),"\xa0Suitable for inputs that require a dictionary format."]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:"Input Types:"}),"\xa0",(0,n.jsx)(e.code,{children:'["Dict"]'})]}),"\n"]}),"\n",(0,n.jsx)(e.h3,{id:"14dcdef11bab4d3f8127eaf2e36a77b9",children:(0,n.jsx)(e.strong,{children:"DropdownInput"})}),"\n",(0,n.jsx)(e.p,{children:"Represents a dropdown input field."}),"\n",(0,n.jsxs)(e.ul,{children:["\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:"Usage:"}),"\xa0Used where the user needs to select from a predefined list of options."]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:"Attributes:"}),"\xa0",(0,n.jsx)(e.code,{children:"options"}),"\xa0to define the list of selectable options."]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:"Input Types:"}),"\xa0",(0,n.jsx)(e.code,{children:'["Text"]'})]}),"\n"]}),"\n",(0,n.jsx)(e.h3,{id:"73e6377dc5f446f39517a558a1291410",children:(0,n.jsx)(e.strong,{children:"FileInput"})}),"\n",(0,n.jsx)(e.p,{children:"Represents a file input field."}),"\n",(0,n.jsxs)(e.ul,{children:["\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:"Usage:"}),"\xa0Used to upload files."]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:"Attributes:"}),"\xa0",(0,n.jsx)(e.code,{children:"file_types"}),"\xa0to specify the types of files that can be uploaded."]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:"Input Types:"}),"\xa0",(0,n.jsx)(e.code,{children:'["File"]'})]}),"\n"]}),"\n",(0,n.jsx)(e.p,{children:"Here is an example of how these inputs can be defined in a custom component:"}),"\n",(0,n.jsx)(d.Code,{codeConfig:a,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"from",props:{style:{color:"#FF7B72"}}},{content:" langflow.custom ",props:{style:{color:"#C9D1D9"}}},{content:"import",props:{style:{color:"#FF7B72"}}},{content:" Component",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"from",props:{style:{color:"#FF7B72"}}},{content:" langflow.inputs ",props:{style:{color:"#C9D1D9"}}},{content:"import",props:{style:{color:"#FF7B72"}}},{content:" StrInput, MultilineInput, SecretStrInput, IntInput, DropdownInput",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"from",props:{style:{color:"#FF7B72"}}},{content:" langflow.template ",props:{style:{color:"#C9D1D9"}}},{content:"import",props:{style:{color:"#FF7B72"}}},{content:" Output, Input",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"class ",props:{style:{color:"#FF7B72"}}},{content:"MyCustomComponent",props:{style:{color:"#FFA657"}}},{content:"(",props:{style:{color:"#C9D1D9"}}},{content:"Component",props:{style:{color:"#79C0FF"}}},{content:"):",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:'"My Custom Component"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" description ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:'"An example of a custom component with various input types."',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" inputs ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" [",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" StrInput(",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"username"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Username"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" info",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Enter your username."',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" ),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" SecretStrInput(",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"password"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Password"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" info",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Enter your password."',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" ),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" MultilineInput(",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"description"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Description"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" info",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Enter a detailed description."',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" IntInput(",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"age"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Age"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" info",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Enter your age."',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" ),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" DropdownInput(",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"gender"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Gender"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" options",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"[",props:{style:{color:"#C9D1D9"}}},{content:'"Male"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"Female"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"Other"',props:{style:{color:"#A5D6FF"}}},{content:"],",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" info",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Select your gender."',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" )",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ]",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" outputs ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" [",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" Output(",props:{style:{color:"#C9D1D9"}}},{content:"display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Result"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"result"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"method",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"process_inputs"',props:{style:{color:"#A5D6FF"}}},{content:"),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ]",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" def ",props:{style:{color:"#FF7B72"}}},{content:"process_inputs",props:{style:{color:"#D2A8FF"}}},{content:"(self):",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" # Your processing logic here",props:{style:{color:"#8B949E"}}}]},{tokens:[{content:" return ",props:{style:{color:"#FF7B72"}}},{content:'"Processed"',props:{style:{color:"#A5D6FF"}}}]}],lang:"python"},annotations:[]}]}),"\n",(0,n.jsx)(e.p,{children:"By defining inputs this way, Langflow can automatically handle the validation and display of these fields in the user interface, making it easier to create robust and user-friendly custom components."}),"\n",(0,n.jsxs)(e.p,{children:["All of the types detailed above derive from a general class that can also be accessed through the generic\xa0",(0,n.jsx)(e.code,{children:"Input"}),"\xa0class."]}),"\n",(0,n.jsx)(e.h3,{id:"278e2027493e45b68746af0a5b6c06f6",children:"Generic Input"}),"\n",(0,n.jsx)(e.hr,{}),"\n",(0,n.jsxs)(e.p,{children:["Langflow offers native input types, but you can use any type as long as they are properly annotated in the output methods (e.g.,\xa0",(0,n.jsx)(e.code,{children:"-> list[int]"}),")."]}),"\n",(0,n.jsxs)(e.p,{children:["The\xa0",(0,n.jsx)(e.code,{children:"Input"}),"\xa0class is highly customizable, allowing you to specify a wide range of attributes for each input field. It has several attributes that can be customized:"]}),"\n",(0,n.jsxs)(e.ul,{children:["\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.code,{children:"field_type"}),": Specifies the type of field (e.g.,\xa0",(0,n.jsx)(e.code,{children:"str"}),",\xa0",(0,n.jsx)(e.code,{children:"int"}),"). Default is\xa0",(0,n.jsx)(e.code,{children:"str"}),"."]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.code,{children:"required"}),": Boolean indicating if the field is required. Default is\xa0",(0,n.jsx)(e.code,{children:"False"}),"."]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.code,{children:"placeholder"}),": Placeholder text for the input field. Default is an empty string."]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.code,{children:"is_list"}),": Boolean indicating if the field should accept a list of values. Default is\xa0",(0,n.jsx)(e.code,{children:"False"}),"."]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.code,{children:"show"}),": Boolean indicating if the field should be shown. Default is\xa0",(0,n.jsx)(e.code,{children:"True"}),"."]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.code,{children:"multiline"}),": Boolean indicating if the field should allow multi-line input. Default is\xa0",(0,n.jsx)(e.code,{children:"False"}),"."]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.code,{children:"value"}),": Default value for the input field. Default is\xa0",(0,n.jsx)(e.code,{children:"None"}),"."]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.code,{children:"file_types"}),": List of accepted file types (for file inputs). Default is an empty list."]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.code,{children:"file_path"}),": File path if the field is a file input. Default is\xa0",(0,n.jsx)(e.code,{children:"None"}),"."]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.code,{children:"password"}),": Boolean indicating if the field is a password. Default is\xa0",(0,n.jsx)(e.code,{children:"False"}),"."]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.code,{children:"options"}),": List of options for the field (for dropdowns). Default is\xa0",(0,n.jsx)(e.code,{children:"None"}),"."]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.code,{children:"name"}),": Name of the input field. Default is\xa0",(0,n.jsx)(e.code,{children:"None"}),"."]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.code,{children:"display_name"}),": Display name for the input field. Default is\xa0",(0,n.jsx)(e.code,{children:"None"}),"."]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.code,{children:"advanced"}),": Boolean indicating if the field is an advanced parameter. Default is\xa0",(0,n.jsx)(e.code,{children:"False"}),"."]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.code,{children:"input_types"}),": List of accepted input types. Default is\xa0",(0,n.jsx)(e.code,{children:"None"}),"."]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.code,{children:"dynamic"}),": Boolean indicating if the field is dynamic. Default is\xa0",(0,n.jsx)(e.code,{children:"False"}),"."]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.code,{children:"info"}),": Additional information or tooltip for the input field. Default is an empty string."]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.code,{children:"real_time_refresh"}),": Boolean indicating if the field should refresh in real-time. Default is\xa0",(0,n.jsx)(e.code,{children:"None"}),"."]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.code,{children:"refresh_button"}),": Boolean indicating if the field should have a refresh button. Default is\xa0",(0,n.jsx)(e.code,{children:"None"}),"."]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.code,{children:"refresh_button_text"}),": Text for the refresh button. Default is\xa0",(0,n.jsx)(e.code,{children:"None"}),"."]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.code,{children:"range_spec"}),": Range specification for numeric fields. Default is\xa0",(0,n.jsx)(e.code,{children:"None"}),"."]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.code,{children:"load_from_db"}),": Boolean indicating if the field should load from the database. Default is\xa0",(0,n.jsx)(e.code,{children:"False"}),"."]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.code,{children:"title_case"}),": Boolean indicating if the display name should be in title case. Default is\xa0",(0,n.jsx)(e.code,{children:"True"}),"."]}),"\n"]}),"\n",(0,n.jsxs)(e.p,{children:["Below is an example of how to define inputs for a component using the\xa0",(0,n.jsx)(e.code,{children:"Input"}),"\xa0class:"]}),"\n",(0,n.jsx)(d.Code,{codeConfig:a,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"from",props:{style:{color:"#FF7B72"}}},{content:" langflow.template ",props:{style:{color:"#C9D1D9"}}},{content:"import",props:{style:{color:"#FF7B72"}}},{content:" Input, Output",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"from",props:{style:{color:"#FF7B72"}}},{content:" langflow.custom ",props:{style:{color:"#C9D1D9"}}},{content:"import",props:{style:{color:"#FF7B72"}}},{content:" Component",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"from",props:{style:{color:"#FF7B72"}}},{content:" langflow.field_typing ",props:{style:{color:"#C9D1D9"}}},{content:"import",props:{style:{color:"#FF7B72"}}},{content:" Text",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"class ",props:{style:{color:"#FF7B72"}}},{content:"ExampleComponent",props:{style:{color:"#FFA657"}}},{content:"(",props:{style:{color:"#C9D1D9"}}},{content:"Component",props:{style:{color:"#79C0FF"}}},{content:"):",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:'"Example Component"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" description ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:'"An example component demonstrating input fields."',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" inputs ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" [",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" Input(",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"input_text"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Input Text"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" field_type",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"str"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" required",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"True",props:{style:{color:"#79C0FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" placeholder",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Enter some text"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" multiline",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"True",props:{style:{color:"#79C0FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" info",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"This is a required text input."',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" input_types",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"[",props:{style:{color:"#C9D1D9"}}},{content:'"Text"',props:{style:{color:"#A5D6FF"}}},{content:"]",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" Input(",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"max_length"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Max Length"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" field_type",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"int"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" required",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"False",props:{style:{color:"#79C0FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" placeholder",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Maximum length"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" info",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Enter the maximum length of the text."',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" range_spec",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"{",props:{style:{color:"#C9D1D9"}}},{content:'"min"',props:{style:{color:"#A5D6FF"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"0",props:{style:{color:"#79C0FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"max"',props:{style:{color:"#A5D6FF"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"1000",props:{style:{color:"#79C0FF"}}},{content:"},",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" Input(",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"options"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Options"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" field_type",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"str"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" is_list",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"True",props:{style:{color:"#79C0FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" options",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"[",props:{style:{color:"#C9D1D9"}}},{content:'"Option 1"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"Option 2"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"Option 3"',props:{style:{color:"#A5D6FF"}}},{content:"],",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" info",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Select one or more options."',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" ),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ]",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" outputs ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" [",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" Output(",props:{style:{color:"#C9D1D9"}}},{content:"display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Result"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"result"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"method",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"process_input"',props:{style:{color:"#A5D6FF"}}},{content:"),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ]",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" def ",props:{style:{color:"#FF7B72"}}},{content:"process_input",props:{style:{color:"#D2A8FF"}}},{content:"(self) -> Text:",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" # Process the inputs and generate output",props:{style:{color:"#8B949E"}}}]},{tokens:[{content:" return",props:{style:{color:"#FF7B72"}}},{content:" Text(",props:{style:{color:"#C9D1D9"}}},{content:"value",props:{style:{color:"#FFA657"}}},{content:"=f",props:{style:{color:"#FF7B72"}}},{content:'"Processed: ',props:{style:{color:"#A5D6FF"}}},{content:"{self",props:{style:{color:"#79C0FF"}}},{content:".input_text",props:{style:{color:"#C9D1D9"}}},{content:"}",props:{style:{color:"#79C0FF"}}},{content:", Max Length: ",props:{style:{color:"#A5D6FF"}}},{content:"{self",props:{style:{color:"#79C0FF"}}},{content:".max_length",props:{style:{color:"#C9D1D9"}}},{content:"}",props:{style:{color:"#79C0FF"}}},{content:", Options: ",props:{style:{color:"#A5D6FF"}}},{content:"{self",props:{style:{color:"#79C0FF"}}},{content:".options",props:{style:{color:"#C9D1D9"}}},{content:"}",props:{style:{color:"#79C0FF"}}},{content:'"',props:{style:{color:"#A5D6FF"}}},{content:")",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"# Define how to use the inputs and outputs",props:{style:{color:"#8B949E"}}}]},{tokens:[{content:"component ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" ExampleComponent()",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]}],lang:"python"},annotations:[]}]}),"\n",(0,n.jsx)(e.p,{children:"In this example:"}),"\n",(0,n.jsxs)(e.ul,{children:["\n",(0,n.jsxs)(e.li,{children:["The\xa0",(0,n.jsx)(e.code,{children:"input_text"}),"\xa0input is a required multi-line text field."]}),"\n",(0,n.jsxs)(e.li,{children:["The\xa0",(0,n.jsx)(e.code,{children:"max_length"}),"\xa0input is an optional integer field with a range specification."]}),"\n",(0,n.jsxs)(e.li,{children:["The\xa0",(0,n.jsx)(e.code,{children:"options"}),"\xa0input is a list of strings with predefined options."]}),"\n"]}),"\n",(0,n.jsx)(e.p,{children:"These attributes allow for a high degree of customization, making it easy to create input fields that suit the needs of your specific component."}),"\n",(0,n.jsx)(e.h3,{id:"6f225be8a142450aa19ee8e46a3b3c8c",children:"Multiple Outputs"}),"\n",(0,n.jsx)(e.hr,{}),"\n",(0,n.jsx)(e.p,{children:"In Langflow, custom components can have multiple outputs. Each output can be associated with a specific method in the component, allowing you to define distinct behaviors for each output path. This feature is particularly useful when you want to route data based on certain conditions or process it in multiple ways."}),"\n",(0,n.jsxs)(e.ol,{children:["\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:"Definition of Outputs"}),": Each output is defined in the\xa0",(0,n.jsx)(e.code,{children:"outputs"}),"\xa0list of the component. Each output is associated with a display name, an internal name, and a method that gets called to generate the output."]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.strong,{children:"Output Methods"}),": The methods associated with outputs are responsible for generating the data for that particular output. These methods are called when the component is executed, and each method can independently produce its result."]}),"\n"]}),"\n",(0,n.jsx)(e.p,{children:"Below is an example of a component with two outputs:"}),"\n",(0,n.jsxs)(e.ul,{children:["\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.code,{children:"process_data"}),": Processes the input text (e.g., converts it to uppercase) and returns it."]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.code,{children:"get_processing_function"}),": Returns the\xa0",(0,n.jsx)(e.code,{children:"process_data"}),"\xa0method itself to be reused in composition."]}),"\n"]}),"\n",(0,n.jsx)(d.Code,{codeConfig:a,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"from",props:{style:{color:"#FF7B72"}}},{content:" typing ",props:{style:{color:"#C9D1D9"}}},{content:"import",props:{style:{color:"#FF7B72"}}},{content:" Callable",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"from",props:{style:{color:"#FF7B72"}}},{content:" langflow.custom ",props:{style:{color:"#C9D1D9"}}},{content:"import",props:{style:{color:"#FF7B72"}}},{content:" Component",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"from",props:{style:{color:"#FF7B72"}}},{content:" langflow.inputs ",props:{style:{color:"#C9D1D9"}}},{content:"import",props:{style:{color:"#FF7B72"}}},{content:" StrInput",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"from",props:{style:{color:"#FF7B72"}}},{content:" langflow.template ",props:{style:{color:"#C9D1D9"}}},{content:"import",props:{style:{color:"#FF7B72"}}},{content:" Output",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"from",props:{style:{color:"#FF7B72"}}},{content:" langflow.field_typing ",props:{style:{color:"#C9D1D9"}}},{content:"import",props:{style:{color:"#FF7B72"}}},{content:" Text",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"class ",props:{style:{color:"#FF7B72"}}},{content:"DualOutputComponent",props:{style:{color:"#FFA657"}}},{content:"(",props:{style:{color:"#C9D1D9"}}},{content:"Component",props:{style:{color:"#79C0FF"}}},{content:"):",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:'"Dual Output"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" description ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:'"Processes input text and returns both the result and the processing function."',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" icon ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:'"double-arrow"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" inputs ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" [",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" StrInput(",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"input_text"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Input Text"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" info",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"The text input to be processed."',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ]",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" outputs ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" [",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" Output(",props:{style:{color:"#C9D1D9"}}},{content:"display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Processed Data"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"processed_data"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"method",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"process_data"',props:{style:{color:"#A5D6FF"}}},{content:"),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" Output(",props:{style:{color:"#C9D1D9"}}},{content:"display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Processing Function"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"processing_function"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"method",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"get_processing_function"',props:{style:{color:"#A5D6FF"}}},{content:"),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ]",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" def ",props:{style:{color:"#FF7B72"}}},{content:"process_data",props:{style:{color:"#D2A8FF"}}},{content:"(self) -> Text:",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" # Process the input text (e.g., convert to uppercase)",props:{style:{color:"#8B949E"}}}]},{tokens:[{content:" processed ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:"self",props:{style:{color:"#79C0FF"}}},{content:".input_text.upper()",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" self",props:{style:{color:"#79C0FF"}}},{content:".status ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" processed",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" return",props:{style:{color:"#FF7B72"}}},{content:" processed",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" def ",props:{style:{color:"#FF7B72"}}},{content:"get_processing_function",props:{style:{color:"#D2A8FF"}}},{content:"(self) -> Callable[[], Text]:",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" # Return the processing function itself",props:{style:{color:"#8B949E"}}}]},{tokens:[{content:" return ",props:{style:{color:"#FF7B72"}}},{content:"self",props:{style:{color:"#79C0FF"}}},{content:".process_data",props:{style:{color:"#C9D1D9"}}}]}],lang:"python"},annotations:[]}]}),"\n",(0,n.jsx)(e.p,{children:"This example shows how to define multiple outputs in a custom component. The first output returns the processed data, while the second output returns the processing function itself."}),"\n",(0,n.jsxs)(e.p,{children:["The\xa0",(0,n.jsx)(e.code,{children:"processing_function"}),"\xa0output can be used in scenarios where the function itself is needed for further processing or dynamic flow control. Notice how both outputs are properly annotated with their respective types, ensuring clarity and type safety."]}),"\n",(0,n.jsx)(e.h2,{id:"b1ef2d18e2694b93927ae9403d24b96b",children:"Special Operations"}),"\n",(0,n.jsx)(e.hr,{}),"\n",(0,n.jsx)(e.p,{children:"Advanced methods and attributes offer additional control and functionality. Understanding how to leverage these can enhance your custom components' capabilities."}),"\n",(0,n.jsxs)(e.ul,{children:["\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.code,{children:"self.inputs"}),": Access all defined inputs. Useful when an output method needs to interact with multiple inputs."]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.code,{children:"self.outputs"}),": Access all defined outputs. This is particularly useful if an output function needs to trigger another output function."]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.code,{children:"self.status"}),": Use this to update the component's status or intermediate results. It helps track the component's internal state or store temporary data."]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.code,{children:"self.graph.flow_id"}),": Retrieve the flow ID, useful for maintaining context or debugging."]}),"\n",(0,n.jsxs)(e.li,{children:[(0,n.jsx)(e.code,{children:'self.stop("output_name")'}),": Use this method within an output function to prevent data from being sent through other components. This method stops next component execution and is particularly useful for specific operations where a component should stop from running based on specific conditions."]}),"\n"]})]})}function u(o={}){const{wrapper:e}={...(0,s.R)(),...o.components};return e?(0,n.jsx)(e,{...o,children:(0,n.jsx)(y,{...o})}):y(o)}function F(o,e){throw new Error("Expected "+(e?"component":"object")+" `"+o+"` to be defined: you likely forgot to import, pass, or provide it.")}},8582:(o,e,t)=>{t.d(e,{A:()=>n});const n=t.p+"assets/images/1028644105-85667a76353aa8f1527cdfc0f05b85be.png"},2224:(o,e,t)=>{t.d(e,{A:()=>n});const n=t.p+"assets/images/238089171-8512eacd66ef57e59756d6863fc38afd.png"},6928:(o,e,t)=>{t.d(e,{A:()=>n});const n=t.p+"assets/images/241280398-3d8a5879a54500d5767f7baa3b146760.png"}}]); \ No newline at end of file diff --git a/assets/js/873ebc27.d11012c8.js b/assets/js/873ebc27.d11012c8.js new file mode 100644 index 0000000000..1852e715b2 --- /dev/null +++ b/assets/js/873ebc27.d11012c8.js @@ -0,0 +1 @@ +"use strict";(self.webpackChunklangflow_docs=self.webpackChunklangflow_docs||[]).push([[5572],{2511:(o,t,e)=>{e.r(t),e.d(t,{CH:()=>a,assets:()=>i,chCodeConfig:()=>d,contentTitle:()=>c,default:()=>u,frontMatter:()=>l,metadata:()=>p,toc:()=>y});var n=e(4848),s=e(8453),r=e(4754);const l={title:"Custom Components",sidebar_position:8,slug:"/components-custom-components"},c="Custom Components",p={id:"Components/components-custom-components",title:"Custom Components",description:"Custom components are created within Langflow and extend the platform's functionality with custom, resusable Python code.",source:"@site/docs/Components/components-custom-components.md",sourceDirName:"Components",slug:"/components-custom-components",permalink:"/components-custom-components",draft:!1,unlisted:!1,tags:[],version:"current",sidebarPosition:8,frontMatter:{title:"Custom Components",sidebar_position:8,slug:"/components-custom-components"},sidebar:"defaultSidebar",previous:{title:"Vector Stores",permalink:"/components-vector-stores"},next:{title:"RAG",permalink:"/components-rag"}},i={},a={annotations:r.hk,Code:r.Cy},d={staticMediaQuery:"not screen, (max-width: 768px)",lineNumbers:!0,showCopyButton:!0,themeName:"github-dark"},y=[{value:"How to Create Custom Components",id:"how-to-create-custom-components",level:2},{value:"Add inputs and modify output methods",id:"add-inputs-and-modify-output-methods",level:2},{value:"Input Types",id:"3815589831f24ab792328ed233c8b00d",level:2},{value:"HandleInput",id:"fb06c48a326043ffa46badc1ab3ba467",level:3},{value:"DataInput",id:"0e1dcb768e38487180d720b0884a90f5",level:3},{value:"StrInput",id:"4ec6e68ad9ab4cd194e8e607bc5b3411",level:3},{value:"MessageInput",id:"9292ac0105e14177af5eff2131b9c71b",level:3},{value:"MessageTextInput",id:"5511f5e32b944b4e973379a6bd5405e4",level:3},{value:"MultilineInput",id:"e6d8315b0fb44a2fb8c62c3f3184bbe9",level:3},{value:"SecretStrInput",id:"2283c13aa5f745b8b0009f7d40e59419",level:3},{value:"IntInput",id:"612680db6578451daef695bd19827a56",level:3},{value:"FloatInput",id:"a15e1fdae15b49fc9bfbf38f8bd7b203",level:3},{value:"BoolInput",id:"3083671e0e7f4390a03396485114be66",level:3},{value:"NestedDictInput",id:"2866fc4018e743d8a45afde53f1e57be",level:3},{value:"DictInput",id:"daa2c2398f694ec199b425e2ed4bcf93",level:3},{value:"DropdownInput",id:"14dcdef11bab4d3f8127eaf2e36a77b9",level:3},{value:"FileInput",id:"73e6377dc5f446f39517a558a1291410",level:3},{value:"Generic Input",id:"278e2027493e45b68746af0a5b6c06f6",level:3},{value:"Create a Custom Component with Generic Input",id:"create-a-custom-component-with-generic-input",level:2},{value:"Create a Custom Component with Multiple Outputs",id:"6f225be8a142450aa19ee8e46a3b3c8c",level:2},{value:"Special Operations",id:"special-operations",level:2},{value:"Contribute Custom Components to Langflow",id:"contribute-custom-components-to-langflow",level:2}];function F(o){const t={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",hr:"hr",img:"img",li:"li",ol:"ol",p:"p",strong:"strong",ul:"ul",...(0,s.R)(),...o.components};return a||h("CH",!1),a.Code||h("CH.Code",!0),(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("style",{dangerouslySetInnerHTML:{__html:'[data-ch-theme="github-dark"] { --ch-t-colorScheme: dark;--ch-t-foreground: #c9d1d9;--ch-t-background: #0d1117;--ch-t-lighter-inlineBackground: #0d1117e6;--ch-t-editor-background: #0d1117;--ch-t-editor-foreground: #c9d1d9;--ch-t-editor-lineHighlightBackground: #6e76811a;--ch-t-editor-rangeHighlightBackground: #ffffff0b;--ch-t-editor-infoForeground: #3794FF;--ch-t-editor-selectionBackground: #264F78;--ch-t-focusBorder: #1f6feb;--ch-t-tab-activeBackground: #0d1117;--ch-t-tab-activeForeground: #c9d1d9;--ch-t-tab-inactiveBackground: #010409;--ch-t-tab-inactiveForeground: #8b949e;--ch-t-tab-border: #30363d;--ch-t-tab-activeBorder: #0d1117;--ch-t-editorGroup-border: #30363d;--ch-t-editorGroupHeader-tabsBackground: #010409;--ch-t-editorLineNumber-foreground: #6e7681;--ch-t-input-background: #0d1117;--ch-t-input-foreground: #c9d1d9;--ch-t-input-border: #30363d;--ch-t-icon-foreground: #8b949e;--ch-t-sideBar-background: #010409;--ch-t-sideBar-foreground: #c9d1d9;--ch-t-sideBar-border: #30363d;--ch-t-list-activeSelectionBackground: #6e768166;--ch-t-list-activeSelectionForeground: #c9d1d9;--ch-t-list-hoverBackground: #6e76811a;--ch-t-list-hoverForeground: #c9d1d9; }'}}),"\n",(0,n.jsx)(t.h1,{id:"custom-components",children:"Custom Components"}),"\n",(0,n.jsx)(t.p,{children:"Custom components are created within Langflow and extend the platform's functionality with custom, resusable Python code."}),"\n",(0,n.jsxs)(t.p,{children:["Since Langflow operates with Python behind the scenes, you can implement any Python function within a Custom Component. This means you can leverage the power of libraries such as Pandas, Scikit-learn, Numpy, and thousands of other packages to create components that handle data processing in unlimited ways. You can use any type as long as the type is properly annotated in the output methods (e.g.,\xa0",(0,n.jsx)(t.code,{children:"> list[int]"}),")."]}),"\n",(0,n.jsx)(t.p,{children:"Custom Components create reusable and configurable components to enhance the capabilities of Langflow, making it a powerful tool for developing complex processing between user and AI messages."}),"\n",(0,n.jsx)(t.h2,{id:"how-to-create-custom-components",children:"How to Create Custom Components"}),"\n",(0,n.jsx)(t.p,{children:"Creating custom components in Langflow involves creating a Python class that defines the component's functionality, inputs, and outputs.\nThe default code provides a working structure for your custom component."}),"\n",(0,n.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"# from langflow.field_typing import Data",props:{style:{color:"#8B949E"}}}]},{tokens:[{content:"from",props:{style:{color:"#FF7B72"}}},{content:" langflow.custom ",props:{style:{color:"#C9D1D9"}}},{content:"import",props:{style:{color:"#FF7B72"}}},{content:" Component",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"from",props:{style:{color:"#FF7B72"}}},{content:" langflow.io ",props:{style:{color:"#C9D1D9"}}},{content:"import",props:{style:{color:"#FF7B72"}}},{content:" MessageTextInput, Output",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"from",props:{style:{color:"#FF7B72"}}},{content:" langflow.schema ",props:{style:{color:"#C9D1D9"}}},{content:"import",props:{style:{color:"#FF7B72"}}},{content:" Data",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"class ",props:{style:{color:"#FF7B72"}}},{content:"CustomComponent",props:{style:{color:"#FFA657"}}},{content:"(",props:{style:{color:"#C9D1D9"}}},{content:"Component",props:{style:{color:"#79C0FF"}}},{content:"):",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:'"Custom Component"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" description ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:'"Use as a template to create your own component."',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" documentation: ",props:{style:{color:"#C9D1D9"}}},{content:"str ",props:{style:{color:"#79C0FF"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:'"http://docs.langflow.org/components/custom"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" icon ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:'"custom_components"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" name ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:'"CustomComponent"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" inputs ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" [",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" MessageTextInput(",props:{style:{color:"#C9D1D9"}}},{content:"name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"input_value"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Input Value"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"value",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Hello, World!"',props:{style:{color:"#A5D6FF"}}},{content:"),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ]",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" outputs ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" [",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" Output(",props:{style:{color:"#C9D1D9"}}},{content:"display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Output"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"output"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"method",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"build_output"',props:{style:{color:"#A5D6FF"}}},{content:"),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ]",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" def ",props:{style:{color:"#FF7B72"}}},{content:"build_output",props:{style:{color:"#D2A8FF"}}},{content:"(self) -> Data:",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" data ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" Data(",props:{style:{color:"#C9D1D9"}}},{content:"value",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"self",props:{style:{color:"#79C0FF"}}},{content:".input_value)",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" self",props:{style:{color:"#79C0FF"}}},{content:".status ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" data",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" return",props:{style:{color:"#FF7B72"}}},{content:" data",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]}],lang:"python"},annotations:[]}]}),"\n",(0,n.jsx)(t.p,{children:"You can create your class in your favorite text editor outside of Langflow and paste it in later, or just follow along in the code pane."}),"\n",(0,n.jsxs)(t.ol,{children:["\n",(0,n.jsxs)(t.li,{children:["In Langflow, from under ",(0,n.jsx)(t.strong,{children:"Helpers"}),", drag a ",(0,n.jsx)(t.strong,{children:"Custom Component"})," into the workspace."]}),"\n",(0,n.jsx)(t.li,{children:"Open the component's code pane."}),"\n",(0,n.jsxs)(t.li,{children:["Import dependencies.\nYour custom component inherits from the langflow ",(0,n.jsx)(t.code,{children:"Component"})," class so you need to include it."]}),"\n"]}),"\n",(0,n.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"from",props:{style:{color:"#FF7B72"}}},{content:" langflow.custom ",props:{style:{color:"#C9D1D9"}}},{content:"import",props:{style:{color:"#FF7B72"}}},{content:" Component",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"from",props:{style:{color:"#FF7B72"}}},{content:" langflow.io ",props:{style:{color:"#C9D1D9"}}},{content:"import",props:{style:{color:"#FF7B72"}}},{content:" MessageTextInput, Output",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"from",props:{style:{color:"#FF7B72"}}},{content:" langflow.schema ",props:{style:{color:"#C9D1D9"}}},{content:"import",props:{style:{color:"#FF7B72"}}},{content:" Data",props:{style:{color:"#C9D1D9"}}}]}],lang:"python"},annotations:[]}]}),"\n",(0,n.jsxs)(t.ol,{start:"4",children:["\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.strong,{children:"Define the Class"}),": Start by defining a Python class that inherits from\xa0",(0,n.jsx)(t.code,{children:"Component"}),". This class will encapsulate the functionality of your custom component."]}),"\n"]}),"\n",(0,n.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"class ",props:{style:{color:"#FF7B72"}}},{content:"CustomComponent",props:{style:{color:"#FFA657"}}},{content:"(",props:{style:{color:"#C9D1D9"}}},{content:"Component",props:{style:{color:"#79C0FF"}}},{content:"):",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:'"Custom Component"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" description ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:'"Use as a template to create your own component."',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" documentation: ",props:{style:{color:"#C9D1D9"}}},{content:"str ",props:{style:{color:"#79C0FF"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:'"http://docs.langflow.org/components/custom"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" icon ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:'"custom_components"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" name ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:'"CustomComponent"',props:{style:{color:"#A5D6FF"}}}]}],lang:"python"},annotations:[]}]}),"\n",(0,n.jsxs)(t.ol,{start:"5",children:["\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.strong,{children:"Specify Inputs and Outputs"}),": Use Langflow's input and output classes to define the inputs and outputs of your component. They should be declared as class attributes."]}),"\n"]}),"\n",(0,n.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:" inputs ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" [",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" MessageTextInput(",props:{style:{color:"#C9D1D9"}}},{content:"name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"input_value"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Input Value"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"value",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Hello, World!"',props:{style:{color:"#A5D6FF"}}},{content:"),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ]",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" outputs ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" [",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" Output(",props:{style:{color:"#C9D1D9"}}},{content:"display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Output"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"output"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"method",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"build_output"',props:{style:{color:"#A5D6FF"}}},{content:"),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ]",props:{style:{color:"#C9D1D9"}}}]}],lang:"python"},annotations:[]}]}),"\n",(0,n.jsxs)(t.ol,{start:"6",children:["\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.strong,{children:"Implement Output Methods"}),": Implement\xa0methods for each output, which contains the logic of your component. These methods can access input values using\xa0",(0,n.jsx)(t.code,{children:"self."})," , return processed values and define what to be displayed in the component with the\xa0",(0,n.jsx)(t.code,{children:"self.status"}),"\xa0attribute."]}),"\n"]}),"\n",(0,n.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:" def ",props:{style:{color:"#FF7B72"}}},{content:"build_output",props:{style:{color:"#D2A8FF"}}},{content:"(self) -> Data:",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" data ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" Data(",props:{style:{color:"#C9D1D9"}}},{content:"value",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"self",props:{style:{color:"#79C0FF"}}},{content:".input_value)",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" self",props:{style:{color:"#79C0FF"}}},{content:".status ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" data",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" return",props:{style:{color:"#FF7B72"}}},{content:" data",props:{style:{color:"#C9D1D9"}}}]}],lang:"python"},annotations:[]}]}),"\n",(0,n.jsxs)(t.ol,{start:"7",children:["\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.strong,{children:"Use Proper Annotations"}),": Ensure that output methods are properly annotated with their types. Langflow uses these annotations to validate and handle data correctly. For example, this method is annotated to output ",(0,n.jsx)(t.code,{children:"Data"}),"."]}),"\n"]}),"\n",(0,n.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:" def ",props:{style:{color:"#FF7B72"}}},{content:"build_output",props:{style:{color:"#D2A8FF"}}},{content:"(self) -> Data:",props:{style:{color:"#C9D1D9"}}}]}],lang:"python"},annotations:[]}]}),"\n",(0,n.jsxs)(t.ol,{start:"8",children:["\n",(0,n.jsxs)(t.li,{children:["Click ",(0,n.jsx)(t.strong,{children:"Check & Save"})," to confirm your component works.\nYou now have an operational custom component."]}),"\n"]}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{src:e(2224).A+"",width:"1984",height:"1116"})}),"\n",(0,n.jsx)(t.h2,{id:"add-inputs-and-modify-output-methods",children:"Add inputs and modify output methods"}),"\n",(0,n.jsx)(t.p,{children:"This code defines a custom component that accepts 5 inputs and outputs a Message."}),"\n",(0,n.jsxs)(t.p,{children:["Copy and paste it into the Custom Component code pane and click ",(0,n.jsx)(t.strong,{children:"Check & Save."})]}),"\n",(0,n.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"from",props:{style:{color:"#FF7B72"}}},{content:" langflow.custom ",props:{style:{color:"#C9D1D9"}}},{content:"import",props:{style:{color:"#FF7B72"}}},{content:" Component",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"from",props:{style:{color:"#FF7B72"}}},{content:" langflow.inputs ",props:{style:{color:"#C9D1D9"}}},{content:"import",props:{style:{color:"#FF7B72"}}},{content:" StrInput, MultilineInput, SecretStrInput, IntInput, DropdownInput",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"from",props:{style:{color:"#FF7B72"}}},{content:" langflow.template ",props:{style:{color:"#C9D1D9"}}},{content:"import",props:{style:{color:"#FF7B72"}}},{content:" Output, Input",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"from",props:{style:{color:"#FF7B72"}}},{content:" langflow.schema.message ",props:{style:{color:"#C9D1D9"}}},{content:"import",props:{style:{color:"#FF7B72"}}},{content:" Message",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"class ",props:{style:{color:"#FF7B72"}}},{content:"MyCustomComponent",props:{style:{color:"#FFA657"}}},{content:"(",props:{style:{color:"#C9D1D9"}}},{content:"Component",props:{style:{color:"#79C0FF"}}},{content:"):",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:'"My Custom Component"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" description ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:'"An example of a custom component with various input types."',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" inputs ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" [",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" StrInput(",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"username"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Username"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" info",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Enter your username."',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" ),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" SecretStrInput(",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"password"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Password"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" info",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Enter your password."',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" ),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" MessageTextInput(",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"special_message"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"special_message"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" info",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Enter a special message."',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" IntInput(",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"age"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Age"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" info",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Enter your age."',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" ),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" DropdownInput(",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"gender"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Gender"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" options",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"[",props:{style:{color:"#C9D1D9"}}},{content:'"Male"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"Female"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:'"Other"',props:{style:{color:"#A5D6FF"}}},{content:"],",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" info",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Select your gender."',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" )",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ]",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" outputs ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" [",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" Output(",props:{style:{color:"#C9D1D9"}}},{content:"display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Result"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"result"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"method",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"process_inputs"',props:{style:{color:"#A5D6FF"}}},{content:"),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ]",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" def ",props:{style:{color:"#FF7B72"}}},{content:"process_inputs",props:{style:{color:"#D2A8FF"}}},{content:"(self) -> Message:",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' """',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" Process the user inputs and return a Message object.",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" Returns:",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" Message: A Message object containing the processed information.",props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:' """',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" try",props:{style:{color:"#FF7B72"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" processed_text ",props:{style:{color:"#C9D1D9"}}},{content:"= f",props:{style:{color:"#FF7B72"}}},{content:'"User ',props:{style:{color:"#A5D6FF"}}},{content:"{self",props:{style:{color:"#79C0FF"}}},{content:".username",props:{style:{color:"#C9D1D9"}}},{content:"}",props:{style:{color:"#79C0FF"}}},{content:" (Age: ",props:{style:{color:"#A5D6FF"}}},{content:"{self",props:{style:{color:"#79C0FF"}}},{content:".age",props:{style:{color:"#C9D1D9"}}},{content:"}",props:{style:{color:"#79C0FF"}}},{content:", Gender: ",props:{style:{color:"#A5D6FF"}}},{content:"{self",props:{style:{color:"#79C0FF"}}},{content:".gender",props:{style:{color:"#C9D1D9"}}},{content:"}",props:{style:{color:"#79C0FF"}}},{content:') "',props:{style:{color:"#A5D6FF"}}},{content:" \\",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" f",props:{style:{color:"#FF7B72"}}},{content:'"sent the following special message: ',props:{style:{color:"#A5D6FF"}}},{content:"{self",props:{style:{color:"#79C0FF"}}},{content:".special_message",props:{style:{color:"#C9D1D9"}}},{content:"}",props:{style:{color:"#79C0FF"}}},{content:'"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" return",props:{style:{color:"#FF7B72"}}},{content:" Message(",props:{style:{color:"#C9D1D9"}}},{content:"text",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"processed_text)",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" except ",props:{style:{color:"#FF7B72"}}},{content:"AttributeError ",props:{style:{color:"#79C0FF"}}},{content:"as",props:{style:{color:"#FF7B72"}}},{content:" e:",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" return",props:{style:{color:"#FF7B72"}}},{content:" Message(",props:{style:{color:"#C9D1D9"}}},{content:"text",props:{style:{color:"#FFA657"}}},{content:"=f",props:{style:{color:"#FF7B72"}}},{content:'"Error processing inputs: ',props:{style:{color:"#A5D6FF"}}},{content:"{str",props:{style:{color:"#79C0FF"}}},{content:"(e)",props:{style:{color:"#C9D1D9"}}},{content:"}",props:{style:{color:"#79C0FF"}}},{content:'"',props:{style:{color:"#A5D6FF"}}},{content:")",props:{style:{color:"#C9D1D9"}}}]}],lang:"python"},annotations:[]}]}),"\n",(0,n.jsxs)(t.p,{children:["Since the component outputs a ",(0,n.jsx)(t.code,{children:"Message"}),", you can wire it into a chat and pass messages to yourself."]}),"\n",(0,n.jsxs)(t.p,{children:["Your Custom Component accepts the Chat Input message through ",(0,n.jsx)(t.code,{children:"MessageTextInput"}),", fills in the variables with the ",(0,n.jsx)(t.code,{children:"process_inputs"})," method, and finally passes the message ",(0,n.jsx)(t.code,{children:"User Username (Age: 49, Gender: Male) sent the following special message: Hello!"})," to Chat Output."]}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{src:e(8211).A+"",width:"2662",height:"1394"})}),"\n",(0,n.jsx)(t.p,{children:"By defining inputs this way, Langflow can automatically handle the validation and display of these fields in the user interface, making it easier to create robust and user-friendly custom components."}),"\n",(0,n.jsxs)(t.p,{children:["All of the types detailed above derive from a general class that can also be accessed through the generic\xa0",(0,n.jsx)(t.code,{children:"Input"}),"\xa0class."]}),"\n",(0,n.jsx)(t.admonition,{type:"tip",children:(0,n.jsxs)(t.p,{children:["Use ",(0,n.jsx)(t.code,{children:"MessageInput"})," to get the entire Message object instead of just the text."]})}),"\n",(0,n.jsx)(t.h2,{id:"3815589831f24ab792328ed233c8b00d",children:"Input Types"}),"\n",(0,n.jsx)(t.hr,{}),"\n",(0,n.jsx)(t.p,{children:"Langflow provides several higher-level input types to simplify the creation of custom components. These input types standardize how inputs are defined, validated, and used. Here\u2019s a guide on how to use these inputs and their primary purposes:"}),"\n",(0,n.jsx)(t.h3,{id:"fb06c48a326043ffa46badc1ab3ba467",children:(0,n.jsx)(t.strong,{children:"HandleInput"})}),"\n",(0,n.jsxs)(t.p,{children:["Represents an input that has a handle to a specific type (e.g.,\xa0",(0,n.jsx)(t.code,{children:"BaseLanguageModel"}),",\xa0",(0,n.jsx)(t.code,{children:"BaseRetriever"}),", etc.)."]}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.strong,{children:"Usage:"}),"\xa0Useful for connecting to specific component types in a flow."]}),"\n"]}),"\n",(0,n.jsx)(t.h3,{id:"0e1dcb768e38487180d720b0884a90f5",children:(0,n.jsx)(t.strong,{children:"DataInput"})}),"\n",(0,n.jsxs)(t.p,{children:["Represents an input that receives a\xa0",(0,n.jsx)(t.code,{children:"Data"}),"\xa0object."]}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.strong,{children:"Usage:"}),"\xa0Ideal for components that process or manipulate data objects."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.strong,{children:"Input Types:"}),"\xa0",(0,n.jsx)(t.code,{children:'["Data"]'})]}),"\n"]}),"\n",(0,n.jsx)(t.h3,{id:"4ec6e68ad9ab4cd194e8e607bc5b3411",children:(0,n.jsx)(t.strong,{children:"StrInput"})}),"\n",(0,n.jsx)(t.p,{children:"Represents a standard string input field."}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.strong,{children:"Usage:"}),"\xa0Used for any text input where the user needs to provide a string."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.strong,{children:"Input Types:"}),"\xa0",(0,n.jsx)(t.code,{children:'["Text"]'})]}),"\n"]}),"\n",(0,n.jsx)(t.h3,{id:"9292ac0105e14177af5eff2131b9c71b",children:(0,n.jsx)(t.strong,{children:"MessageInput"})}),"\n",(0,n.jsxs)(t.p,{children:["Represents an input field specifically for\xa0",(0,n.jsx)(t.code,{children:"Message"}),"\xa0objects."]}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.strong,{children:"Usage:"}),"\xa0Used in components that handle or process messages."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.strong,{children:"Input Types:"}),"\xa0",(0,n.jsx)(t.code,{children:'["Message"]'})]}),"\n"]}),"\n",(0,n.jsx)(t.h3,{id:"5511f5e32b944b4e973379a6bd5405e4",children:(0,n.jsx)(t.strong,{children:"MessageTextInput"})}),"\n",(0,n.jsx)(t.p,{children:"Represents a text input for messages."}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.strong,{children:"Usage:"}),"\xa0Suitable for components that need to extract text from message objects."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.strong,{children:"Input Types:"}),"\xa0",(0,n.jsx)(t.code,{children:'["Message"]'})]}),"\n"]}),"\n",(0,n.jsx)(t.h3,{id:"e6d8315b0fb44a2fb8c62c3f3184bbe9",children:(0,n.jsx)(t.strong,{children:"MultilineInput"})}),"\n",(0,n.jsx)(t.p,{children:"Represents a text field that supports multiple lines."}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.strong,{children:"Usage:"}),"\xa0Ideal for longer text inputs where the user might need to write extended text."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.strong,{children:"Input Types:"}),"\xa0",(0,n.jsx)(t.code,{children:'["Text"]'})]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.strong,{children:"Attributes:"}),"\xa0",(0,n.jsx)(t.code,{children:"multiline=True"})]}),"\n"]}),"\n",(0,n.jsx)(t.h3,{id:"2283c13aa5f745b8b0009f7d40e59419",children:(0,n.jsx)(t.strong,{children:"SecretStrInput"})}),"\n",(0,n.jsx)(t.p,{children:"Represents a password input field."}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.strong,{children:"Usage:"}),"\xa0Used for sensitive text inputs where the input should be hidden (e.g., passwords, API keys)."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.strong,{children:"Attributes:"}),"\xa0",(0,n.jsx)(t.code,{children:"password=True"})]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.strong,{children:"Input Types:"}),"\xa0Does not accept input types, meaning it has no input handles for previous nodes/components to connect to it."]}),"\n"]}),"\n",(0,n.jsx)(t.h3,{id:"612680db6578451daef695bd19827a56",children:(0,n.jsx)(t.strong,{children:"IntInput"})}),"\n",(0,n.jsx)(t.p,{children:"Represents an integer input field."}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.strong,{children:"Usage:"}),"\xa0Used for numeric inputs where the value should be an integer."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.strong,{children:"Input Types:"}),"\xa0",(0,n.jsx)(t.code,{children:'["Integer"]'})]}),"\n"]}),"\n",(0,n.jsx)(t.h3,{id:"a15e1fdae15b49fc9bfbf38f8bd7b203",children:(0,n.jsx)(t.strong,{children:"FloatInput"})}),"\n",(0,n.jsx)(t.p,{children:"Represents a float input field."}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.strong,{children:"Usage:"}),"\xa0Used for numeric inputs where the value should be a floating-point number."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.strong,{children:"Input Types:"}),"\xa0",(0,n.jsx)(t.code,{children:'["Float"]'})]}),"\n"]}),"\n",(0,n.jsx)(t.h3,{id:"3083671e0e7f4390a03396485114be66",children:(0,n.jsx)(t.strong,{children:"BoolInput"})}),"\n",(0,n.jsx)(t.p,{children:"Represents a boolean input field."}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.strong,{children:"Usage:"}),"\xa0Used for true/false or yes/no type inputs."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.strong,{children:"Input Types:"}),"\xa0",(0,n.jsx)(t.code,{children:'["Boolean"]'})]}),"\n"]}),"\n",(0,n.jsx)(t.h3,{id:"2866fc4018e743d8a45afde53f1e57be",children:(0,n.jsx)(t.strong,{children:"NestedDictInput"})}),"\n",(0,n.jsx)(t.p,{children:"Represents an input field for nested dictionaries."}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.strong,{children:"Usage:"}),"\xa0Used for more complex data structures where the input needs to be a dictionary."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.strong,{children:"Input Types:"}),"\xa0",(0,n.jsx)(t.code,{children:'["NestedDict"]'})]}),"\n"]}),"\n",(0,n.jsx)(t.h3,{id:"daa2c2398f694ec199b425e2ed4bcf93",children:(0,n.jsx)(t.strong,{children:"DictInput"})}),"\n",(0,n.jsx)(t.p,{children:"Represents an input field for dictionaries."}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.strong,{children:"Usage:"}),"\xa0Suitable for inputs that require a dictionary format."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.strong,{children:"Input Types:"}),"\xa0",(0,n.jsx)(t.code,{children:'["Dict"]'})]}),"\n"]}),"\n",(0,n.jsx)(t.h3,{id:"14dcdef11bab4d3f8127eaf2e36a77b9",children:(0,n.jsx)(t.strong,{children:"DropdownInput"})}),"\n",(0,n.jsx)(t.p,{children:"Represents a dropdown input field."}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.strong,{children:"Usage:"}),"\xa0Used where the user needs to select from a predefined list of options."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.strong,{children:"Attributes:"}),"\xa0",(0,n.jsx)(t.code,{children:"options"}),"\xa0to define the list of selectable options."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.strong,{children:"Input Types:"}),"\xa0",(0,n.jsx)(t.code,{children:'["Text"]'})]}),"\n"]}),"\n",(0,n.jsx)(t.h3,{id:"73e6377dc5f446f39517a558a1291410",children:(0,n.jsx)(t.strong,{children:"FileInput"})}),"\n",(0,n.jsx)(t.p,{children:"Represents a file input field."}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.strong,{children:"Usage:"}),"\xa0Used to upload files."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.strong,{children:"Attributes:"}),"\xa0",(0,n.jsx)(t.code,{children:"file_types"}),"\xa0to specify the types of files that can be uploaded."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.strong,{children:"Input Types:"}),"\xa0",(0,n.jsx)(t.code,{children:'["File"]'})]}),"\n"]}),"\n",(0,n.jsx)(t.h3,{id:"278e2027493e45b68746af0a5b6c06f6",children:"Generic Input"}),"\n",(0,n.jsx)(t.hr,{}),"\n",(0,n.jsxs)(t.p,{children:["Langflow offers native input types, but you can use any type as long as they are properly annotated in the output methods (e.g.,\xa0",(0,n.jsx)(t.code,{children:"-> list[int]"}),")."]}),"\n",(0,n.jsxs)(t.p,{children:["The\xa0",(0,n.jsx)(t.code,{children:"Input"}),"\xa0class is highly customizable, allowing you to specify a wide range of attributes for each input field. It has several attributes that can be customized:"]}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"field_type"}),": Specifies the type of field (e.g.,\xa0",(0,n.jsx)(t.code,{children:"str"}),",\xa0",(0,n.jsx)(t.code,{children:"int"}),"). Default is\xa0",(0,n.jsx)(t.code,{children:"str"}),"."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"required"}),": Boolean indicating if the field is required. Default is\xa0",(0,n.jsx)(t.code,{children:"False"}),"."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"placeholder"}),": Placeholder text for the input field. Default is an empty string."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"is_list"}),": Boolean indicating if the field should accept a list of values. Default is\xa0",(0,n.jsx)(t.code,{children:"False"}),"."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"show"}),": Boolean indicating if the field should be shown. Default is\xa0",(0,n.jsx)(t.code,{children:"True"}),"."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"multiline"}),": Boolean indicating if the field should allow multi-line input. Default is\xa0",(0,n.jsx)(t.code,{children:"False"}),"."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"value"}),": Default value for the input field. Default is\xa0",(0,n.jsx)(t.code,{children:"None"}),"."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"file_types"}),": List of accepted file types (for file inputs). Default is an empty list."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"file_path"}),": File path if the field is a file input. Default is\xa0",(0,n.jsx)(t.code,{children:"None"}),"."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"password"}),": Boolean indicating if the field is a password. Default is\xa0",(0,n.jsx)(t.code,{children:"False"}),"."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"options"}),": List of options for the field (for dropdowns). Default is\xa0",(0,n.jsx)(t.code,{children:"None"}),"."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"name"}),": Name of the input field. Default is\xa0",(0,n.jsx)(t.code,{children:"None"}),"."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"display_name"}),": Display name for the input field. Default is\xa0",(0,n.jsx)(t.code,{children:"None"}),"."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"advanced"}),": Boolean indicating if the field is an advanced parameter. Default is\xa0",(0,n.jsx)(t.code,{children:"False"}),"."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"input_types"}),": List of accepted input types. Default is\xa0",(0,n.jsx)(t.code,{children:"None"}),"."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"dynamic"}),": Boolean indicating if the field is dynamic. Default is\xa0",(0,n.jsx)(t.code,{children:"False"}),"."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"info"}),": Additional information or tooltip for the input field. Default is an empty string."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"real_time_refresh"}),": Boolean indicating if the field should refresh in real-time. Default is\xa0",(0,n.jsx)(t.code,{children:"None"}),"."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"refresh_button"}),": Boolean indicating if the field should have a refresh button. Default is\xa0",(0,n.jsx)(t.code,{children:"None"}),"."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"refresh_button_text"}),": Text for the refresh button. Default is\xa0",(0,n.jsx)(t.code,{children:"None"}),"."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"range_spec"}),": Range specification for numeric fields. Default is\xa0",(0,n.jsx)(t.code,{children:"None"}),"."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"load_from_db"}),": Boolean indicating if the field should load from the database. Default is\xa0",(0,n.jsx)(t.code,{children:"False"}),"."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"title_case"}),": Boolean indicating if the display name should be in title case. Default is\xa0",(0,n.jsx)(t.code,{children:"True"}),"."]}),"\n"]}),"\n",(0,n.jsx)(t.h2,{id:"create-a-custom-component-with-generic-input",children:"Create a Custom Component with Generic Input"}),"\n",(0,n.jsxs)(t.p,{children:["Here is an example of how to define inputs for a component using the\xa0",(0,n.jsx)(t.code,{children:"Input"}),"\xa0class."]}),"\n",(0,n.jsxs)(t.p,{children:["Copy and paste it into the Custom Component code pane and click ",(0,n.jsx)(t.strong,{children:"Check & Save."})]}),"\n",(0,n.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"from",props:{style:{color:"#FF7B72"}}},{content:" langflow.template ",props:{style:{color:"#C9D1D9"}}},{content:"import",props:{style:{color:"#FF7B72"}}},{content:" Input, Output",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"from",props:{style:{color:"#FF7B72"}}},{content:" langflow.custom ",props:{style:{color:"#C9D1D9"}}},{content:"import",props:{style:{color:"#FF7B72"}}},{content:" Component",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"from",props:{style:{color:"#FF7B72"}}},{content:" langflow.field_typing ",props:{style:{color:"#C9D1D9"}}},{content:"import",props:{style:{color:"#FF7B72"}}},{content:" Text",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"from",props:{style:{color:"#FF7B72"}}},{content:" langflow.schema.message ",props:{style:{color:"#C9D1D9"}}},{content:"import",props:{style:{color:"#FF7B72"}}},{content:" Message",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"from",props:{style:{color:"#FF7B72"}}},{content:" typing ",props:{style:{color:"#C9D1D9"}}},{content:"import",props:{style:{color:"#FF7B72"}}},{content:" Dict, Any",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"class ",props:{style:{color:"#FF7B72"}}},{content:"TextAnalyzerComponent",props:{style:{color:"#FFA657"}}},{content:"(",props:{style:{color:"#C9D1D9"}}},{content:"Component",props:{style:{color:"#79C0FF"}}},{content:"):",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:'"Text Analyzer"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" description ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:'"Analyzes input text and provides basic statistics."',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" inputs ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" [",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" Input(",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"input_text"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Input Text"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" field_type",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Message"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" required",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"True",props:{style:{color:"#79C0FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" placeholder",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Enter text to analyze"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" multiline",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"True",props:{style:{color:"#79C0FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" info",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"The text you want to analyze."',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" input_types",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"[",props:{style:{color:"#C9D1D9"}}},{content:'"Text"',props:{style:{color:"#A5D6FF"}}},{content:"]",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" Input(",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"include_word_count"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Include Word Count"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" field_type",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"bool"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" required",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"False",props:{style:{color:"#79C0FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" info",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Whether to include word count in the analysis."',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" Input(",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"perform_sentiment_analysis"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Perform Sentiment Analysis"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" field_type",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"bool"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" required",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"False",props:{style:{color:"#79C0FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" info",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Whether to perform basic sentiment analysis."',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ]",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" outputs ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" [",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" Output(",props:{style:{color:"#C9D1D9"}}},{content:"display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Analysis Results"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"results"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"method",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"analyze_text"',props:{style:{color:"#A5D6FF"}}},{content:"),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ]",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" def ",props:{style:{color:"#FF7B72"}}},{content:"analyze_text",props:{style:{color:"#D2A8FF"}}},{content:"(self) -> Message:",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" # Extract text from the Message object",props:{style:{color:"#8B949E"}}}]},{tokens:[{content:" if ",props:{style:{color:"#FF7B72"}}},{content:"isinstance",props:{style:{color:"#79C0FF"}}},{content:"(",props:{style:{color:"#C9D1D9"}}},{content:"self",props:{style:{color:"#79C0FF"}}},{content:".input_text, Message):",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" text ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:"self",props:{style:{color:"#79C0FF"}}},{content:".input_text.text",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" else",props:{style:{color:"#FF7B72"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" text ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:"str",props:{style:{color:"#79C0FF"}}},{content:"(",props:{style:{color:"#C9D1D9"}}},{content:"self",props:{style:{color:"#79C0FF"}}},{content:".input_text)",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" results ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" {",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "character_count"',props:{style:{color:"#A5D6FF"}}},{content:": ",props:{style:{color:"#C9D1D9"}}},{content:"len",props:{style:{color:"#79C0FF"}}},{content:"(text),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:' "sentence_count"',props:{style:{color:"#A5D6FF"}}},{content:": text.count(",props:{style:{color:"#C9D1D9"}}},{content:"'.'",props:{style:{color:"#A5D6FF"}}},{content:") ",props:{style:{color:"#C9D1D9"}}},{content:"+",props:{style:{color:"#FF7B72"}}},{content:" text.count(",props:{style:{color:"#C9D1D9"}}},{content:"'!'",props:{style:{color:"#A5D6FF"}}},{content:") ",props:{style:{color:"#C9D1D9"}}},{content:"+",props:{style:{color:"#FF7B72"}}},{content:" text.count(",props:{style:{color:"#C9D1D9"}}},{content:"'?'",props:{style:{color:"#A5D6FF"}}},{content:")",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" }",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" if ",props:{style:{color:"#FF7B72"}}},{content:"self",props:{style:{color:"#79C0FF"}}},{content:".include_word_count:",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" results[",props:{style:{color:"#C9D1D9"}}},{content:'"word_count"',props:{style:{color:"#A5D6FF"}}},{content:"] ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:"len",props:{style:{color:"#79C0FF"}}},{content:"(text.split())",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" if ",props:{style:{color:"#FF7B72"}}},{content:"self",props:{style:{color:"#79C0FF"}}},{content:".perform_sentiment_analysis:",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" # Basic sentiment analysis",props:{style:{color:"#8B949E"}}}]},{tokens:[{content:" text_lower ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" text.lower()",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" if ",props:{style:{color:"#FF7B72"}}},{content:'"happy" ',props:{style:{color:"#A5D6FF"}}},{content:"in",props:{style:{color:"#FF7B72"}}},{content:" text_lower ",props:{style:{color:"#C9D1D9"}}},{content:"or ",props:{style:{color:"#FF7B72"}}},{content:'"good" ',props:{style:{color:"#A5D6FF"}}},{content:"in",props:{style:{color:"#FF7B72"}}},{content:" text_lower:",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" sentiment ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:'"positive"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" elif ",props:{style:{color:"#FF7B72"}}},{content:'"sad" ',props:{style:{color:"#A5D6FF"}}},{content:"in",props:{style:{color:"#FF7B72"}}},{content:" text_lower ",props:{style:{color:"#C9D1D9"}}},{content:"or ",props:{style:{color:"#FF7B72"}}},{content:'"bad" ',props:{style:{color:"#A5D6FF"}}},{content:"in",props:{style:{color:"#FF7B72"}}},{content:" text_lower:",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" sentiment ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:'"negative"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" else",props:{style:{color:"#FF7B72"}}},{content:":",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" sentiment ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:'"neutral"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" results[",props:{style:{color:"#C9D1D9"}}},{content:'"sentiment"',props:{style:{color:"#A5D6FF"}}},{content:"] ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" sentiment",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" # Convert the results dictionary to a formatted string",props:{style:{color:"#8B949E"}}}]},{tokens:[{content:" formatted_results ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:'"',props:{style:{color:"#A5D6FF"}}},{content:"\\n",props:{style:{color:"#79C0FF"}}},{content:'"',props:{style:{color:"#A5D6FF"}}},{content:".join([",props:{style:{color:"#C9D1D9"}}},{content:"f",props:{style:{color:"#FF7B72"}}},{content:'"',props:{style:{color:"#A5D6FF"}}},{content:"{",props:{style:{color:"#79C0FF"}}},{content:"key",props:{style:{color:"#C9D1D9"}}},{content:"}",props:{style:{color:"#79C0FF"}}},{content:": ",props:{style:{color:"#A5D6FF"}}},{content:"{",props:{style:{color:"#79C0FF"}}},{content:"value",props:{style:{color:"#C9D1D9"}}},{content:"}",props:{style:{color:"#79C0FF"}}},{content:'" ',props:{style:{color:"#A5D6FF"}}},{content:"for",props:{style:{color:"#FF7B72"}}},{content:" key, value ",props:{style:{color:"#C9D1D9"}}},{content:"in",props:{style:{color:"#FF7B72"}}},{content:" results.items()])",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" # Return a Message object",props:{style:{color:"#8B949E"}}}]},{tokens:[{content:" return",props:{style:{color:"#FF7B72"}}},{content:" Message(",props:{style:{color:"#C9D1D9"}}},{content:"text",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:"formatted_results)",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"# Define how to use the inputs and outputs",props:{style:{color:"#8B949E"}}}]},{tokens:[{content:"component ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" TextAnalyzerComponent()",props:{style:{color:"#C9D1D9"}}}]}],lang:"python"},annotations:[]}]}),"\n",(0,n.jsx)(t.p,{children:"In this custom component:"}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsxs)(t.li,{children:["\n",(0,n.jsxs)(t.p,{children:["The ",(0,n.jsx)(t.code,{children:"input_text"})," input is a required multi-line text field that accepts a Message object or a string. It's used to provide the text for analysis."]}),"\n"]}),"\n",(0,n.jsxs)(t.li,{children:["\n",(0,n.jsxs)(t.p,{children:["The ",(0,n.jsx)(t.code,{children:"include_word_count"})," input is an optional boolean field. When set to True, it adds a word count to the analysis results."]}),"\n"]}),"\n",(0,n.jsxs)(t.li,{children:["\n",(0,n.jsxs)(t.p,{children:["The ",(0,n.jsx)(t.code,{children:"perform_sentiment_analysis"})," input is an optional boolean field. When set to True, it triggers a basic sentiment analysis of the input text."]}),"\n"]}),"\n"]}),"\n",(0,n.jsx)(t.p,{children:"The component performs basic text analysis, including character count and sentence count (based on punctuation marks). If word count is enabled, it splits the text and counts the words. If sentiment analysis is enabled, it performs a simple keyword-based sentiment classification (positive, negative, or neutral)."}),"\n",(0,n.jsxs)(t.p,{children:["Since the component inputs and outputs a ",(0,n.jsx)(t.code,{children:"Message"}),", you can wire the component into a chat and see how the basic custom component logic interacts with your input."]}),"\n",(0,n.jsx)(t.p,{children:(0,n.jsx)(t.img,{src:e(9807).A+"",width:"2422",height:"882"})}),"\n",(0,n.jsx)(t.h2,{id:"6f225be8a142450aa19ee8e46a3b3c8c",children:"Create a Custom Component with Multiple Outputs"}),"\n",(0,n.jsx)(t.hr,{}),"\n",(0,n.jsx)(t.p,{children:"In Langflow, custom components can have multiple outputs. Each output can be associated with a specific method in the component, allowing you to define distinct behaviors for each output path. This feature is particularly useful when you want to route data based on certain conditions or process it in multiple ways."}),"\n",(0,n.jsxs)(t.ol,{children:["\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.strong,{children:"Definition of Outputs"}),": Each output is defined in the\xa0",(0,n.jsx)(t.code,{children:"outputs"}),"\xa0list of the component. Each output is associated with a display name, an internal name, and a method that gets called to generate the output."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.strong,{children:"Output Methods"}),": The methods associated with outputs are responsible for generating the data for that particular output. These methods are called when the component is executed, and each method can independently produce its result."]}),"\n"]}),"\n",(0,n.jsx)(t.p,{children:"This example component has two outputs:"}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"process_data"}),": Processes the input text (e.g., converts it to uppercase) and returns it."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"get_processing_function"}),": Returns the\xa0",(0,n.jsx)(t.code,{children:"process_data"}),"\xa0method itself to be reused in composition."]}),"\n"]}),"\n",(0,n.jsx)(a.Code,{codeConfig:d,northPanel:{tabs:[""],active:"",heightRatio:1},files:[{name:"",focus:"",code:{lines:[{tokens:[{content:"from",props:{style:{color:"#FF7B72"}}},{content:" typing ",props:{style:{color:"#C9D1D9"}}},{content:"import",props:{style:{color:"#FF7B72"}}},{content:" Callable",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"from",props:{style:{color:"#FF7B72"}}},{content:" langflow.custom ",props:{style:{color:"#C9D1D9"}}},{content:"import",props:{style:{color:"#FF7B72"}}},{content:" Component",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"from",props:{style:{color:"#FF7B72"}}},{content:" langflow.inputs ",props:{style:{color:"#C9D1D9"}}},{content:"import",props:{style:{color:"#FF7B72"}}},{content:" StrInput",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"from",props:{style:{color:"#FF7B72"}}},{content:" langflow.template ",props:{style:{color:"#C9D1D9"}}},{content:"import",props:{style:{color:"#FF7B72"}}},{content:" Output",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"from",props:{style:{color:"#FF7B72"}}},{content:" langflow.field_typing ",props:{style:{color:"#C9D1D9"}}},{content:"import",props:{style:{color:"#FF7B72"}}},{content:" Text",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"class ",props:{style:{color:"#FF7B72"}}},{content:"DualOutputComponent",props:{style:{color:"#FFA657"}}},{content:"(",props:{style:{color:"#C9D1D9"}}},{content:"Component",props:{style:{color:"#79C0FF"}}},{content:"):",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:'"Dual Output"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" description ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:'"Processes input text and returns both the result and the processing function."',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:" icon ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:'"double-arrow"',props:{style:{color:"#A5D6FF"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" inputs ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" [",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" StrInput(",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"input_text"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Input Text"',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" info",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"The text input to be processed."',props:{style:{color:"#A5D6FF"}}},{content:",",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ]",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" outputs ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" [",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" Output(",props:{style:{color:"#C9D1D9"}}},{content:"display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Processed Data"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"processed_data"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"method",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"process_data"',props:{style:{color:"#A5D6FF"}}},{content:"),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" Output(",props:{style:{color:"#C9D1D9"}}},{content:"display_name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"Processing Function"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"name",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"processing_function"',props:{style:{color:"#A5D6FF"}}},{content:", ",props:{style:{color:"#C9D1D9"}}},{content:"method",props:{style:{color:"#FFA657"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:'"get_processing_function"',props:{style:{color:"#A5D6FF"}}},{content:"),",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" ]",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" def ",props:{style:{color:"#FF7B72"}}},{content:"process_data",props:{style:{color:"#D2A8FF"}}},{content:"(self) -> Text:",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" # Process the input text (e.g., convert to uppercase)",props:{style:{color:"#8B949E"}}}]},{tokens:[{content:" processed ",props:{style:{color:"#C9D1D9"}}},{content:"= ",props:{style:{color:"#FF7B72"}}},{content:"self",props:{style:{color:"#79C0FF"}}},{content:".input_text.upper()",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" self",props:{style:{color:"#79C0FF"}}},{content:".status ",props:{style:{color:"#C9D1D9"}}},{content:"=",props:{style:{color:"#FF7B72"}}},{content:" processed",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" return",props:{style:{color:"#FF7B72"}}},{content:" processed",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:"",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" def ",props:{style:{color:"#FF7B72"}}},{content:"get_processing_function",props:{style:{color:"#D2A8FF"}}},{content:"(self) -> Callable[[], Text]:",props:{style:{color:"#C9D1D9"}}}]},{tokens:[{content:" # Return the processing function itself",props:{style:{color:"#8B949E"}}}]},{tokens:[{content:" return ",props:{style:{color:"#FF7B72"}}},{content:"self",props:{style:{color:"#79C0FF"}}},{content:".process_data",props:{style:{color:"#C9D1D9"}}}]}],lang:"python"},annotations:[]}]}),"\n",(0,n.jsx)(t.p,{children:"This example shows how to define multiple outputs in a custom component. The first output returns the processed data, while the second output returns the processing function itself."}),"\n",(0,n.jsxs)(t.p,{children:["The\xa0",(0,n.jsx)(t.code,{children:"processing_function"}),"\xa0output can be used in scenarios where the function itself is needed for further processing or dynamic flow control. Notice how both outputs are properly annotated with their respective types, ensuring clarity and type safety."]}),"\n",(0,n.jsx)(t.h2,{id:"special-operations",children:"Special Operations"}),"\n",(0,n.jsx)(t.p,{children:"Advanced methods and attributes offer additional control and functionality. Understanding how to leverage these can enhance your custom components' capabilities."}),"\n",(0,n.jsxs)(t.ul,{children:["\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"self.inputs"}),": Access all defined inputs. Useful when an output method needs to interact with multiple inputs."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"self.outputs"}),": Access all defined outputs. This is particularly useful if an output function needs to trigger another output function."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"self.status"}),": Use this to update the component's status or intermediate results. It helps track the component's internal state or store temporary data."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:"self.graph.flow_id"}),": Retrieve the flow ID, useful for maintaining context or debugging."]}),"\n",(0,n.jsxs)(t.li,{children:[(0,n.jsx)(t.code,{children:'self.stop("output_name")'}),": Use this method within an output function to prevent data from being sent through other components. This method stops next component execution and is particularly useful for specific operations where a component should stop from running based on specific conditions."]}),"\n"]}),"\n",(0,n.jsx)(t.h2,{id:"contribute-custom-components-to-langflow",children:"Contribute Custom Components to Langflow"}),"\n",(0,n.jsxs)(t.p,{children:["See ",(0,n.jsx)(t.a,{href:"/contributing-how-to-contribute#submitting-components",children:"How to Contribute"})," to contribute your custom component to Langflow."]})]})}function u(o={}){const{wrapper:t}={...(0,s.R)(),...o.components};return t?(0,n.jsx)(t,{...o,children:(0,n.jsx)(F,{...o})}):F(o)}function h(o,t){throw new Error("Expected "+(t?"component":"object")+" `"+o+"` to be defined: you likely forgot to import, pass, or provide it.")}},2224:(o,t,e)=>{e.d(t,{A:()=>n});const n=e.p+"assets/images/238089171-8512eacd66ef57e59756d6863fc38afd.png"},8211:(o,t,e)=>{e.d(t,{A:()=>n});const n=e.p+"assets/images/custom-component-chat-d0dfdbf518bf952bea86568d55cda744.png"},9807:(o,t,e)=>{e.d(t,{A:()=>n});const n=e.p+"assets/images/custom-component-inputs-chat-f737c3b81c6cc0bbccd9ff8f108322a2.png"}}]); \ No newline at end of file diff --git a/assets/js/runtime~main.f8f02707.js b/assets/js/runtime~main.b6d60a90.js similarity index 97% rename from assets/js/runtime~main.f8f02707.js rename to assets/js/runtime~main.b6d60a90.js index 83e9d132b1..0370598d6c 100644 --- a/assets/js/runtime~main.f8f02707.js +++ b/assets/js/runtime~main.b6d60a90.js @@ -1 +1 @@ -(()=>{"use strict";var e,a,r,c,t,d={},f={};function b(e){var a=f[e];if(void 0!==a)return a.exports;var r=f[e]={id:e,loaded:!1,exports:{}};return d[e].call(r.exports,r,r.exports,b),r.loaded=!0,r.exports}b.m=d,b.c=f,e=[],b.O=(a,r,c,t)=>{if(!r){var d=1/0;for(n=0;n=t)&&Object.keys(b.O).every((e=>b.O[e](r[o])))?r.splice(o--,1):(f=!1,t0&&e[n-1][2]>t;n--)e[n]=e[n-1];e[n]=[r,c,t]},b.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return b.d(a,{a:a}),a},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,b.t=function(e,c){if(1&c&&(e=this(e)),8&c)return e;if("object"==typeof e&&e){if(4&c&&e.__esModule)return e;if(16&c&&"function"==typeof e.then)return e}var t=Object.create(null);b.r(t);var d={};a=a||[null,r({}),r([]),r(r)];for(var f=2&c&&e;"object"==typeof f&&!~a.indexOf(f);f=r(f))Object.getOwnPropertyNames(f).forEach((a=>d[a]=()=>e[a]));return d.default=()=>e,b.d(t,d),t},b.d=(e,a)=>{for(var r in a)b.o(a,r)&&!b.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:a[r]})},b.f={},b.e=e=>Promise.all(Object.keys(b.f).reduce(((a,r)=>(b.f[r](e,a),a)),[])),b.u=e=>"assets/js/"+({144:"e2a386ca",145:"0be1d5fe",784:"fe965b62",804:"7fcd30b6",868:"dc7b1ef3",1039:"16d61ab3",1227:"647965d5",1246:"1b523369",1456:"ecd98ae0",1563:"3ef76b56",1567:"22dd74f7",1917:"c3616f7f",2005:"0575dfc8",2042:"reactPlayerTwitch",2431:"c0d3c6ab",2657:"a3ab51d1",2691:"2efb9d3a",2723:"reactPlayerMux",3392:"reactPlayerVidyard",3659:"4618a71f",4028:"c2ebd62a",4046:"9ac856ad",4058:"ccff95c4",4133:"5cf11f26",5527:"9e7a34ba",5562:"20e9af62",5572:"873ebc27",5628:"a83bc7c0",5664:"36970916",5742:"aba21aa0",5772:"f66238ae",6008:"445668ec",6147:"ab17fe15",6173:"reactPlayerVimeo",6328:"reactPlayerDailyMotion",6353:"reactPlayerPreview",6463:"reactPlayerKaltura",6494:"b453f7b0",6677:"2f617b24",6887:"reactPlayerFacebook",6900:"3f8193f3",7098:"a7bd4aaa",7211:"cacdc615",7258:"11478de3",7338:"c39b795e",7408:"3ae94ad4",7453:"fdefa9a8",7458:"reactPlayerFilePlayer",7462:"921b5fc1",7570:"reactPlayerMixcloud",7627:"reactPlayerStreamable",8031:"25bf2d67",8054:"85112c90",8127:"53ed7db4",8183:"d59b5b70",8261:"474d53cd",8401:"17896441",8446:"reactPlayerYouTube",8598:"44dfcf75",8929:"172b3cfb",8953:"adef6868",9048:"a94703ab",9126:"ea3c040a",9304:"c329cc2b",9340:"reactPlayerWistia",9455:"54175a6c",9461:"23d0e682",9580:"f81a91eb",9642:"eae80ce0",9647:"5e95c892",9979:"reactPlayerSoundCloud"}[e]||e)+"."+{144:"7e8e09aa",145:"4524db73",784:"bf3c3b32",804:"052d3ec1",868:"d7c01dec",900:"cec9b91d",1039:"6b5d9275",1227:"f67bd117",1246:"9ab26cae",1456:"e5056aaa",1563:"19a1df84",1567:"9e01eda7",1917:"66691f62",2005:"e2f00246",2042:"38dd7b7d",2237:"4bb44bc4",2431:"0df77f03",2657:"8e67cffa",2691:"c7804f19",2723:"8f6391ba",3392:"cb42cdfc",3554:"c7291073",3659:"65567128",4028:"4c8ebf9d",4046:"0b7c5218",4058:"9c31c71d",4133:"26322936",5527:"c924b445",5562:"8d63ec91",5572:"9f836f52",5628:"707c1b67",5664:"46db89cf",5742:"7728a8b8",5772:"84317656",6008:"5070ebd4",6147:"3f45eb86",6173:"291c2909",6328:"f614ee4c",6353:"8cd2b61f",6463:"8e37235b",6494:"404054b3",6677:"6a39e3b4",6887:"a60ee927",6900:"ed789b0e",7098:"71beb8e2",7211:"69ff3bb2",7258:"a5274620",7338:"894a81dc",7408:"8c54d710",7453:"cc4cfb89",7458:"c0e08054",7462:"8828b31d",7570:"34c84b39",7627:"b6323134",8031:"9469dd38",8054:"2d20ecfb",8127:"7f91271f",8183:"7baaad08",8261:"4737b75e",8401:"2ed86b26",8446:"a89f408c",8598:"44362993",8929:"e136d1f2",8953:"b34482be",9048:"38aef81a",9126:"5122becc",9304:"db4c4794",9340:"7f514310",9455:"77251598",9461:"f73e4482",9580:"77eb4862",9642:"b1d36097",9647:"8641e05b",9979:"9ddea34f"}[e]+".js",b.miniCssF=e=>{},b.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),b.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),c={},t="langflow-docs:",b.l=(e,a,r,d)=>{if(c[e])c[e].push(a);else{var f,o;if(void 0!==r)for(var l=document.getElementsByTagName("script"),n=0;n{f.onerror=f.onload=null,clearTimeout(s);var t=c[e];if(delete c[e],f.parentNode&&f.parentNode.removeChild(f),t&&t.forEach((e=>e(r))),a)return a(r)},s=setTimeout(u.bind(null,void 0,{type:"timeout",target:f}),12e4);f.onerror=u.bind(null,f.onerror),f.onload=u.bind(null,f.onload),o&&document.head.appendChild(f)}},b.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},b.p="/",b.gca=function(e){return e={17896441:"8401",36970916:"5664",e2a386ca:"144","0be1d5fe":"145",fe965b62:"784","7fcd30b6":"804",dc7b1ef3:"868","16d61ab3":"1039","647965d5":"1227","1b523369":"1246",ecd98ae0:"1456","3ef76b56":"1563","22dd74f7":"1567",c3616f7f:"1917","0575dfc8":"2005",reactPlayerTwitch:"2042",c0d3c6ab:"2431",a3ab51d1:"2657","2efb9d3a":"2691",reactPlayerMux:"2723",reactPlayerVidyard:"3392","4618a71f":"3659",c2ebd62a:"4028","9ac856ad":"4046",ccff95c4:"4058","5cf11f26":"4133","9e7a34ba":"5527","20e9af62":"5562","873ebc27":"5572",a83bc7c0:"5628",aba21aa0:"5742",f66238ae:"5772","445668ec":"6008",ab17fe15:"6147",reactPlayerVimeo:"6173",reactPlayerDailyMotion:"6328",reactPlayerPreview:"6353",reactPlayerKaltura:"6463",b453f7b0:"6494","2f617b24":"6677",reactPlayerFacebook:"6887","3f8193f3":"6900",a7bd4aaa:"7098",cacdc615:"7211","11478de3":"7258",c39b795e:"7338","3ae94ad4":"7408",fdefa9a8:"7453",reactPlayerFilePlayer:"7458","921b5fc1":"7462",reactPlayerMixcloud:"7570",reactPlayerStreamable:"7627","25bf2d67":"8031","85112c90":"8054","53ed7db4":"8127",d59b5b70:"8183","474d53cd":"8261",reactPlayerYouTube:"8446","44dfcf75":"8598","172b3cfb":"8929",adef6868:"8953",a94703ab:"9048",ea3c040a:"9126",c329cc2b:"9304",reactPlayerWistia:"9340","54175a6c":"9455","23d0e682":"9461",f81a91eb:"9580",eae80ce0:"9642","5e95c892":"9647",reactPlayerSoundCloud:"9979"}[e]||e,b.p+b.u(e)},(()=>{var e={5354:0,1869:0};b.f.j=(a,r)=>{var c=b.o(e,a)?e[a]:void 0;if(0!==c)if(c)r.push(c[2]);else if(/^(1869|5354)$/.test(a))e[a]=0;else{var t=new Promise(((r,t)=>c=e[a]=[r,t]));r.push(c[2]=t);var d=b.p+b.u(a),f=new Error;b.l(d,(r=>{if(b.o(e,a)&&(0!==(c=e[a])&&(e[a]=void 0),c)){var t=r&&("load"===r.type?"missing":r.type),d=r&&r.target&&r.target.src;f.message="Loading chunk "+a+" failed.\n("+t+": "+d+")",f.name="ChunkLoadError",f.type=t,f.request=d,c[1](f)}}),"chunk-"+a,a)}},b.O.j=a=>0===e[a];var a=(a,r)=>{var c,t,d=r[0],f=r[1],o=r[2],l=0;if(d.some((a=>0!==e[a]))){for(c in f)b.o(f,c)&&(b.m[c]=f[c]);if(o)var n=o(b)}for(a&&a(r);l{"use strict";var e,a,r,c,t,d={},f={};function b(e){var a=f[e];if(void 0!==a)return a.exports;var r=f[e]={id:e,loaded:!1,exports:{}};return d[e].call(r.exports,r,r.exports,b),r.loaded=!0,r.exports}b.m=d,b.c=f,e=[],b.O=(a,r,c,t)=>{if(!r){var d=1/0;for(n=0;n=t)&&Object.keys(b.O).every((e=>b.O[e](r[o])))?r.splice(o--,1):(f=!1,t0&&e[n-1][2]>t;n--)e[n]=e[n-1];e[n]=[r,c,t]},b.n=e=>{var a=e&&e.__esModule?()=>e.default:()=>e;return b.d(a,{a:a}),a},r=Object.getPrototypeOf?e=>Object.getPrototypeOf(e):e=>e.__proto__,b.t=function(e,c){if(1&c&&(e=this(e)),8&c)return e;if("object"==typeof e&&e){if(4&c&&e.__esModule)return e;if(16&c&&"function"==typeof e.then)return e}var t=Object.create(null);b.r(t);var d={};a=a||[null,r({}),r([]),r(r)];for(var f=2&c&&e;"object"==typeof f&&!~a.indexOf(f);f=r(f))Object.getOwnPropertyNames(f).forEach((a=>d[a]=()=>e[a]));return d.default=()=>e,b.d(t,d),t},b.d=(e,a)=>{for(var r in a)b.o(a,r)&&!b.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:a[r]})},b.f={},b.e=e=>Promise.all(Object.keys(b.f).reduce(((a,r)=>(b.f[r](e,a),a)),[])),b.u=e=>"assets/js/"+({144:"e2a386ca",145:"0be1d5fe",784:"fe965b62",804:"7fcd30b6",868:"dc7b1ef3",1039:"16d61ab3",1227:"647965d5",1246:"1b523369",1456:"ecd98ae0",1563:"3ef76b56",1567:"22dd74f7",1917:"c3616f7f",2005:"0575dfc8",2042:"reactPlayerTwitch",2431:"c0d3c6ab",2657:"a3ab51d1",2691:"2efb9d3a",2723:"reactPlayerMux",3392:"reactPlayerVidyard",3659:"4618a71f",4028:"c2ebd62a",4046:"9ac856ad",4058:"ccff95c4",4133:"5cf11f26",5527:"9e7a34ba",5562:"20e9af62",5572:"873ebc27",5628:"a83bc7c0",5664:"36970916",5742:"aba21aa0",5772:"f66238ae",6008:"445668ec",6147:"ab17fe15",6173:"reactPlayerVimeo",6328:"reactPlayerDailyMotion",6353:"reactPlayerPreview",6463:"reactPlayerKaltura",6494:"b453f7b0",6677:"2f617b24",6887:"reactPlayerFacebook",6900:"3f8193f3",7098:"a7bd4aaa",7211:"cacdc615",7258:"11478de3",7338:"c39b795e",7408:"3ae94ad4",7453:"fdefa9a8",7458:"reactPlayerFilePlayer",7462:"921b5fc1",7570:"reactPlayerMixcloud",7627:"reactPlayerStreamable",8031:"25bf2d67",8054:"85112c90",8127:"53ed7db4",8183:"d59b5b70",8261:"474d53cd",8401:"17896441",8446:"reactPlayerYouTube",8598:"44dfcf75",8929:"172b3cfb",8953:"adef6868",9048:"a94703ab",9126:"ea3c040a",9304:"c329cc2b",9340:"reactPlayerWistia",9455:"54175a6c",9461:"23d0e682",9580:"f81a91eb",9642:"eae80ce0",9647:"5e95c892",9979:"reactPlayerSoundCloud"}[e]||e)+"."+{144:"7e8e09aa",145:"4524db73",784:"bf3c3b32",804:"052d3ec1",868:"d7c01dec",900:"cec9b91d",1039:"6b5d9275",1227:"f67bd117",1246:"9ab26cae",1456:"e5056aaa",1563:"19a1df84",1567:"6bb59f33",1917:"66691f62",2005:"e2f00246",2042:"38dd7b7d",2237:"4bb44bc4",2431:"0df77f03",2657:"8e67cffa",2691:"c7804f19",2723:"8f6391ba",3392:"cb42cdfc",3554:"c7291073",3659:"65567128",4028:"4c8ebf9d",4046:"0b7c5218",4058:"9c31c71d",4133:"26322936",5527:"c924b445",5562:"8d63ec91",5572:"d11012c8",5628:"707c1b67",5664:"46db89cf",5742:"7728a8b8",5772:"84317656",6008:"5070ebd4",6147:"3f45eb86",6173:"291c2909",6328:"f614ee4c",6353:"8cd2b61f",6463:"8e37235b",6494:"404054b3",6677:"6a39e3b4",6887:"a60ee927",6900:"ed789b0e",7098:"71beb8e2",7211:"69ff3bb2",7258:"a5274620",7338:"894a81dc",7408:"8c54d710",7453:"cc4cfb89",7458:"c0e08054",7462:"8828b31d",7570:"34c84b39",7627:"b6323134",8031:"9469dd38",8054:"2d20ecfb",8127:"7f91271f",8183:"7baaad08",8261:"4737b75e",8401:"2ed86b26",8446:"a89f408c",8598:"44362993",8929:"e136d1f2",8953:"b34482be",9048:"38aef81a",9126:"5122becc",9304:"db4c4794",9340:"7f514310",9455:"77251598",9461:"f73e4482",9580:"77eb4862",9642:"b1d36097",9647:"8641e05b",9979:"9ddea34f"}[e]+".js",b.miniCssF=e=>{},b.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),b.o=(e,a)=>Object.prototype.hasOwnProperty.call(e,a),c={},t="langflow-docs:",b.l=(e,a,r,d)=>{if(c[e])c[e].push(a);else{var f,o;if(void 0!==r)for(var l=document.getElementsByTagName("script"),n=0;n{f.onerror=f.onload=null,clearTimeout(s);var t=c[e];if(delete c[e],f.parentNode&&f.parentNode.removeChild(f),t&&t.forEach((e=>e(r))),a)return a(r)},s=setTimeout(u.bind(null,void 0,{type:"timeout",target:f}),12e4);f.onerror=u.bind(null,f.onerror),f.onload=u.bind(null,f.onload),o&&document.head.appendChild(f)}},b.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},b.p="/",b.gca=function(e){return e={17896441:"8401",36970916:"5664",e2a386ca:"144","0be1d5fe":"145",fe965b62:"784","7fcd30b6":"804",dc7b1ef3:"868","16d61ab3":"1039","647965d5":"1227","1b523369":"1246",ecd98ae0:"1456","3ef76b56":"1563","22dd74f7":"1567",c3616f7f:"1917","0575dfc8":"2005",reactPlayerTwitch:"2042",c0d3c6ab:"2431",a3ab51d1:"2657","2efb9d3a":"2691",reactPlayerMux:"2723",reactPlayerVidyard:"3392","4618a71f":"3659",c2ebd62a:"4028","9ac856ad":"4046",ccff95c4:"4058","5cf11f26":"4133","9e7a34ba":"5527","20e9af62":"5562","873ebc27":"5572",a83bc7c0:"5628",aba21aa0:"5742",f66238ae:"5772","445668ec":"6008",ab17fe15:"6147",reactPlayerVimeo:"6173",reactPlayerDailyMotion:"6328",reactPlayerPreview:"6353",reactPlayerKaltura:"6463",b453f7b0:"6494","2f617b24":"6677",reactPlayerFacebook:"6887","3f8193f3":"6900",a7bd4aaa:"7098",cacdc615:"7211","11478de3":"7258",c39b795e:"7338","3ae94ad4":"7408",fdefa9a8:"7453",reactPlayerFilePlayer:"7458","921b5fc1":"7462",reactPlayerMixcloud:"7570",reactPlayerStreamable:"7627","25bf2d67":"8031","85112c90":"8054","53ed7db4":"8127",d59b5b70:"8183","474d53cd":"8261",reactPlayerYouTube:"8446","44dfcf75":"8598","172b3cfb":"8929",adef6868:"8953",a94703ab:"9048",ea3c040a:"9126",c329cc2b:"9304",reactPlayerWistia:"9340","54175a6c":"9455","23d0e682":"9461",f81a91eb:"9580",eae80ce0:"9642","5e95c892":"9647",reactPlayerSoundCloud:"9979"}[e]||e,b.p+b.u(e)},(()=>{var e={5354:0,1869:0};b.f.j=(a,r)=>{var c=b.o(e,a)?e[a]:void 0;if(0!==c)if(c)r.push(c[2]);else if(/^(1869|5354)$/.test(a))e[a]=0;else{var t=new Promise(((r,t)=>c=e[a]=[r,t]));r.push(c[2]=t);var d=b.p+b.u(a),f=new Error;b.l(d,(r=>{if(b.o(e,a)&&(0!==(c=e[a])&&(e[a]=void 0),c)){var t=r&&("load"===r.type?"missing":r.type),d=r&&r.target&&r.target.src;f.message="Loading chunk "+a+" failed.\n("+t+": "+d+")",f.name="ChunkLoadError",f.type=t,f.request=d,c[1](f)}}),"chunk-"+a,a)}},b.O.j=a=>0===e[a];var a=(a,r)=>{var c,t,d=r[0],f=r[1],o=r[2],l=0;if(d.some((a=>0!==e[a]))){for(c in f)b.o(f,c)&&(b.m[c]=f[c]);if(o)var n=o(b)}for(a&&a(r);l -Custom Components | Langflow Documentation +Custom Components | Langflow Documentation - + -

Custom Components

-

Langflow components can be created from within the platform, allowing users to extend the platform's functionality using Python code. They encapsulate are designed to be independent units, reusable across different workflows.

-

These components can be easily connected within a language model pipeline, adding freedom and flexibility to what can be included in between user and AI messages.

-

-

Since Langflow operates with Python behind the scenes, you can implement any Python function within a Custom Component. This means you can leverage the power of libraries such as Pandas, Scikit-learn, Numpy, and thousands of packages to create components that handle data processing in unlimited ways.

-

Custom Components are not just about extending functionality; they also streamline the development process. By creating reusable and configurable components, you can enhance the capabilities of Langflow, making it a powerful tool for developing complex workflows.

-

Key Characteristics:

+
+

Custom Components

+

Custom components are created within Langflow and extend the platform's functionality with custom, resusable Python code.

+

Since Langflow operates with Python behind the scenes, you can implement any Python function within a Custom Component. This means you can leverage the power of libraries such as Pandas, Scikit-learn, Numpy, and thousands of other packages to create components that handle data processing in unlimited ways. You can use any type as long as the type is properly annotated in the output methods (e.g., > list[int]).

+

Custom Components create reusable and configurable components to enhance the capabilities of Langflow, making it a powerful tool for developing complex processing between user and AI messages.

+

How to Create Custom Components

+

Creating custom components in Langflow involves creating a Python class that defines the component's functionality, inputs, and outputs. +The default code provides a working structure for your custom component.

+

_25
# from langflow.field_typing import Data
_25
from langflow.custom import Component
_25
from langflow.io import MessageTextInput, Output
_25
from langflow.schema import Data
_25
_25
_25
class CustomComponent(Component):
_25
display_name = "Custom Component"
_25
description = "Use as a template to create your own component."
_25
documentation: str = "http://docs.langflow.org/components/custom"
_25
icon = "custom_components"
_25
name = "CustomComponent"
_25
_25
inputs = [
_25
MessageTextInput(name="input_value", display_name="Input Value", value="Hello, World!"),
_25
]
_25
_25
outputs = [
_25
Output(display_name="Output", name="output", method="build_output"),
_25
]
_25
_25
def build_output(self) -> Data:
_25
data = Data(value=self.input_value)
_25
self.status = data
_25
return data

+

You can create your class in your favorite text editor outside of Langflow and paste it in later, or just follow along in the code pane.

    -
  1. Modular and Reusable: Designed as independent units, components encapsulate specific functionality, making them reusable across different projects and workflows.
  2. -
  3. Integration with Python Libraries: You can import libraries like Pandas, Scikit-learn, Numpy, etc., to build components that handle data processing, machine learning, numerical computations, and more.
  4. -
  5. Flexible Inputs and Outputs: While Langflow offers native input and output types, you can use any type as long as they are properly annotated in the output methods (e.g., > list[int]).
  6. -
  7. Python-Powered: Since Langflow operates with Python behind the scenes, any Python function can be implemented within a custom component.
  8. -
  9. Enhanced Workflow: Custom components serve as reusable building blocks, enabling you to create pre-processing visual blocks with ease and integrate them into your language model pipeline.
  10. +
  11. In Langflow, from under Helpers, drag a Custom Component into the workspace.
  12. +
  13. Open the component's code pane.
  14. +
  15. Import dependencies. +Your custom component inherits from the langflow Component class so you need to include it.
-

Why Use Custom Components?

-
    -
  • Customization: Tailor the functionality to your specific needs by writing Python code that suits your workflow.
  • -
  • Flexibility: Add any Python-based logic or processing step between user/AI messages, enhancing the flexibility of Langflow.
  • -
  • Efficiency: Streamline your development process by creating reusable, configurable components that can be easily deployed.
  • -
-

How to Write Them

-
-

Writing custom components in Langflow involves creating a Python class that defines the component's functionality, inputs, and outputs. The process involves a few key steps:

-
    +

    _10
    from langflow.custom import Component
    _10
    from langflow.io import MessageTextInput, Output
    _10
    from langflow.schema import Data

    +
    1. Define the Class: Start by defining a Python class that inherits from Component. This class will encapsulate the functionality of your custom component.
    2. -
    3. Specify Inputs and Outputs: Use Langflow's input and output classes to define the inputs and outputs of your component. They should be declared as class attributes.
    4. -
    5. Implement Output Methods: Implement methods for each output, which contains the logic of your component. These methods can access input values using self.<input_name> , return processed values and define what to be displayed in the component with the self.status attribute.
    6. -
    7. Use Proper Annotations: Ensure that output methods are properly annotated with their types. Langflow uses these annotations to validate and handle data correctly.
    -

    Here's a basic structure of a custom component:

    -

    _31
    from langflow.custom import Component
    _31
    from langflow.inputs import StrInput, IntInput
    _31
    from langflow.template import Output
    _31
    _31
    class MyCustomComponent(Component):
    _31
    icon = "coffee" # check lucide.dev/icons or pass an emoji
    _31
    _31
    inputs = [
    _31
    StrInput(
    _31
    name="input_text",
    _31
    display_name="Input Text",
    _31
    info="Text to be processed.",
    _31
    ),
    _31
    IntInput(
    _31
    name="input_number",
    _31
    display_name="Input Number",
    _31
    info="Number to be processed.",
    _31
    ),
    _31
    ]
    _31
    _31
    outputs = [
    _31
    Output(display_name="Processed Text", name="processed_text", method="process_text"),
    _31
    ]
    _31
    _31
    def process_text(self) -> str:
    _31
    input_text = self.input_text
    _31
    input_number = self.input_number
    _31
    # Implement your logic here
    _31
    processed_text = f"{input_text} processed with number {input_number}"
    _31
    self.status = processed_text
    _31
    return processed_text

    -

    Paste that code into the Custom Component code snippet and click Check & Save.

    -

    -

    You should see something like the component below. Double click the name or description areas to edit them.

    -

    +

    _10
    class CustomComponent(Component):
    _10
    display_name = "Custom Component"
    _10
    description = "Use as a template to create your own component."
    _10
    documentation: str = "http://docs.langflow.org/components/custom"
    _10
    icon = "custom_components"
    _10
    name = "CustomComponent"

    +
      +
    1. Specify Inputs and Outputs: Use Langflow's input and output classes to define the inputs and outputs of your component. They should be declared as class attributes.
    2. +
    +

    _10
    inputs = [
    _10
    MessageTextInput(name="input_value", display_name="Input Value", value="Hello, World!"),
    _10
    ]
    _10
    _10
    outputs = [
    _10
    Output(display_name="Output", name="output", method="build_output"),
    _10
    ]

    +
      +
    1. Implement Output Methods: Implement methods for each output, which contains the logic of your component. These methods can access input values using self.<input_name> , return processed values and define what to be displayed in the component with the self.status attribute.
    2. +
    +

    _10
    def build_output(self) -> Data:
    _10
    data = Data(value=self.input_value)
    _10
    self.status = data
    _10
    return data

    +
      +
    1. Use Proper Annotations: Ensure that output methods are properly annotated with their types. Langflow uses these annotations to validate and handle data correctly. For example, this method is annotated to output Data.
    2. +
    +

    _10
    def build_output(self) -> Data:

    +
      +
    1. Click Check & Save to confirm your component works. +You now have an operational custom component.
    2. +
    +

    +

    Add inputs and modify output methods

    +

    This code defines a custom component that accepts 5 inputs and outputs a Message.

    +

    Copy and paste it into the Custom Component code pane and click Check & Save.

    +

    _55
    from langflow.custom import Component
    _55
    from langflow.inputs import StrInput, MultilineInput, SecretStrInput, IntInput, DropdownInput
    _55
    from langflow.template import Output, Input
    _55
    from langflow.schema.message import Message
    _55
    _55
    class MyCustomComponent(Component):
    _55
    display_name = "My Custom Component"
    _55
    description = "An example of a custom component with various input types."
    _55
    _55
    inputs = [
    _55
    StrInput(
    _55
    name="username",
    _55
    display_name="Username",
    _55
    info="Enter your username."
    _55
    ),
    _55
    SecretStrInput(
    _55
    name="password",
    _55
    display_name="Password",
    _55
    info="Enter your password."
    _55
    ),
    _55
    MessageTextInput(
    _55
    name="special_message",
    _55
    display_name="special_message",
    _55
    info="Enter a special message.",
    _55
    ),
    _55
    IntInput(
    _55
    name="age",
    _55
    display_name="Age",
    _55
    info="Enter your age."
    _55
    ),
    _55
    DropdownInput(
    _55
    name="gender",
    _55
    display_name="Gender",
    _55
    options=["Male", "Female", "Other"],
    _55
    info="Select your gender."
    _55
    )
    _55
    ]
    _55
    _55
    outputs = [
    _55
    Output(display_name="Result", name="result", method="process_inputs"),
    _55
    ]
    _55
    _55
    def process_inputs(self) -> Message:
    _55
    """
    _55
    Process the user inputs and return a Message object.
    _55
    _55
    Returns:
    _55
    Message: A Message object containing the processed information.
    _55
    """
    _55
    try:
    _55
    processed_text = f"User {self.username} (Age: {self.age}, Gender: {self.gender}) " \
    _55
    f"sent the following special message: {self.special_message}"
    _55
    return Message(text=processed_text)
    _55
    except AttributeError as e:
    _55
    return Message(text=f"Error processing inputs: {str(e)}")

    +

    Since the component outputs a Message, you can wire it into a chat and pass messages to yourself.

    +

    Your Custom Component accepts the Chat Input message through MessageTextInput, fills in the variables with the process_inputs method, and finally passes the message User Username (Age: 49, Gender: Male) sent the following special message: Hello! to Chat Output.

    +

    +

    By defining inputs this way, Langflow can automatically handle the validation and display of these fields in the user interface, making it easier to create robust and user-friendly custom components.

    +

    All of the types detailed above derive from a general class that can also be accessed through the generic Input class.

    +
    tip

    Use MessageInput to get the entire Message object instead of just the text.

    Input Types


    Langflow provides several higher-level input types to simplify the creation of custom components. These input types standardize how inputs are defined, validated, and used. Here’s a guide on how to use these inputs and their primary purposes:

    @@ -141,10 +154,6 @@
  1. Attributes: file_types to specify the types of files that can be uploaded.
  2. Input Types: ["File"]
  3. -

    Here is an example of how these inputs can be defined in a custom component:

    -

    _44
    from langflow.custom import Component
    _44
    from langflow.inputs import StrInput, MultilineInput, SecretStrInput, IntInput, DropdownInput
    _44
    from langflow.template import Output, Input
    _44
    _44
    class MyCustomComponent(Component):
    _44
    display_name = "My Custom Component"
    _44
    description = "An example of a custom component with various input types."
    _44
    _44
    inputs = [
    _44
    StrInput(
    _44
    name="username",
    _44
    display_name="Username",
    _44
    info="Enter your username."
    _44
    ),
    _44
    SecretStrInput(
    _44
    name="password",
    _44
    display_name="Password",
    _44
    info="Enter your password."
    _44
    ),
    _44
    MultilineInput(
    _44
    name="description",
    _44
    display_name="Description",
    _44
    info="Enter a detailed description.",
    _44
    ),
    _44
    IntInput(
    _44
    name="age",
    _44
    display_name="Age",
    _44
    info="Enter your age."
    _44
    ),
    _44
    DropdownInput(
    _44
    name="gender",
    _44
    display_name="Gender",
    _44
    options=["Male", "Female", "Other"],
    _44
    info="Select your gender."
    _44
    )
    _44
    ]
    _44
    _44
    outputs = [
    _44
    Output(display_name="Result", name="result", method="process_inputs"),
    _44
    ]
    _44
    _44
    def process_inputs(self):
    _44
    # Your processing logic here
    _44
    return "Processed"

    -

    By defining inputs this way, Langflow can automatically handle the validation and display of these fields in the user interface, making it easier to create robust and user-friendly custom components.

    -

    All of the types detailed above derive from a general class that can also be accessed through the generic Input class.

    Generic Input


    Langflow offers native input types, but you can use any type as long as they are properly annotated in the output methods (e.g., -> list[int]).

    @@ -174,23 +183,33 @@
  4. load_from_db: Boolean indicating if the field should load from the database. Default is False.
  5. title_case: Boolean indicating if the display name should be in title case. Default is True.
  6. -

    Below is an example of how to define inputs for a component using the Input class:

    -

    _48
    from langflow.template import Input, Output
    _48
    from langflow.custom import Component
    _48
    from langflow.field_typing import Text
    _48
    _48
    class ExampleComponent(Component):
    _48
    display_name = "Example Component"
    _48
    description = "An example component demonstrating input fields."
    _48
    _48
    inputs = [
    _48
    Input(
    _48
    name="input_text",
    _48
    display_name="Input Text",
    _48
    field_type="str",
    _48
    required=True,
    _48
    placeholder="Enter some text",
    _48
    multiline=True,
    _48
    info="This is a required text input.",
    _48
    input_types=["Text"]
    _48
    ),
    _48
    Input(
    _48
    name="max_length",
    _48
    display_name="Max Length",
    _48
    field_type="int",
    _48
    required=False,
    _48
    placeholder="Maximum length",
    _48
    info="Enter the maximum length of the text.",
    _48
    range_spec={"min": 0, "max": 1000},
    _48
    ),
    _48
    Input(
    _48
    name="options",
    _48
    display_name="Options",
    _48
    field_type="str",
    _48
    is_list=True,
    _48
    options=["Option 1", "Option 2", "Option 3"],
    _48
    info="Select one or more options."
    _48
    ),
    _48
    ]
    _48
    _48
    outputs = [
    _48
    Output(display_name="Result", name="result", method="process_input"),
    _48
    ]
    _48
    _48
    def process_input(self) -> Text:
    _48
    # Process the inputs and generate output
    _48
    return Text(value=f"Processed: {self.input_text}, Max Length: {self.max_length}, Options: {self.options}")
    _48
    _48
    # Define how to use the inputs and outputs
    _48
    component = ExampleComponent()

    -

    In this example:

    +

    Create a Custom Component with Generic Input

    +

    Here is an example of how to define inputs for a component using the Input class.

    +

    Copy and paste it into the Custom Component code pane and click Check & Save.

    +

    _76
    from langflow.template import Input, Output
    _76
    from langflow.custom import Component
    _76
    from langflow.field_typing import Text
    _76
    from langflow.schema.message import Message
    _76
    from typing import Dict, Any
    _76
    _76
    class TextAnalyzerComponent(Component):
    _76
    display_name = "Text Analyzer"
    _76
    description = "Analyzes input text and provides basic statistics."
    _76
    _76
    inputs = [
    _76
    Input(
    _76
    name="input_text",
    _76
    display_name="Input Text",
    _76
    field_type="Message",
    _76
    required=True,
    _76
    placeholder="Enter text to analyze",
    _76
    multiline=True,
    _76
    info="The text you want to analyze.",
    _76
    input_types=["Text"]
    _76
    ),
    _76
    Input(
    _76
    name="include_word_count",
    _76
    display_name="Include Word Count",
    _76
    field_type="bool",
    _76
    required=False,
    _76
    info="Whether to include word count in the analysis.",
    _76
    ),
    _76
    Input(
    _76
    name="perform_sentiment_analysis",
    _76
    display_name="Perform Sentiment Analysis",
    _76
    field_type="bool",
    _76
    required=False,
    _76
    info="Whether to perform basic sentiment analysis.",
    _76
    ),
    _76
    ]
    _76
    _76
    outputs = [
    _76
    Output(display_name="Analysis Results", name="results", method="analyze_text"),
    _76
    ]
    _76
    _76
    def analyze_text(self) -> Message:
    _76
    # Extract text from the Message object
    _76
    if isinstance(self.input_text, Message):
    _76
    text = self.input_text.text
    _76
    else:
    _76
    text = str(self.input_text)
    _76
    _76
    results = {
    _76
    "character_count": len(text),
    _76
    "sentence_count": text.count('.') + text.count('!') + text.count('?')
    _76
    }
    _76
    _76
    if self.include_word_count:
    _76
    results["word_count"] = len(text.split())
    _76
    _76
    if self.perform_sentiment_analysis:
    _76
    # Basic sentiment analysis
    _76
    text_lower = text.lower()
    _76
    if "happy" in text_lower or "good" in text_lower:
    _76
    sentiment = "positive"
    _76
    elif "sad" in text_lower or "bad" in text_lower:
    _76
    sentiment = "negative"
    _76
    else:
    _76
    sentiment = "neutral"
    _76
    _76
    results["sentiment"] = sentiment
    _76
    _76
    # Convert the results dictionary to a formatted string
    _76
    formatted_results = "\n".join([f"{key}: {value}" for key, value in results.items()])
    _76
    _76
    # Return a Message object
    _76
    return Message(text=formatted_results)
    _76
    _76
    # Define how to use the inputs and outputs
    _76
    component = TextAnalyzerComponent()

    +

    In this custom component:

      -
    • The input_text input is a required multi-line text field.
    • -
    • The max_length input is an optional integer field with a range specification.
    • -
    • The options input is a list of strings with predefined options.
    • +
    • +

      The input_text input is a required multi-line text field that accepts a Message object or a string. It's used to provide the text for analysis.

      +
    • +
    • +

      The include_word_count input is an optional boolean field. When set to True, it adds a word count to the analysis results.

      +
    • +
    • +

      The perform_sentiment_analysis input is an optional boolean field. When set to True, it triggers a basic sentiment analysis of the input text.

      +
    -

    These attributes allow for a high degree of customization, making it easy to create input fields that suit the needs of your specific component.

    -

    Multiple Outputs

    +

    The component performs basic text analysis, including character count and sentence count (based on punctuation marks). If word count is enabled, it splits the text and counts the words. If sentiment analysis is enabled, it performs a simple keyword-based sentiment classification (positive, negative, or neutral).

    +

    Since the component inputs and outputs a Message, you can wire the component into a chat and see how the basic custom component logic interacts with your input.

    +

    +

    Create a Custom Component with Multiple Outputs


    In Langflow, custom components can have multiple outputs. Each output can be associated with a specific method in the component, allowing you to define distinct behaviors for each output path. This feature is particularly useful when you want to route data based on certain conditions or process it in multiple ways.

    1. Definition of Outputs: Each output is defined in the outputs list of the component. Each output is associated with a display name, an internal name, and a method that gets called to generate the output.
    2. Output Methods: The methods associated with outputs are responsible for generating the data for that particular output. These methods are called when the component is executed, and each method can independently produce its result.
    -

    Below is an example of a component with two outputs:

    +

    This example component has two outputs:

    • process_data: Processes the input text (e.g., converts it to uppercase) and returns it.
    • get_processing_function: Returns the process_data method itself to be reused in composition.
    • @@ -198,8 +217,7 @@

      _33
      from typing import Callable
      _33
      from langflow.custom import Component
      _33
      from langflow.inputs import StrInput
      _33
      from langflow.template import Output
      _33
      from langflow.field_typing import Text
      _33
      _33
      class DualOutputComponent(Component):
      _33
      display_name = "Dual Output"
      _33
      description = "Processes input text and returns both the result and the processing function."
      _33
      icon = "double-arrow"
      _33
      _33
      inputs = [
      _33
      StrInput(
      _33
      name="input_text",
      _33
      display_name="Input Text",
      _33
      info="The text input to be processed.",
      _33
      ),
      _33
      ]
      _33
      _33
      outputs = [
      _33
      Output(display_name="Processed Data", name="processed_data", method="process_data"),
      _33
      Output(display_name="Processing Function", name="processing_function", method="get_processing_function"),
      _33
      ]
      _33
      _33
      def process_data(self) -> Text:
      _33
      # Process the input text (e.g., convert to uppercase)
      _33
      processed = self.input_text.upper()
      _33
      self.status = processed
      _33
      return processed
      _33
      _33
      def get_processing_function(self) -> Callable[[], Text]:
      _33
      # Return the processing function itself
      _33
      return self.process_data

      This example shows how to define multiple outputs in a custom component. The first output returns the processed data, while the second output returns the processing function itself.

      The processing_function output can be used in scenarios where the function itself is needed for further processing or dynamic flow control. Notice how both outputs are properly annotated with their respective types, ensuring clarity and type safety.

      -

      Special Operations

      -
      +

      Special Operations

      Advanced methods and attributes offer additional control and functionality. Understanding how to leverage these can enhance your custom components' capabilities.

      • self.inputs: Access all defined inputs. Useful when an output method needs to interact with multiple inputs.
      • @@ -207,6 +225,8 @@
      • self.status: Use this to update the component's status or intermediate results. It helps track the component's internal state or store temporary data.
      • self.graph.flow_id: Retrieve the flow ID, useful for maintaining context or debugging.
      • self.stop("output_name"): Use this method within an output function to prevent data from being sent through other components. This method stops next component execution and is particularly useful for specific operations where a component should stop from running based on specific conditions.
      • -

Hi, how can I help you?

+ +

Contribute Custom Components to Langflow

+

See How to Contribute to contribute your custom component to Langflow.

Hi, how can I help you?

\ No newline at end of file diff --git a/components-data.html b/components-data.html index be4c39624b..e0aacf708e 100644 --- a/components-data.html +++ b/components-data.html @@ -10,7 +10,7 @@ - + diff --git a/components-embedding-models.html b/components-embedding-models.html index 6d164f8364..d4435c575f 100644 --- a/components-embedding-models.html +++ b/components-embedding-models.html @@ -10,7 +10,7 @@ - + diff --git a/components-helpers.html b/components-helpers.html index fca164fdc1..6abb708f87 100644 --- a/components-helpers.html +++ b/components-helpers.html @@ -10,7 +10,7 @@ - + diff --git a/components-io.html b/components-io.html index f32bb230d4..d512a1f7ec 100644 --- a/components-io.html +++ b/components-io.html @@ -10,7 +10,7 @@ - + diff --git a/components-loaders.html b/components-loaders.html index 05195f7b40..23d9cfa728 100644 --- a/components-loaders.html +++ b/components-loaders.html @@ -10,7 +10,7 @@ - + diff --git a/components-models.html b/components-models.html index 7c1d4ede95..ee14b5a2fc 100644 --- a/components-models.html +++ b/components-models.html @@ -10,7 +10,7 @@ - + diff --git a/components-prompts.html b/components-prompts.html index 9f04ff1a74..da49aa3144 100644 --- a/components-prompts.html +++ b/components-prompts.html @@ -10,7 +10,7 @@ - + diff --git a/components-rag.html b/components-rag.html index 6d6c68ee7a..beb680e22b 100644 --- a/components-rag.html +++ b/components-rag.html @@ -10,7 +10,7 @@ - + diff --git a/components-vector-stores.html b/components-vector-stores.html index 5abd840de8..f51b7700dd 100644 --- a/components-vector-stores.html +++ b/components-vector-stores.html @@ -10,7 +10,7 @@ - + diff --git a/components.html b/components.html index 062eee634b..e9e3dfb006 100644 --- a/components.html +++ b/components.html @@ -10,7 +10,7 @@ - + diff --git a/configuration-api-keys.html b/configuration-api-keys.html index 3a59c0fdb9..63d878311f 100644 --- a/configuration-api-keys.html +++ b/configuration-api-keys.html @@ -10,7 +10,7 @@ - + diff --git a/configuration-authentication.html b/configuration-authentication.html index 12192176b7..677c46f9fb 100644 --- a/configuration-authentication.html +++ b/configuration-authentication.html @@ -10,7 +10,7 @@ - + diff --git a/configuration-auto-save.html b/configuration-auto-save.html index 5deafef4d0..ecfd87bfd9 100644 --- a/configuration-auto-save.html +++ b/configuration-auto-save.html @@ -10,7 +10,7 @@ - + diff --git a/configuration-backend-only.html b/configuration-backend-only.html index 14fa557770..3d51c3110d 100644 --- a/configuration-backend-only.html +++ b/configuration-backend-only.html @@ -10,7 +10,7 @@ - + diff --git a/configuration-cli.html b/configuration-cli.html index 3f9f3c3542..c796db47d0 100644 --- a/configuration-cli.html +++ b/configuration-cli.html @@ -10,7 +10,7 @@ - + diff --git a/contributing-community.html b/contributing-community.html index 4e7c93ef21..8005759d17 100644 --- a/contributing-community.html +++ b/contributing-community.html @@ -10,7 +10,7 @@ - + diff --git a/contributing-github-issues.html b/contributing-github-issues.html index 104eccc688..79ceb16c3b 100644 --- a/contributing-github-issues.html +++ b/contributing-github-issues.html @@ -10,7 +10,7 @@ - + diff --git a/contributing-how-to-contribute.html b/contributing-how-to-contribute.html index 6dda1795a3..29fe95ef21 100644 --- a/contributing-how-to-contribute.html +++ b/contributing-how-to-contribute.html @@ -10,7 +10,7 @@ - + diff --git a/contributing-telemetry.html b/contributing-telemetry.html index 78c99bc907..555f29bc76 100644 --- a/contributing-telemetry.html +++ b/contributing-telemetry.html @@ -10,7 +10,7 @@ - + diff --git a/deployment-docker.html b/deployment-docker.html index 6857084712..9c53eed0e0 100644 --- a/deployment-docker.html +++ b/deployment-docker.html @@ -10,7 +10,7 @@ - + diff --git a/deployment-gcp.html b/deployment-gcp.html index 080bd9baad..1382b1b49d 100644 --- a/deployment-gcp.html +++ b/deployment-gcp.html @@ -10,7 +10,7 @@ - + diff --git a/deployment-hugging-face-spaces.html b/deployment-hugging-face-spaces.html index caaa79b925..9cf1a97db0 100644 --- a/deployment-hugging-face-spaces.html +++ b/deployment-hugging-face-spaces.html @@ -10,7 +10,7 @@ - + diff --git a/deployment-kubernetes.html b/deployment-kubernetes.html index 0ee0709fa0..ae999e86cf 100644 --- a/deployment-kubernetes.html +++ b/deployment-kubernetes.html @@ -10,7 +10,7 @@ - + diff --git a/deployment-railway.html b/deployment-railway.html index 4c1085ca94..7b405d4144 100644 --- a/deployment-railway.html +++ b/deployment-railway.html @@ -10,7 +10,7 @@ - + diff --git a/deployment-render.html b/deployment-render.html index 7c1bb70042..772c3b0bc6 100644 --- a/deployment-render.html +++ b/deployment-render.html @@ -10,7 +10,7 @@ - + diff --git a/getting-started-common-installation-issues.html b/getting-started-common-installation-issues.html index c327e2850c..cbd256bf3b 100644 --- a/getting-started-common-installation-issues.html +++ b/getting-started-common-installation-issues.html @@ -10,7 +10,7 @@ - + diff --git a/getting-started-installation.html b/getting-started-installation.html index 4b2cccae1c..aafd213c56 100644 --- a/getting-started-installation.html +++ b/getting-started-installation.html @@ -10,7 +10,7 @@ - + diff --git a/getting-started-quickstart.html b/getting-started-quickstart.html index d58c24d142..a82c8d6ede 100644 --- a/getting-started-quickstart.html +++ b/getting-started-quickstart.html @@ -10,7 +10,7 @@ - + diff --git a/guides-chat-memory.html b/guides-chat-memory.html index 0406bbf2cf..d058fe2a32 100644 --- a/guides-chat-memory.html +++ b/guides-chat-memory.html @@ -10,7 +10,7 @@ - + diff --git a/guides-data-message.html b/guides-data-message.html index dbd18f1cf0..914b4ded85 100644 --- a/guides-data-message.html +++ b/guides-data-message.html @@ -10,7 +10,7 @@ - + diff --git a/guides-new-to-llms.html b/guides-new-to-llms.html index dec0e2b9bd..cf7f17b3a6 100644 --- a/guides-new-to-llms.html +++ b/guides-new-to-llms.html @@ -10,7 +10,7 @@ - + diff --git a/index.html b/index.html index dbc146ec8b..db905014ce 100644 --- a/index.html +++ b/index.html @@ -10,7 +10,7 @@ - + diff --git a/integrations-langsmith.html b/integrations-langsmith.html index 4fe1f9611d..8f07d0bdcd 100644 --- a/integrations-langsmith.html +++ b/integrations-langsmith.html @@ -10,7 +10,7 @@ - + diff --git a/integrations-langwatch.html b/integrations-langwatch.html index e7a410c016..40be6d57ae 100644 --- a/integrations-langwatch.html +++ b/integrations-langwatch.html @@ -10,7 +10,7 @@ - + diff --git a/settings-global-variables.html b/settings-global-variables.html index 0afd289e84..6c68f3320f 100644 --- a/settings-global-variables.html +++ b/settings-global-variables.html @@ -10,7 +10,7 @@ - + diff --git a/settings-project-general-settings.html b/settings-project-general-settings.html index 2ec8c069e9..040ac3c90a 100644 --- a/settings-project-general-settings.html +++ b/settings-project-general-settings.html @@ -10,7 +10,7 @@ - + diff --git a/starter-projects-basic-prompting.html b/starter-projects-basic-prompting.html index eb7a711f80..f3e3729343 100644 --- a/starter-projects-basic-prompting.html +++ b/starter-projects-basic-prompting.html @@ -10,7 +10,7 @@ - + diff --git a/starter-projects-blog-writer.html b/starter-projects-blog-writer.html index 4487fe141d..6b011c2581 100644 --- a/starter-projects-blog-writer.html +++ b/starter-projects-blog-writer.html @@ -10,7 +10,7 @@ - + diff --git a/starter-projects-document-qa.html b/starter-projects-document-qa.html index a7f788a691..33e7538f28 100644 --- a/starter-projects-document-qa.html +++ b/starter-projects-document-qa.html @@ -10,7 +10,7 @@ - + diff --git a/starter-projects-memory-chatbot.html b/starter-projects-memory-chatbot.html index 6dc73ec8d8..de7d318890 100644 --- a/starter-projects-memory-chatbot.html +++ b/starter-projects-memory-chatbot.html @@ -10,7 +10,7 @@ - + diff --git a/starter-projects-vector-store-rag.html b/starter-projects-vector-store-rag.html index 6b9ef6a335..c2c1401b4e 100644 --- a/starter-projects-vector-store-rag.html +++ b/starter-projects-vector-store-rag.html @@ -10,7 +10,7 @@ - + diff --git a/whats-new-a-new-chapter-langflow.html b/whats-new-a-new-chapter-langflow.html index 1198123e00..0d03ec48e2 100644 --- a/whats-new-a-new-chapter-langflow.html +++ b/whats-new-a-new-chapter-langflow.html @@ -10,7 +10,7 @@ - + diff --git a/workspace-api.html b/workspace-api.html index 27d1ca7d26..8d1a77dc0c 100644 --- a/workspace-api.html +++ b/workspace-api.html @@ -10,7 +10,7 @@ - + diff --git a/workspace-logs.html b/workspace-logs.html index da6f04bf92..388ef99ce7 100644 --- a/workspace-logs.html +++ b/workspace-logs.html @@ -10,7 +10,7 @@ - + diff --git a/workspace-playground.html b/workspace-playground.html index 59af44f793..b8c8ecd095 100644 --- a/workspace-playground.html +++ b/workspace-playground.html @@ -10,7 +10,7 @@ - + diff --git a/workspace.html b/workspace.html index f36dee00e4..0e8e1471a7 100644 --- a/workspace.html +++ b/workspace.html @@ -10,7 +10,7 @@ - +