From b0e6e421150fb2b0806a58329c25f20a39b1a1de Mon Sep 17 00:00:00 2001 From: Rodrigo Date: Wed, 12 Jun 2024 19:41:25 -0300 Subject: [PATCH] ```text refactor: Add value attribute to ChatInput Add a new value attribute to the ChatInput class in ChatInput.py. This allows for the pre-filling of the input field with a default value. --- src/backend/base/langflow/components/inputs/ChatInput.py | 1 + src/backend/base/langflow/components/inputs/TextInput.py | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/backend/base/langflow/components/inputs/ChatInput.py b/src/backend/base/langflow/components/inputs/ChatInput.py index 459d7b70b..f6db2e6d3 100644 --- a/src/backend/base/langflow/components/inputs/ChatInput.py +++ b/src/backend/base/langflow/components/inputs/ChatInput.py @@ -15,6 +15,7 @@ class ChatInput(ChatComponent): display_name="Text", multiline=True, input_types=[], + value="", info="Message to be passed as input.", ), DropdownInput( diff --git a/src/backend/base/langflow/components/inputs/TextInput.py b/src/backend/base/langflow/components/inputs/TextInput.py index 054870479..fa869a8db 100644 --- a/src/backend/base/langflow/components/inputs/TextInput.py +++ b/src/backend/base/langflow/components/inputs/TextInput.py @@ -1,6 +1,7 @@ from langflow.base.io.text import TextComponent from langflow.field_typing import Text -from langflow.template import Input, Output +from langflow.inputs import StrInput, Input +from langflow.template import Output class TextInput(TextComponent): @@ -9,7 +10,7 @@ class TextInput(TextComponent): icon = "type" inputs = [ - Input( + StrInput( name="input_value", type=str, display_name="Value",