fix: update node logic (#2515)
* Fixed bug where updating the node does not remove edited status * Fixed order of edited override * Made all node-changing functions to alter type the right way * Update StoreMessageComponent for enhanced message handling - Changed base class from CustomComponent to Component - Added multiple input fields: message, sender, sender_name, session_id - Included output field for stored messages - Improved logic to handle both string and Message types - Enhanced error handling and validation for message storage * Apply Ruff formatting * Update StoreMessageComponent for enhanced message handling * Apply Ruff formatting * Feat: add more types * Format code * feat: Add CreateListComponent for creating a list of texts This commit adds a new component called CreateListComponent, which is responsible for creating a list of texts. The component takes in one or more texts as input and outputs a list of Data objects. This component is useful for scenarios where a list of texts needs to be processed or manipulated. The CreateListComponent class is added to the helpers module in the langflow.components package. It includes the necessary inputs and outputs, as well as a create_list method that generates the list of Data objects based on the input texts. This commit also includes some minor changes to other files, such as renaming the UUIDGeneratorComponent to IDGeneratorComponent and updating import statements. * [autofix.ci] apply automated fixes * Changed native categories to use the keys of the style utils categories, which is updated * change component name * chore: add the name attribute to the CustomComponent * chore: assign the value of name to the components * chore: change the logic of the type value returned * chore: extract code to new func * chore: change component_name value * [autofix.ci] apply automated fixes * Formatted files --------- Co-authored-by: Rodrigo <rodrigosilvanader@gmail.com> Co-authored-by: rodrigosnader <rodrigosnader@users.noreply.github.com> Co-authored-by: igorrCarvalho <igorsilvabhz6@gmail.com> Co-authored-by: anovazzi1 <otavio2204@gmail.com> Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: italojohnny <italojohnnydosanjos@gmail.com>
This commit is contained in:
parent
8017122d29
commit
17b730b6cf
143 changed files with 179 additions and 37 deletions
|
|
@ -22,7 +22,7 @@ from langflow.api.v1.schemas import (
|
|||
UploadFileResponse,
|
||||
)
|
||||
from langflow.custom.custom_component.component import Component
|
||||
from langflow.custom.utils import build_custom_component_template
|
||||
from langflow.custom.utils import build_custom_component_template, get_instance_name
|
||||
from langflow.graph.graph.base import Graph
|
||||
from langflow.graph.schema import RunOutputs
|
||||
from langflow.helpers.flow import get_flow_by_id_or_endpoint_name
|
||||
|
|
@ -519,7 +519,9 @@ async def custom_component(
|
|||
built_frontend_node, component_instance = build_custom_component_template(component, user_id=user.id)
|
||||
if raw_code.frontend_node is not None:
|
||||
built_frontend_node = component_instance.post_code_processing(built_frontend_node, raw_code.frontend_node)
|
||||
return CustomComponentResponse(data=built_frontend_node, type=component_instance.__class__.__name__)
|
||||
|
||||
_type = get_instance_name(component_instance)
|
||||
return CustomComponentResponse(data=built_frontend_node, type=_type)
|
||||
|
||||
|
||||
@router.post("/custom_component/update", status_code=HTTPStatus.OK)
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ class CSVAgentComponent(CustomComponent):
|
|||
display_name = "CSVAgent"
|
||||
description = "Construct a CSV agent from a CSV and tools."
|
||||
documentation = "https://python.langchain.com/docs/modules/agents/toolkits/csv"
|
||||
name = "CSVAgent"
|
||||
|
||||
def build_config(self):
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ from langflow.field_typing import LanguageModel
|
|||
class JsonAgentComponent(CustomComponent):
|
||||
display_name = "JsonAgent"
|
||||
description = "Construct a json agent from an LLM and tools."
|
||||
name = "JsonAgent"
|
||||
|
||||
def build_config(self):
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ from langflow.field_typing import LanguageModel
|
|||
class SQLAgentComponent(CustomComponent):
|
||||
display_name = "SQLAgent"
|
||||
description = "Construct an SQL agent from an LLM and tools."
|
||||
name = "SQLAgent"
|
||||
|
||||
def build_config(self):
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ class ToolCallingAgentComponent(Component):
|
|||
description: str = "Agent that uses tools. Only models that are compatible with function calling are supported."
|
||||
icon = "LangChain"
|
||||
beta = True
|
||||
name = "ToolCallingAgent"
|
||||
|
||||
inputs = [
|
||||
MessageTextInput(
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ from langflow.field_typing import LanguageModel
|
|||
class VectorStoreAgentComponent(CustomComponent):
|
||||
display_name = "VectorStoreAgent"
|
||||
description = "Construct an agent from a Vector Store."
|
||||
name = "VectorStoreAgent"
|
||||
|
||||
def build_config(self):
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ from langflow.custom import CustomComponent
|
|||
class VectorStoreRouterAgentComponent(CustomComponent):
|
||||
display_name = "VectorStoreRouterAgent"
|
||||
description = "Construct an agent from a Vector Store Router."
|
||||
name = "VectorStoreRouterAgent"
|
||||
|
||||
def build_config(self):
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ from langflow.schema import Data
|
|||
class XMLAgentComponent(LCAgentComponent):
|
||||
display_name = "XMLAgent"
|
||||
description = "Construct an XML agent from an LLM and tools."
|
||||
name = "XMLAgent"
|
||||
|
||||
def build_config(self):
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ from langflow.field_typing import BaseMemory, LanguageModel, Text
|
|||
class ConversationChainComponent(CustomComponent):
|
||||
display_name = "ConversationChain"
|
||||
description = "Chain to have a conversation and load context from memory."
|
||||
name = "ConversationChain"
|
||||
|
||||
def build_config(self):
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ from langflow.field_typing import BaseMemory, LanguageModel, Text
|
|||
class LLMChainComponent(CustomComponent):
|
||||
display_name = "LLMChain"
|
||||
description = "Chain to run queries against LLMs"
|
||||
name = "LLMChain"
|
||||
|
||||
def build_config(self):
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ class LLMCheckerChainComponent(CustomComponent):
|
|||
display_name = "LLMCheckerChain"
|
||||
description = ""
|
||||
documentation = "https://python.langchain.com/docs/modules/chains/additional/llm_checker"
|
||||
name = "LLMCheckerChain"
|
||||
|
||||
def build_config(self):
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ class LLMMathChainComponent(CustomComponent):
|
|||
display_name = "LLMMathChain"
|
||||
description = "Chain that interprets a prompt and executes python code to do math."
|
||||
documentation = "https://python.langchain.com/docs/modules/chains/additional/llm_math"
|
||||
name = "LLMMathChain"
|
||||
|
||||
def build_config(self):
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ from langflow.schema import Data
|
|||
class RetrievalQAComponent(CustomComponent):
|
||||
display_name = "Retrieval QA"
|
||||
description = "Chain for question-answering against an index."
|
||||
name = "RetrievalQA"
|
||||
|
||||
def build_config(self):
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ from langflow.field_typing import BaseMemory, BaseRetriever, LanguageModel, Text
|
|||
class RetrievalQAWithSourcesChainComponent(CustomComponent):
|
||||
display_name = "RetrievalQAWithSourcesChain"
|
||||
description = "Question-answering with sources over an index."
|
||||
name = "RetrievalQAWithSourcesChain"
|
||||
|
||||
def build_config(self):
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ from langflow.field_typing import LanguageModel, Text
|
|||
class SQLGeneratorComponent(CustomComponent):
|
||||
display_name = "Natural Language to SQL"
|
||||
description = "Generate SQL from natural language."
|
||||
name = "SQLGenerator"
|
||||
|
||||
def build_config(self):
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ class APIRequestComponent(Component):
|
|||
"**Note:** Check advanced options for more settings."
|
||||
)
|
||||
icon = "Globe"
|
||||
name = "APIRequest"
|
||||
|
||||
inputs = [
|
||||
MessageTextInput(
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ class DirectoryComponent(Component):
|
|||
display_name = "Directory"
|
||||
description = "Recursively load files from a directory."
|
||||
icon = "folder"
|
||||
name = "Directory"
|
||||
|
||||
inputs = [
|
||||
MessageTextInput(
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ class FileComponent(Component):
|
|||
display_name = "File"
|
||||
description = "A generic file loader."
|
||||
icon = "file-text"
|
||||
name = "File"
|
||||
|
||||
inputs = [
|
||||
FileInput(
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ class URLComponent(Component):
|
|||
display_name = "URL"
|
||||
description = "Fetch content from one or more URLs."
|
||||
icon = "layout-template"
|
||||
name = "URL"
|
||||
|
||||
inputs = [
|
||||
MessageTextInput(
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ from langflow.schema import Data
|
|||
class WebhookComponent(Component):
|
||||
display_name = "Webhook Input"
|
||||
description = "Defines a webhook input for the flow."
|
||||
name = "Webhook"
|
||||
|
||||
inputs = [
|
||||
MultilineInput(
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ class AgentComponent(LCAgentComponent):
|
|||
"memory",
|
||||
"input_value",
|
||||
]
|
||||
name = "AgentComponent"
|
||||
|
||||
def build_config(self):
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ from langflow.field_typing import Input, Output, Text
|
|||
class CodeBlockExtractor(Component):
|
||||
display_name = "Code Block Extractor"
|
||||
description = "Extracts code block from text."
|
||||
name = "CodeBlockExtractor"
|
||||
|
||||
inputs = [Input(name="text", field_type=Text, description="Text to extract code blocks from.")]
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ class DocumentsToDataComponent(CustomComponent):
|
|||
display_name = "Documents ⇢ Data"
|
||||
description = "Convert LangChain Documents into Data."
|
||||
icon = "LangChain"
|
||||
name = "DocumentsToData"
|
||||
|
||||
field_config = {
|
||||
"documents": {"display_name": "Documents"},
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ from langflow.schema import Data
|
|||
|
||||
class EmbedComponent(CustomComponent):
|
||||
display_name = "Embed Texts"
|
||||
name = "Embed"
|
||||
|
||||
def build_config(self):
|
||||
return {"texts": {"display_name": "Texts"}, "embbedings": {"display_name": "Embeddings"}}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ class ExtractKeyFromDataComponent(CustomComponent):
|
|||
display_name = "Extract Key From Data"
|
||||
description = "Extracts a key from a data."
|
||||
beta: bool = True
|
||||
name = "ExtractKeyFromData"
|
||||
|
||||
field_config = {
|
||||
"data": {"display_name": "Data"},
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ class ListFlowsComponent(CustomComponent):
|
|||
description = "A component to list all available flows."
|
||||
icon = "ListFlows"
|
||||
beta: bool = True
|
||||
name = "ListFlows"
|
||||
|
||||
def build_config(self):
|
||||
return {}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ class MergeDataComponent(CustomComponent):
|
|||
display_name = "Merge Data"
|
||||
description = "Merges data."
|
||||
beta: bool = True
|
||||
name = "MergeData"
|
||||
|
||||
field_config = {
|
||||
"data": {"display_name": "Data"},
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ from langflow.schema.message import Message
|
|||
class MessageComponent(CustomComponent):
|
||||
display_name = "Message"
|
||||
description = "Creates a Message object given a Session ID."
|
||||
name = "Message"
|
||||
|
||||
def build_config(self):
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ class SelectivePassThroughComponent(Component):
|
|||
display_name = "Selective Pass Through"
|
||||
description = "Passes the specified value if a specified condition is met."
|
||||
icon = "filter"
|
||||
name = "SelectivePassThrough"
|
||||
|
||||
inputs = [
|
||||
MessageTextInput(
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ from langflow.field_typing import LanguageModel, Text
|
|||
class ShouldRunNextComponent(CustomComponent):
|
||||
display_name = "Should Run Next"
|
||||
description = "Determines if a vertex is runnable."
|
||||
name = "ShouldRunNext"
|
||||
|
||||
def build(self, llm: LanguageModel, question: str, context: str, retries: int = 3) -> Text:
|
||||
template = "Given the following question and the context below, answer with a yes or no.\n\n{error_message}\n\nQuestion: {question}\n\nContext: {context}\n\nAnswer:"
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ class SplitTextComponent(Component):
|
|||
display_name: str = "Split Text"
|
||||
description: str = "Split text into chunks based on specified criteria."
|
||||
icon = "scissors-line-dashed"
|
||||
name = "SplitText"
|
||||
|
||||
inputs = [
|
||||
HandleInput(
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ from langflow.schema.message import Message
|
|||
class StoreMessageComponent(CustomComponent):
|
||||
display_name = "Store Message"
|
||||
description = "Stores a chat message."
|
||||
name = "StoreMessage"
|
||||
|
||||
def build_config(self):
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ class SubFlowComponent(CustomComponent):
|
|||
)
|
||||
beta: bool = True
|
||||
field_order = ["flow_name"]
|
||||
name = "SubFlow"
|
||||
|
||||
def get_flow_names(self) -> List[str]:
|
||||
flow_datas = self.list_flows()
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ class AmazonBedrockEmbeddingsComponent(LCModelComponent):
|
|||
description: str = "Generate embeddings using Amazon Bedrock models."
|
||||
documentation = "https://python.langchain.com/docs/modules/data_connection/text_embedding/integrations/bedrock"
|
||||
icon = "Amazon"
|
||||
name = "AmazonBedrockEmbeddings"
|
||||
|
||||
inputs = [
|
||||
DropdownInput(
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ class AstraVectorize(Component):
|
|||
description: str = "Configuration options for Astra Vectorize server-side embeddings."
|
||||
documentation: str = "https://docs.datastax.com/en/astra-db-serverless/databases/embedding-generation.html"
|
||||
icon = "AstraDB"
|
||||
name = "AstraVectorize"
|
||||
|
||||
VECTORIZE_PROVIDERS_MAPPING = {
|
||||
"Azure OpenAI": ["azureOpenAI", ["text-embedding-3-small", "text-embedding-3-large", "text-embedding-ada-002"]],
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ class AzureOpenAIEmbeddingsComponent(LCModelComponent):
|
|||
description: str = "Generate embeddings using Azure OpenAI models."
|
||||
documentation: str = "https://python.langchain.com/docs/integrations/text_embedding/azureopenai"
|
||||
icon = "Azure"
|
||||
name = "AzureOpenAIEmbeddings"
|
||||
|
||||
API_VERSION_OPTIONS = [
|
||||
"2022-12-01",
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ class CohereEmbeddingsComponent(LCModelComponent):
|
|||
display_name = "Cohere Embeddings"
|
||||
description = "Generate embeddings using Cohere models."
|
||||
icon = "Cohere"
|
||||
name = "CohereEmbeddings"
|
||||
|
||||
inputs = [
|
||||
SecretStrInput(name="cohere_api_key", display_name="Cohere API Key"),
|
||||
DropdownInput(
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ class HuggingFaceEmbeddingsComponent(LCModelComponent):
|
|||
"https://python.langchain.com/docs/modules/data_connection/text_embedding/integrations/sentence_transformers"
|
||||
)
|
||||
icon = "HuggingFace"
|
||||
name = "HuggingFaceEmbeddings"
|
||||
|
||||
inputs = [
|
||||
MessageTextInput(name="cache_folder", display_name="Cache Folder", advanced=True),
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ class HuggingFaceInferenceAPIEmbeddingsComponent(LCModelComponent):
|
|||
description = "Generate embeddings using Hugging Face Inference API models."
|
||||
documentation = "https://github.com/huggingface/text-embeddings-inference"
|
||||
icon = "HuggingFace"
|
||||
name = "HuggingFaceInferenceAPIEmbeddings"
|
||||
|
||||
inputs = [
|
||||
SecretStrInput(name="api_key", display_name="API Key", advanced=True),
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ class MistralAIEmbeddingsComponent(LCModelComponent):
|
|||
display_name = "MistralAI Embeddings"
|
||||
description = "Generate embeddings using MistralAI models."
|
||||
icon = "MistralAI"
|
||||
name = "MistalAIEmbeddings"
|
||||
|
||||
inputs = [
|
||||
DropdownInput(
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ class OllamaEmbeddingsComponent(LCModelComponent):
|
|||
description: str = "Generate embeddings using Ollama models."
|
||||
documentation = "https://python.langchain.com/docs/integrations/text_embedding/ollama"
|
||||
icon = "Ollama"
|
||||
name = "OllamaEmbeddings"
|
||||
|
||||
inputs = [
|
||||
MessageTextInput(
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ class OpenAIEmbeddingsComponent(LCEmbeddingsModel):
|
|||
display_name = "OpenAI Embeddings"
|
||||
description = "Generate embeddings using OpenAI models."
|
||||
icon = "OpenAI"
|
||||
name = "OpenAIEmbeddings"
|
||||
|
||||
inputs = [
|
||||
DictInput(
|
||||
name="default_headers",
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ class VertexAIEmbeddingsComponent(LCModelComponent):
|
|||
display_name = "VertexAI Embeddings"
|
||||
description = "Generate embeddings using Google Cloud VertexAI models."
|
||||
icon = "VertexAI"
|
||||
name = "VertexAIEmbeddings"
|
||||
|
||||
inputs = [
|
||||
FileInput(
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ class CombineTextComponent(Component):
|
|||
display_name = "Combine Text"
|
||||
description = "Concatenate two text sources into a single text chunk using a specified delimiter."
|
||||
icon = "merge"
|
||||
name = "CombineText"
|
||||
|
||||
inputs = [
|
||||
MessageTextInput(
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ class CreateListComponent(Component):
|
|||
display_name = "Create List"
|
||||
description = "Creates a list of texts."
|
||||
icon = "list"
|
||||
name = "CreateList"
|
||||
|
||||
inputs = [
|
||||
StrInput(
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ class CustomComponent(Component):
|
|||
description = "Use as a template to create your own component."
|
||||
documentation: str = "http://docs.langflow.org/components/custom"
|
||||
icon = "custom_components"
|
||||
name = "CustomComponent"
|
||||
|
||||
inputs = [
|
||||
MessageTextInput(name="input_value", display_name="Input Value", value="Hello, World!"),
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ class FilterDataComponent(Component):
|
|||
description = "Filters a Data object based on a list of keys."
|
||||
icon = "filter"
|
||||
beta = True
|
||||
name = "FilterData"
|
||||
|
||||
inputs = [
|
||||
DataInput(
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ from langflow.schema.dotdict import dotdict
|
|||
class IDGeneratorComponent(CustomComponent):
|
||||
display_name = "ID Generator"
|
||||
description = "Generates a unique ID."
|
||||
name = "IDGenerator"
|
||||
|
||||
def update_build_config( # type: ignore
|
||||
self, build_config: dotdict, field_value: Any, field_name: Optional[str] = None
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ class MemoryComponent(Component):
|
|||
display_name = "Chat Memory"
|
||||
description = "Retrieves stored chat messages."
|
||||
icon = "message-square-more"
|
||||
name = "Memory"
|
||||
|
||||
inputs = [
|
||||
DropdownInput(
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ class MergeDataComponent(CustomComponent):
|
|||
display_name = "Merge Data"
|
||||
description = "Combines multiple data sources into a single unified Data object."
|
||||
beta: bool = True
|
||||
name = "MergeData"
|
||||
|
||||
field_config = {
|
||||
"data": {"display_name": "Data"},
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ class ParseDataComponent(Component):
|
|||
display_name = "Parse Data"
|
||||
description = "Convert Data into plain text following a specified template."
|
||||
icon = "braces"
|
||||
name = "ParseData"
|
||||
|
||||
inputs = [
|
||||
DataInput(name="data", display_name="Data", info="The data to convert to text."),
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ class SplitTextComponent(Component):
|
|||
display_name: str = "Split Text"
|
||||
description: str = "Split text into chunks based on specified criteria."
|
||||
icon = "scissors-line-dashed"
|
||||
name = "SplitText"
|
||||
|
||||
inputs = [
|
||||
HandleInput(
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ class StoreMessageComponent(Component):
|
|||
display_name = "Store Message"
|
||||
description = "Stores a chat message or text."
|
||||
icon = "save"
|
||||
name = "StoreMessage"
|
||||
|
||||
inputs = [
|
||||
MessageInput(name="message", display_name="Message", info="The chat message to be stored.", required=True),
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ class ChatInput(ChatComponent):
|
|||
display_name = "Chat Input"
|
||||
description = "Get chat inputs from the Playground."
|
||||
icon = "ChatInput"
|
||||
name = "ChatInput"
|
||||
|
||||
inputs = [
|
||||
MultilineInput(
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ class TextInputComponent(TextComponent):
|
|||
display_name = "Text Input"
|
||||
description = "Get text inputs from the Playground."
|
||||
icon = "type"
|
||||
name = "TextInput"
|
||||
|
||||
inputs = [
|
||||
MessageTextInput(
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ from langflow.custom import CustomComponent
|
|||
class BingSearchAPIWrapperComponent(CustomComponent):
|
||||
display_name = "BingSearchAPIWrapper"
|
||||
description = "Wrapper for Bing Search API."
|
||||
name = "BingSearchAPIWrapper"
|
||||
|
||||
def build_config(self):
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@ from langflow.schema import Data
|
|||
class FirecrawlCrawlApi(CustomComponent):
|
||||
display_name: str = "FirecrawlCrawlApi"
|
||||
description: str = "Firecrawl Crawl API."
|
||||
name = "FirecrawlCrawlApi"
|
||||
|
||||
output_types: list[str] = ["Document"]
|
||||
documentation: str = "https://docs.firecrawl.dev/api-reference/endpoint/crawl"
|
||||
field_config = {
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ from langflow.schema import Data
|
|||
class FirecrawlScrapeApi(CustomComponent):
|
||||
display_name: str = "FirecrawlScrapeApi"
|
||||
description: str = "Firecrawl Scrape API."
|
||||
name = "FirecrawlScrapeApi"
|
||||
|
||||
output_types: list[str] = ["Document"]
|
||||
documentation: str = "https://docs.firecrawl.dev/api-reference/endpoint/scrape"
|
||||
field_config = {
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ from langflow.custom import CustomComponent
|
|||
class GoogleSearchAPIWrapperComponent(CustomComponent):
|
||||
display_name = "GoogleSearchAPIWrapper"
|
||||
description = "Wrapper for Google Search API."
|
||||
name = "GoogleSearchAPIWrapper"
|
||||
|
||||
def build_config(self):
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ from langflow.custom import CustomComponent
|
|||
class GoogleSerperAPIWrapperComponent(CustomComponent):
|
||||
display_name = "GoogleSerperAPIWrapper"
|
||||
description = "Wrapper around the Serper.dev Google Search API."
|
||||
name = "GoogleSerperAPIWrapper"
|
||||
|
||||
def build_config(self) -> Dict[str, Dict]:
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@ from langflow.services.database.models.base import orjson_dumps
|
|||
class JSONDocumentBuilder(CustomComponent):
|
||||
display_name: str = "JSON Document Builder"
|
||||
description: str = "Build a Document containing a JSON object using a key and another Document page content."
|
||||
name = "JSONDocumentBuilder"
|
||||
|
||||
output_types: list[str] = ["Document"]
|
||||
documentation: str = "https://docs.langflow.org/components/utilities#json-document-builder"
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ from langflow.custom import CustomComponent
|
|||
class SQLDatabaseComponent(CustomComponent):
|
||||
display_name = "SQLDatabase"
|
||||
description = "SQL Database"
|
||||
name = "SQLDatabase"
|
||||
|
||||
def build_config(self):
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -10,6 +10,8 @@ from langflow.services.database.models.base import orjson_dumps
|
|||
class SearchApi(CustomComponent):
|
||||
display_name: str = "SearchApi"
|
||||
description: str = "Real-time search engine results API."
|
||||
name = "SearchApi"
|
||||
|
||||
output_types: list[str] = ["Document"]
|
||||
documentation: str = "https://www.searchapi.io/docs/google"
|
||||
field_config = {
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ from langflow.custom import CustomComponent
|
|||
class SearxSearchWrapperComponent(CustomComponent):
|
||||
display_name = "SearxSearchWrapper"
|
||||
description = "Wrapper for Searx API."
|
||||
name = "SearxSearchWrapper"
|
||||
|
||||
def build_config(self):
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ from langflow.custom import CustomComponent
|
|||
class SerpAPIWrapperComponent(CustomComponent):
|
||||
display_name = "SerpAPIWrapper"
|
||||
description = "Wrapper around SerpAPI"
|
||||
name = "SerpAPIWrapper"
|
||||
|
||||
def build_config(self):
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ from langflow.custom import CustomComponent
|
|||
class WikipediaAPIWrapperComponent(CustomComponent):
|
||||
display_name = "WikipediaAPIWrapper"
|
||||
description = "Wrapper around WikipediaAPI."
|
||||
name = "WikipediaAPIWrapper"
|
||||
|
||||
def build_config(self):
|
||||
return {}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ from langflow.custom import CustomComponent
|
|||
class WolframAlphaAPIWrapperComponent(CustomComponent):
|
||||
display_name = "WolframAlphaAPIWrapper"
|
||||
description = "Wrapper for Wolfram Alpha."
|
||||
name = "WolframAlphaAPIWrapper"
|
||||
|
||||
def build_config(self):
|
||||
return {"appid": {"display_name": "App ID", "type": "str", "password": True}}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ from langflow.schema import Data
|
|||
class AstraDBMessageReaderComponent(BaseMemoryComponent):
|
||||
display_name = "Astra DB Message Reader"
|
||||
description = "Retrieves stored chat messages from Astra DB."
|
||||
name = "AstraDBMessageReader"
|
||||
|
||||
def build_config(self):
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ from langflow.schema import Data
|
|||
class AstraDBMessageWriterComponent(BaseMemoryComponent):
|
||||
display_name = "Astra DB Message Writer"
|
||||
description = "Writes a message to Astra DB."
|
||||
name = "AstraDBMessageWriter"
|
||||
|
||||
def build_config(self):
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ from langflow.schema.data import Data
|
|||
class CassandraMessageReaderComponent(BaseMemoryComponent):
|
||||
display_name = "Cassandra Message Reader"
|
||||
description = "Retrieves stored chat messages from a Cassandra table on Astra DB."
|
||||
name = "CassandraMessageReader"
|
||||
|
||||
def build_config(self):
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ from langflow.schema.data import Data
|
|||
class CassandraMessageWriterComponent(BaseMemoryComponent):
|
||||
display_name = "Cassandra Message Writer"
|
||||
description = "Writes a message to a Cassandra table on Astra DB."
|
||||
name = "CassandraMessageWriter"
|
||||
|
||||
def build_config(self):
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ from langflow.schema import Data
|
|||
class ZepMessageReaderComponent(BaseMemoryComponent):
|
||||
display_name = "Zep Message Reader"
|
||||
description = "Retrieves stored chat messages from Zep."
|
||||
name = "ZepMessageReader"
|
||||
|
||||
def build_config(self):
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ if TYPE_CHECKING:
|
|||
class ZepMessageWriterComponent(BaseMemoryComponent):
|
||||
display_name = "Zep Message Writer"
|
||||
description = "Writes a message to Zep."
|
||||
name = "ZepMessageWriter"
|
||||
|
||||
def build_config(self):
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ class AmazonBedrockComponent(LCModelComponent):
|
|||
display_name: str = "Amazon Bedrock"
|
||||
description: str = "Generate text using Amazon Bedrock LLMs."
|
||||
icon = "Amazon"
|
||||
name = "AmazonBedrockModel"
|
||||
|
||||
inputs = [
|
||||
MessageInput(name="input_value", display_name="Input"),
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ class AnthropicModelComponent(LCModelComponent):
|
|||
display_name = "Anthropic"
|
||||
description = "Generate text using Anthropic Chat&Completion LLMs with prefill support."
|
||||
icon = "Anthropic"
|
||||
name = "AnthropicModel"
|
||||
|
||||
inputs = [
|
||||
MessageTextInput(name="input_value", display_name="Input"),
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ class AzureChatOpenAIComponent(LCModelComponent):
|
|||
documentation: str = "https://python.langchain.com/docs/integrations/llms/azure_openai"
|
||||
beta = False
|
||||
icon = "Azure"
|
||||
name = "AzureOpenAIModel"
|
||||
|
||||
AZURE_OPENAI_API_VERSIONS = [
|
||||
"2023-03-15-preview",
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ class QianfanChatEndpointComponent(LCModelComponent):
|
|||
description: str = "Generate text using Baidu Qianfan LLMs."
|
||||
documentation: str = "https://python.langchain.com/docs/integrations/chat/baidu_qianfan_endpoint"
|
||||
icon = "BaiduQianfan"
|
||||
name = "BaiduQianfanChatModel"
|
||||
|
||||
inputs = [
|
||||
MessageTextInput(
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ class CohereComponent(LCModelComponent):
|
|||
description = "Generate text using Cohere LLMs."
|
||||
documentation = "https://python.langchain.com/docs/modules/model_io/models/llms/integrations/cohere"
|
||||
icon = "Cohere"
|
||||
name = "CohereModel"
|
||||
|
||||
inputs = [
|
||||
SecretStrInput(
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ class GoogleGenerativeAIComponent(LCModelComponent):
|
|||
display_name = "Google Generative AI"
|
||||
description = "Generate text using Google Generative AI."
|
||||
icon = "GoogleGenerativeAI"
|
||||
name = "GoogleGenerativeAIModel"
|
||||
|
||||
inputs = [
|
||||
MessageInput(name="input_value", display_name="Input"),
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ class GroqModel(LCModelComponent):
|
|||
display_name: str = "Groq"
|
||||
description: str = "Generate text using Groq."
|
||||
icon = "Groq"
|
||||
name = "GroqModel"
|
||||
|
||||
inputs = [
|
||||
SecretStrInput(
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ class HuggingFaceEndpointsComponent(LCModelComponent):
|
|||
display_name: str = "Hugging Face API"
|
||||
description: str = "Generate text using Hugging Face Inference APIs."
|
||||
icon = "HuggingFace"
|
||||
name = "HuggingFaceModel"
|
||||
|
||||
inputs = [
|
||||
MessageInput(name="input_value", display_name="Input"),
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ class MistralAIModelComponent(LCModelComponent):
|
|||
display_name = "MistralAI"
|
||||
description = "Generates text using MistralAI LLMs."
|
||||
icon = "MistralAI"
|
||||
name = "MistralModel"
|
||||
|
||||
inputs = [
|
||||
MessageInput(name="input_value", display_name="Input"),
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ class ChatOllamaComponent(LCModelComponent):
|
|||
display_name = "Ollama"
|
||||
description = "Generate text using Ollama Local LLMs."
|
||||
icon = "Ollama"
|
||||
name = "OllamaModel"
|
||||
|
||||
def update_build_config(self, build_config: dict, field_value: Any, field_name: str | None = None):
|
||||
if field_name == "mirostat":
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ class OpenAIModelComponent(LCModelComponent):
|
|||
display_name = "OpenAI"
|
||||
description = "Generates text using OpenAI LLMs."
|
||||
icon = "OpenAI"
|
||||
name = "OpenAIModel"
|
||||
|
||||
inputs = [
|
||||
MessageInput(name="input_value", display_name="Input"),
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ class ChatVertexAIComponent(LCModelComponent):
|
|||
display_name = "Vertex AI"
|
||||
description = "Generate text using Vertex AI LLMs."
|
||||
icon = "VertexAI"
|
||||
name = "VertexAiModel"
|
||||
|
||||
inputs = [
|
||||
MessageInput(name="input_value", display_name="Input"),
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ class ChatOutput(ChatComponent):
|
|||
display_name = "Chat Output"
|
||||
description = "Display a chat message in the Playground."
|
||||
icon = "ChatOutput"
|
||||
name = "ChatOutput"
|
||||
|
||||
inputs = [
|
||||
MessageTextInput(
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ class TextOutputComponent(TextComponent):
|
|||
display_name = "Text Output"
|
||||
description = "Display a text output in the Playground."
|
||||
icon = "type"
|
||||
name = "TextOutput"
|
||||
|
||||
inputs = [
|
||||
MessageTextInput(
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ class PromptComponent(Component):
|
|||
description: str = "Create a prompt template with dynamic variables."
|
||||
icon = "prompts"
|
||||
trace_type = "prompt"
|
||||
name = "Prompt"
|
||||
|
||||
inputs = [
|
||||
PromptInput(name="template", display_name="Template"),
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ class ConditionalRouterComponent(Component):
|
|||
display_name = "Conditional Router"
|
||||
description = "Routes an input message to a corresponding output based on text comparison."
|
||||
icon = "equal"
|
||||
name = "ConditionalRouter"
|
||||
|
||||
inputs = [
|
||||
MessageTextInput(
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ from langflow.template.field.base import Input
|
|||
class CreateDataComponent(Component):
|
||||
display_name: str = "Create Data"
|
||||
description: str = "Dynamically create a Data with a specified number of fields."
|
||||
name: str = "CreateData"
|
||||
|
||||
inputs = [
|
||||
IntInput(
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ class FlowToolComponent(CustomComponent):
|
|||
description = "Construct a Tool from a function that runs the loaded Flow."
|
||||
field_order = ["flow_name", "name", "description", "return_direct"]
|
||||
trace_type = "tool"
|
||||
name = "FlowTool"
|
||||
beta = True
|
||||
|
||||
def get_flow_names(self) -> List[str]:
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ from langflow.schema import Data
|
|||
class ListenComponent(CustomComponent):
|
||||
display_name = "Listen"
|
||||
description = "A component to listen for a notification."
|
||||
name = "Listen"
|
||||
beta: bool = True
|
||||
|
||||
def build_config(self):
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ class NotifyComponent(CustomComponent):
|
|||
display_name = "Notify"
|
||||
description = "A component to generate a notification to Get Notified component."
|
||||
icon = "Notify"
|
||||
name = "Notify"
|
||||
beta: bool = True
|
||||
|
||||
def build_config(self):
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ from langflow.template import Output
|
|||
class PassMessageComponent(Component):
|
||||
display_name = "Pass"
|
||||
description = "Forwards the input message, unchanged."
|
||||
name = "Pass"
|
||||
icon = "arrow-right"
|
||||
|
||||
inputs = [
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ class PythonFunctionComponent(CustomComponent):
|
|||
display_name = "Python Function"
|
||||
description = "Define a Python function."
|
||||
icon = "Python"
|
||||
name = "PythonFunction"
|
||||
beta = True
|
||||
|
||||
def build_config(self):
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ from langflow.schema import Data, dotdict
|
|||
class RunFlowComponent(CustomComponent):
|
||||
display_name = "Run Flow"
|
||||
description = "A component to run a flow."
|
||||
name = "RunFlow"
|
||||
beta: bool = True
|
||||
|
||||
def get_flow_names(self) -> List[str]:
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ from langflow.field_typing import Text
|
|||
class RunnableExecComponent(CustomComponent):
|
||||
description = "Execute a runnable. It will try to guess the input and output keys."
|
||||
display_name = "Runnable Executor"
|
||||
name = "RunnableExecutor"
|
||||
beta: bool = True
|
||||
field_order = [
|
||||
"input_key",
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ from langflow.field_typing import Text
|
|||
class SQLExecutorComponent(CustomComponent):
|
||||
display_name = "SQL Executor"
|
||||
description = "Execute SQL query."
|
||||
name = "SQLExecutor"
|
||||
beta: bool = True
|
||||
|
||||
def build_config(self):
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ class SubFlowComponent(CustomComponent):
|
|||
description = (
|
||||
"Dynamically Generates a Component from a Flow. The output is a list of data with keys 'result' and 'message'."
|
||||
)
|
||||
name = "SubFlow"
|
||||
beta: bool = True
|
||||
field_order = ["flow_name"]
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ from langflow.schema import Data
|
|||
class UpdateDataComponent(CustomComponent):
|
||||
display_name = "Update Data"
|
||||
description = "Update Data with text-based key/value pairs, similar to updating a Python dictionary."
|
||||
name = "UpdateData"
|
||||
|
||||
def build_config(self):
|
||||
return {
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue