Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: StructuredOutput returns list of Data objects when multiple=True #5477

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

elephantum
Copy link
Contributor

@elephantum elephantum commented Dec 28, 2024

Description

This PR proposes a change in Structured Output behavior when Generate Multiple is set to true.

Currently when Generate Multiple is used component produces a single Data entry with single key objects which contains a string representation of a json list of records. This is a bit counterintuitive because Langflow supports input and output of lists of Data objects.

Solution

We propose to change semantics of Structured Output to return a list Data objects when Generate Multiple is enabled

@dosubot dosubot bot added size:XS This PR changes 0-9 lines, ignoring generated files. enhancement New feature or request labels Dec 28, 2024
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Dec 28, 2024
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Dec 29, 2024
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Dec 30, 2024
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Jan 2, 2025
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Jan 6, 2025
Copy link
Contributor

@ogabrielluiz ogabrielluiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @elephantum

I like this. Thank you!

What if we made this component have two different outputs?

This change is good but it is a breaking change.

@elephantum
Copy link
Contributor Author

@ogabrielluiz hey, thanks for taking a look.

Indeed, I do not understand in detail how to deal with backwards compatibility in Langflow.

I will keep original output as is and add list as a new output structured_output_list maybe?

@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Jan 15, 2025
Copy link
Contributor

autofix-ci bot commented Jan 15, 2025

Hi! I'm autofix logoautofix.ci, a bot that automatically fixes trivial issues such as code formatting in pull requests.

I would like to apply some automated changes to this pull request, but it looks like I don't have the necessary permissions to do so. To get this pull request into a mergeable state, please do one of the following two things:

  1. Allow edits by maintainers for your pull request, and then re-trigger CI (for example by pushing a new commit).
  2. Manually fix the issues identified for your pull request (see the GitHub Actions output for details on what I would like to change).

@elephantum
Copy link
Contributor Author

@ogabrielluiz please, take another look, I added methods for all possible types of output :)

@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Jan 15, 2025
@dosubot dosubot bot removed the size:XS This PR changes 0-9 lines, ignoring generated files. label Jan 15, 2025
@dosubot dosubot bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Jan 15, 2025
@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. and removed size:S This PR changes 10-29 lines, ignoring generated files. labels Jan 15, 2025
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants