refactor: rename TextInput to MessageTextInput
This commit is contained in:
parent
4d7cee23d8
commit
93a2164543
35 changed files with 119 additions and 112 deletions
|
|
@ -5,7 +5,7 @@ from langchain.agents.tool_calling_agent.base import create_tool_calling_agent
|
|||
from langchain_core.prompts import ChatPromptTemplate
|
||||
|
||||
from langflow.custom import Component
|
||||
from langflow.io import BoolInput, HandleInput, Output, TextInput
|
||||
from langflow.io import BoolInput, HandleInput, MessageTextInput, Output
|
||||
from langflow.schema import Data
|
||||
from langflow.schema.message import Message
|
||||
|
||||
|
|
@ -16,18 +16,18 @@ class ToolCallingAgentComponent(Component):
|
|||
icon = "LangChain"
|
||||
|
||||
inputs = [
|
||||
TextInput(
|
||||
MessageTextInput(
|
||||
name="system_prompt",
|
||||
display_name="System Prompt",
|
||||
info="System prompt for the agent.",
|
||||
value="You are a helpful assistant",
|
||||
),
|
||||
TextInput(
|
||||
MessageTextInput(
|
||||
name="input_value",
|
||||
display_name="Inputs",
|
||||
info="Input text to pass to the agent.",
|
||||
),
|
||||
TextInput(
|
||||
MessageTextInput(
|
||||
name="user_prompt",
|
||||
display_name="Prompt",
|
||||
info="This prompt must contain 'input' key.",
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ from loguru import logger
|
|||
|
||||
from langflow.base.curl.parse import parse_context
|
||||
from langflow.custom import Component
|
||||
from langflow.io import DataInput, DropdownInput, IntInput, NestedDictInput, Output, TextInput
|
||||
from langflow.io import DataInput, DropdownInput, IntInput, MessageTextInput, NestedDictInput, Output
|
||||
from langflow.schema import Data
|
||||
from langflow.schema.dotdict import dotdict
|
||||
|
||||
|
|
@ -24,13 +24,13 @@ class APIRequestComponent(Component):
|
|||
icon = "Globe"
|
||||
|
||||
inputs = [
|
||||
TextInput(
|
||||
MessageTextInput(
|
||||
name="urls",
|
||||
display_name="URLs",
|
||||
is_list=True,
|
||||
info="Enter one or more URLs, separated by commas.",
|
||||
),
|
||||
TextInput(
|
||||
MessageTextInput(
|
||||
name="curl",
|
||||
display_name="Curl",
|
||||
info="Paste a curl command to populate the fields. This will fill in the dictionary fields for headers and body.",
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ from typing import List, Optional
|
|||
|
||||
from langflow.base.data.utils import parallel_load_data, parse_text_file_to_data, retrieve_file_paths
|
||||
from langflow.custom import Component
|
||||
from langflow.io import BoolInput, IntInput, TextInput
|
||||
from langflow.io import BoolInput, IntInput, MessageTextInput
|
||||
from langflow.schema import Data
|
||||
from langflow.template import Output
|
||||
|
||||
|
|
@ -13,12 +13,12 @@ class DirectoryComponent(Component):
|
|||
icon = "folder"
|
||||
|
||||
inputs = [
|
||||
TextInput(
|
||||
MessageTextInput(
|
||||
name="path",
|
||||
display_name="Path",
|
||||
info="Path to the directory to load files from.",
|
||||
),
|
||||
TextInput(
|
||||
MessageTextInput(
|
||||
name="types",
|
||||
display_name="Types",
|
||||
info="File types to load. Leave empty to load all types.",
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import re
|
|||
from langchain_community.document_loaders.web_base import WebBaseLoader
|
||||
|
||||
from langflow.custom import Component
|
||||
from langflow.io import Output, TextInput
|
||||
from langflow.io import MessageTextInput, Output
|
||||
from langflow.schema import Data
|
||||
|
||||
|
||||
|
|
@ -13,7 +13,7 @@ class URLComponent(Component):
|
|||
icon = "layout-template"
|
||||
|
||||
inputs = [
|
||||
TextInput(
|
||||
MessageTextInput(
|
||||
name="urls",
|
||||
display_name="URLs",
|
||||
info="Enter one or more URLs, separated by commas.",
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
from langchain_community.embeddings import BedrockEmbeddings
|
||||
|
||||
from langflow.base.models.model import LCModelComponent
|
||||
from langflow.field_typing import Embeddings
|
||||
from langflow.io import DropdownInput, Output, TextInput
|
||||
from langflow.io import DropdownInput, MessageTextInput, Output
|
||||
|
||||
|
||||
class AmazonBedrockEmbeddingsComponent(LCModelComponent):
|
||||
|
|
@ -17,15 +18,15 @@ class AmazonBedrockEmbeddingsComponent(LCModelComponent):
|
|||
options=["amazon.titan-embed-text-v1"],
|
||||
value="amazon.titan-embed-text-v1",
|
||||
),
|
||||
TextInput(
|
||||
MessageTextInput(
|
||||
name="credentials_profile_name",
|
||||
display_name="Credentials Profile Name",
|
||||
),
|
||||
TextInput(
|
||||
MessageTextInput(
|
||||
name="endpoint_url",
|
||||
display_name="Bedrock Endpoint URL",
|
||||
),
|
||||
TextInput(
|
||||
MessageTextInput(
|
||||
name="region_name",
|
||||
display_name="AWS Region",
|
||||
),
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ from pydantic.v1 import SecretStr
|
|||
|
||||
from langflow.base.models.model import LCModelComponent
|
||||
from langflow.field_typing import Embeddings
|
||||
from langflow.io import DropdownInput, IntInput, Output, SecretStrInput, TextInput
|
||||
from langflow.io import DropdownInput, IntInput, MessageTextInput, Output, SecretStrInput
|
||||
|
||||
|
||||
class AzureOpenAIEmbeddingsComponent(LCModelComponent):
|
||||
|
|
@ -22,13 +22,13 @@ class AzureOpenAIEmbeddingsComponent(LCModelComponent):
|
|||
]
|
||||
|
||||
inputs = [
|
||||
TextInput(
|
||||
MessageTextInput(
|
||||
name="azure_endpoint",
|
||||
display_name="Azure Endpoint",
|
||||
required=True,
|
||||
info="Your Azure endpoint, including the resource. Example: `https://example-resource.azure.openai.com/`",
|
||||
),
|
||||
TextInput(
|
||||
MessageTextInput(
|
||||
name="azure_deployment",
|
||||
display_name="Deployment Name",
|
||||
required=True,
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ from langchain_community.embeddings.cohere import CohereEmbeddings
|
|||
|
||||
from langflow.base.models.model import LCModelComponent
|
||||
from langflow.field_typing import Embeddings
|
||||
from langflow.io import DropdownInput, FloatInput, IntInput, Output, SecretStrInput, TextInput
|
||||
from langflow.io import DropdownInput, FloatInput, IntInput, MessageTextInput, Output, SecretStrInput
|
||||
|
||||
|
||||
class CohereEmbeddingsComponent(LCModelComponent):
|
||||
|
|
@ -23,9 +23,9 @@ class CohereEmbeddingsComponent(LCModelComponent):
|
|||
],
|
||||
value="embed-english-v2.0",
|
||||
),
|
||||
TextInput(name="truncate", display_name="Truncate", advanced=True),
|
||||
MessageTextInput(name="truncate", display_name="Truncate", advanced=True),
|
||||
IntInput(name="max_retries", display_name="Max Retries", value=3, advanced=True),
|
||||
TextInput(name="user_agent", display_name="User Agent", advanced=True, value="langchain"),
|
||||
MessageTextInput(name="user_agent", display_name="User Agent", advanced=True, value="langchain"),
|
||||
FloatInput(name="request_timeout", display_name="Request Timeout", advanced=True),
|
||||
]
|
||||
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ from langchain_community.embeddings.huggingface import HuggingFaceEmbeddings
|
|||
|
||||
from langflow.base.models.model import LCModelComponent
|
||||
from langflow.field_typing import Embeddings
|
||||
from langflow.io import BoolInput, DictInput, TextInput, Output
|
||||
from langflow.io import BoolInput, DictInput, MessageTextInput, Output
|
||||
|
||||
|
||||
class HuggingFaceEmbeddingsComponent(LCModelComponent):
|
||||
|
|
@ -14,10 +14,10 @@ class HuggingFaceEmbeddingsComponent(LCModelComponent):
|
|||
icon = "HuggingFace"
|
||||
|
||||
inputs = [
|
||||
TextInput(name="cache_folder", display_name="Cache Folder", advanced=True),
|
||||
MessageTextInput(name="cache_folder", display_name="Cache Folder", advanced=True),
|
||||
DictInput(name="encode_kwargs", display_name="Encode Kwargs", advanced=True),
|
||||
DictInput(name="model_kwargs", display_name="Model Kwargs", advanced=True),
|
||||
TextInput(name="model_name", display_name="Model Name", value="sentence-transformers/all-mpnet-base-v2"),
|
||||
MessageTextInput(name="model_name", display_name="Model Name", value="sentence-transformers/all-mpnet-base-v2"),
|
||||
BoolInput(name="multi_process", display_name="Multi Process", advanced=True),
|
||||
]
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ from pydantic.v1.types import SecretStr
|
|||
|
||||
from langflow.base.models.model import LCModelComponent
|
||||
from langflow.field_typing import Embeddings
|
||||
from langflow.io import Output, SecretStrInput, TextInput
|
||||
from langflow.io import MessageTextInput, Output, SecretStrInput
|
||||
|
||||
|
||||
class HuggingFaceInferenceAPIEmbeddingsComponent(LCModelComponent):
|
||||
|
|
@ -14,8 +14,8 @@ class HuggingFaceInferenceAPIEmbeddingsComponent(LCModelComponent):
|
|||
|
||||
inputs = [
|
||||
SecretStrInput(name="api_key", display_name="API Key", advanced=True),
|
||||
TextInput(name="api_url", display_name="API URL", advanced=True, value="http://localhost:8080"),
|
||||
TextInput(name="model_name", display_name="Model Name", value="BAAI/bge-large-en-v1.5"),
|
||||
MessageTextInput(name="api_url", display_name="API URL", advanced=True, value="http://localhost:8080"),
|
||||
MessageTextInput(name="model_name", display_name="Model Name", value="BAAI/bge-large-en-v1.5"),
|
||||
]
|
||||
|
||||
outputs = [
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ from pydantic.v1 import SecretStr
|
|||
|
||||
from langflow.base.models.model import LCModelComponent
|
||||
from langflow.field_typing import Embeddings
|
||||
from langflow.io import DropdownInput, IntInput, Output, SecretStrInput, TextInput
|
||||
from langflow.io import DropdownInput, IntInput, MessageTextInput, Output, SecretStrInput
|
||||
|
||||
|
||||
class MistralAIEmbeddingsComponent(LCModelComponent):
|
||||
|
|
@ -28,7 +28,7 @@ class MistralAIEmbeddingsComponent(LCModelComponent):
|
|||
),
|
||||
IntInput(name="max_retries", display_name="Max Retries", advanced=True, value=5),
|
||||
IntInput(name="timeout", display_name="Request Timeout", advanced=True, value=120),
|
||||
TextInput(
|
||||
MessageTextInput(
|
||||
name="endpoint",
|
||||
display_name="API Endpoint",
|
||||
advanced=True,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,8 @@
|
|||
from langchain_community.embeddings import OllamaEmbeddings
|
||||
|
||||
from langflow.base.models.model import LCModelComponent
|
||||
from langflow.field_typing import Embeddings
|
||||
from langflow.io import FloatInput, Output, TextInput
|
||||
from langflow.io import FloatInput, MessageTextInput, Output
|
||||
|
||||
|
||||
class OllamaEmbeddingsComponent(LCModelComponent):
|
||||
|
|
@ -11,12 +12,12 @@ class OllamaEmbeddingsComponent(LCModelComponent):
|
|||
icon = "Ollama"
|
||||
|
||||
inputs = [
|
||||
TextInput(
|
||||
MessageTextInput(
|
||||
name="model",
|
||||
display_name="Ollama Model",
|
||||
value="llama2",
|
||||
),
|
||||
TextInput(
|
||||
MessageTextInput(
|
||||
name="base_url",
|
||||
display_name="Ollama Base URL",
|
||||
value="http://localhost:11434",
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ from langchain_openai.embeddings.base import OpenAIEmbeddings
|
|||
|
||||
from langflow.base.embeddings.model import LCEmbeddingsModel
|
||||
from langflow.field_typing import Embeddings
|
||||
from langflow.io import BoolInput, DictInput, DropdownInput, FloatInput, IntInput, SecretStrInput, TextInput
|
||||
from langflow.io import BoolInput, DictInput, DropdownInput, FloatInput, IntInput, MessageTextInput, SecretStrInput
|
||||
|
||||
|
||||
class OpenAIEmbeddingsComponent(LCEmbeddingsModel):
|
||||
|
|
@ -23,8 +23,8 @@ class OpenAIEmbeddingsComponent(LCEmbeddingsModel):
|
|||
info="Default query parameters to use for the API request.",
|
||||
),
|
||||
IntInput(name="chunk_size", display_name="Chunk Size", advanced=True, value=1000),
|
||||
TextInput(name="client", display_name="Client", advanced=True),
|
||||
TextInput(name="deployment", display_name="Deployment", advanced=True),
|
||||
MessageTextInput(name="client", display_name="Client", advanced=True),
|
||||
MessageTextInput(name="deployment", display_name="Deployment", advanced=True),
|
||||
IntInput(name="embedding_ctx_length", display_name="Embedding Context Length", advanced=True, value=1536),
|
||||
IntInput(name="max_retries", display_name="Max Retries", value=3, advanced=True),
|
||||
DropdownInput(
|
||||
|
|
@ -42,17 +42,17 @@ class OpenAIEmbeddingsComponent(LCEmbeddingsModel):
|
|||
SecretStrInput(name="openai_api_base", display_name="OpenAI API Base", advanced=True),
|
||||
SecretStrInput(name="openai_api_key", display_name="OpenAI API Key"),
|
||||
SecretStrInput(name="openai_api_type", display_name="OpenAI API Type", advanced=True),
|
||||
TextInput(name="openai_api_version", display_name="OpenAI API Version", advanced=True),
|
||||
TextInput(
|
||||
MessageTextInput(name="openai_api_version", display_name="OpenAI API Version", advanced=True),
|
||||
MessageTextInput(
|
||||
name="openai_organization",
|
||||
display_name="OpenAI Organization",
|
||||
advanced=True,
|
||||
),
|
||||
TextInput(name="openai_proxy", display_name="OpenAI Proxy", advanced=True),
|
||||
MessageTextInput(name="openai_proxy", display_name="OpenAI Proxy", advanced=True),
|
||||
FloatInput(name="request_timeout", display_name="Request Timeout", advanced=True),
|
||||
BoolInput(name="show_progress_bar", display_name="Show Progress Bar", advanced=True),
|
||||
BoolInput(name="skip_empty", display_name="Skip Empty", advanced=True),
|
||||
TextInput(
|
||||
MessageTextInput(
|
||||
name="tiktoken_model_name",
|
||||
display_name="TikToken Model Name",
|
||||
advanced=True,
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from langflow.base.models.model import LCModelComponent
|
||||
from langflow.field_typing import Embeddings
|
||||
from langflow.io import BoolInput, DictInput, FileInput, FloatInput, IntInput, Output, TextInput
|
||||
from langflow.io import BoolInput, DictInput, FileInput, FloatInput, IntInput, MessageTextInput, Output
|
||||
|
||||
|
||||
class VertexAIEmbeddingsComponent(LCModelComponent):
|
||||
|
|
@ -20,7 +20,7 @@ class VertexAIEmbeddingsComponent(LCModelComponent):
|
|||
display_name="Instance",
|
||||
advanced=True,
|
||||
),
|
||||
TextInput(
|
||||
MessageTextInput(
|
||||
name="location",
|
||||
display_name="Location",
|
||||
value="us-central1",
|
||||
|
|
@ -37,7 +37,7 @@ class VertexAIEmbeddingsComponent(LCModelComponent):
|
|||
value=6,
|
||||
advanced=True,
|
||||
),
|
||||
TextInput(
|
||||
MessageTextInput(
|
||||
name="model_name",
|
||||
display_name="Model Name",
|
||||
value="textembedding-gecko",
|
||||
|
|
@ -48,7 +48,7 @@ class VertexAIEmbeddingsComponent(LCModelComponent):
|
|||
value=1,
|
||||
advanced=True,
|
||||
),
|
||||
TextInput(
|
||||
MessageTextInput(
|
||||
name="project",
|
||||
display_name="Project",
|
||||
advanced=True,
|
||||
|
|
@ -59,7 +59,7 @@ class VertexAIEmbeddingsComponent(LCModelComponent):
|
|||
value=5,
|
||||
advanced=True,
|
||||
),
|
||||
TextInput(
|
||||
MessageTextInput(
|
||||
name="stop",
|
||||
display_name="Stop",
|
||||
advanced=True,
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
from langflow.custom import Component
|
||||
from langflow.io import BoolInput, DropdownInput, MessageInput, Output, TextInput
|
||||
from langflow.io import BoolInput, DropdownInput, MessageInput, MessageTextInput, Output
|
||||
from langflow.schema.message import Message
|
||||
|
||||
|
||||
|
|
@ -9,12 +9,12 @@ class ConditionalRouterComponent(Component):
|
|||
icon = "equal"
|
||||
|
||||
inputs = [
|
||||
TextInput(
|
||||
MessageTextInput(
|
||||
name="input_text",
|
||||
display_name="Input Text",
|
||||
info="The primary text input for the operation.",
|
||||
),
|
||||
TextInput(
|
||||
MessageTextInput(
|
||||
name="match_text",
|
||||
display_name="Match Text",
|
||||
info="The text input to compare against.",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from langflow.custom import Component
|
||||
from langflow.field_typing import Text
|
||||
from langflow.io import BoolInput, DropdownInput, Output, TextInput
|
||||
from langflow.io import BoolInput, DropdownInput, MessageTextInput, Output
|
||||
|
||||
|
||||
class SelectivePassThroughComponent(Component):
|
||||
|
|
@ -9,12 +9,12 @@ class SelectivePassThroughComponent(Component):
|
|||
icon = "filter"
|
||||
|
||||
inputs = [
|
||||
TextInput(
|
||||
MessageTextInput(
|
||||
name="input_value",
|
||||
display_name="Input Value",
|
||||
info="The primary input value to evaluate.",
|
||||
),
|
||||
TextInput(
|
||||
MessageTextInput(
|
||||
name="comparison_value",
|
||||
display_name="Comparison Value",
|
||||
info="The value to compare against the input value.",
|
||||
|
|
@ -25,7 +25,7 @@ class SelectivePassThroughComponent(Component):
|
|||
options=["equals", "not equals", "contains", "starts with", "ends with"],
|
||||
info="Condition to evaluate the input value.",
|
||||
),
|
||||
TextInput(
|
||||
MessageTextInput(
|
||||
name="value_to_pass",
|
||||
display_name="Value to Pass",
|
||||
info="The value to pass if the condition is met.",
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
from typing import List
|
||||
|
||||
from langchain_text_splitters import CharacterTextSplitter
|
||||
|
||||
from langflow.custom import Component
|
||||
from langflow.io import HandleInput, IntInput, Output, TextInput
|
||||
from langflow.io import HandleInput, IntInput, MessageTextInput, Output
|
||||
from langflow.schema import Data
|
||||
from langflow.utils.util import unescape_string
|
||||
|
||||
|
|
@ -32,7 +33,7 @@ class SplitTextComponent(Component):
|
|||
info="The maximum number of characters in each chunk.",
|
||||
value=1000,
|
||||
),
|
||||
TextInput(
|
||||
MessageTextInput(
|
||||
name="separator",
|
||||
display_name="Separator",
|
||||
info="The character to split on. Defaults to newline.",
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
from langflow.custom import Component
|
||||
from langflow.io import Output, TextInput
|
||||
from langflow.io import MessageTextInput, Output
|
||||
from langflow.schema.message import Message
|
||||
|
||||
|
||||
|
|
@ -9,17 +9,17 @@ class CombineTextComponent(Component):
|
|||
icon = "merge"
|
||||
|
||||
inputs = [
|
||||
TextInput(
|
||||
MessageTextInput(
|
||||
name="text1",
|
||||
display_name="First Text",
|
||||
info="The first text input to concatenate.",
|
||||
),
|
||||
TextInput(
|
||||
MessageTextInput(
|
||||
name="text2",
|
||||
display_name="Second Text",
|
||||
info="The second text input to concatenate.",
|
||||
),
|
||||
TextInput(
|
||||
MessageTextInput(
|
||||
name="delimiter",
|
||||
display_name="Delimiter",
|
||||
info="A string used to separate the two text inputs. Defaults to a whitespace.",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
# from langflow.field_typing import Data
|
||||
from langflow.custom import Component
|
||||
from langflow.io import Output, TextInput
|
||||
from langflow.io import MessageTextInput, Output
|
||||
from langflow.schema import Data
|
||||
|
||||
|
||||
|
|
@ -11,7 +11,7 @@ class CustomComponent(Component):
|
|||
icon = "custom_components"
|
||||
|
||||
inputs = [
|
||||
TextInput(name="input_value", display_name="Input Value", value="Hello, World!"),
|
||||
MessageTextInput(name="input_value", display_name="Input Value", value="Hello, World!"),
|
||||
]
|
||||
|
||||
outputs = [
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
from typing import List
|
||||
|
||||
from langflow.custom import Component
|
||||
from langflow.io import DataInput, Output, TextInput
|
||||
from langflow.io import DataInput, MessageTextInput, Output
|
||||
from langflow.schema import Data
|
||||
|
||||
|
||||
|
|
@ -16,7 +16,7 @@ class FilterDataComponent(Component):
|
|||
display_name="Data",
|
||||
info="Data object to filter.",
|
||||
),
|
||||
TextInput(
|
||||
MessageTextInput(
|
||||
name="filter_criteria",
|
||||
display_name="Filter Criteria",
|
||||
info="List of keys to filter by.",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
from langflow.custom import Component
|
||||
from langflow.helpers.data import data_to_text
|
||||
from langflow.io import DropdownInput, IntInput, MultilineInput, Output, TextInput
|
||||
from langflow.io import DropdownInput, IntInput, MessageTextInput, MultilineInput, Output
|
||||
from langflow.memory import get_messages
|
||||
from langflow.schema import Data
|
||||
from langflow.schema.message import Message
|
||||
|
|
@ -20,7 +20,7 @@ class MemoryComponent(Component):
|
|||
info="Type of sender.",
|
||||
advanced=True,
|
||||
),
|
||||
TextInput(
|
||||
MessageTextInput(
|
||||
name="sender_name",
|
||||
display_name="Sender Name",
|
||||
info="Name of the sender.",
|
||||
|
|
@ -33,7 +33,7 @@ class MemoryComponent(Component):
|
|||
info="Number of messages to retrieve.",
|
||||
advanced=True,
|
||||
),
|
||||
TextInput(
|
||||
MessageTextInput(
|
||||
name="session_id",
|
||||
display_name="Session ID",
|
||||
info="Session ID of the chat history.",
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue