feat: improve component configuration and input clarity (#5267)

* Add tool mode to structured output component

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com>
This commit is contained in:
Rodrigo Nader 2024-12-16 11:39:33 -03:00 • committed by GitHub
commit c82aeb2536
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -18,6 +18,7 @@ class StructuredOutputComponent(Component):
"Transforms LLM responses into **structured data formats**. Ideal for extracting specific information "
"or creating consistent outputs."
)
name = "StructuredOutput"
icon = "braces"
inputs = [
@ -26,17 +27,25 @@ class StructuredOutputComponent(Component):
display_name="Language Model",
info="The language model to use to generate the structured output.",
input_types=["LanguageModel"],
required=True,
),
MessageTextInput(
name="input_value",
display_name="Input Message",
info="The input message to the language model.",
tool_mode=True,
),
MessageTextInput(name="input_value", display_name="Input message"),
StrInput(
name="schema_name",
display_name="Schema Name",
info="Provide a name for the output data schema.",
advanced=True,
),
TableInput(
name="output_schema",
display_name="Output Schema",
info="Define the structure and data types for the model's output.",
required=True,
table_schema=[
{
"name": "name",
@ -73,6 +82,7 @@ class StructuredOutputComponent(Component):
),
BoolInput(
name="multiple",
advanced=True,
display_name="Generate Multiple",
info="Set to True if the model should generate a list of outputs instead of a single output.",
),