Replies: 3 comments 4 replies
-
Hey @andruum! I'm here to help you with any bugs, questions or if you want to become a contributor. Just ask! To handle multiple from langflow.base.io.text import TextComponent
from langflow.io import MessageTextInput, IntInput, Output
from langflow.schema.message import Message
class MultipleTextInputComponent(TextComponent):
display_name = "Multiple Text Input"
description = "Get multiple text inputs from the Playground."
icon = "type"
inputs = [
MessageTextInput(
name="input_value_1",
display_name="Text 1",
info="First text input.",
),
MessageTextInput(
name="input_value_2",
display_name="Text 2",
info="Second text input.",
),
IntInput(
name="number",
display_name="Number",
info="An integer input.",
),
]
outputs = [
Output(display_name="Text 1 Response", name="text_1_response", method="text_1_response"),
Output(display_name="Text 2 Response", name="text_2_response", method="text_2_response"),
Output(display_name="Number Response", name="number_response", method="number_response"),
]
def text_1_response(self) -> Message:
return Message(text=self.input_value_1)
def text_2_response(self) -> Message:
return Message(text=self.input_value_2)
def number_response(self) -> str:
return f"This is my int input multiplied by 2: {self.number * 2}" In this example, the Additionally, you can refer to the |
Beta Was this translation helpful? Give feedback.
-
@dosu this approach seems not to work further as I try to input these values into a prompt with multiple input variables. It seems like a problem inside flow |
Beta Was this translation helpful? Give feedback.
-
@dosu how can I pass several input variables to prompt via API? |
Beta Was this translation helpful? Give feedback.
-
Hi!
I'm trying to figure out how to use Langflow with API
Currently I face an issue - I can't put two values in the API call.
It works fine if I have only one TextInput Block and use input_value as a field in my API call.
But if I use two TextInput Blocks - It doesn't work.
What should I do and what is the correct way to do so?
Beta Was this translation helpful? Give feedback.
All reactions