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

Added Output Types dropdown on nodes #1902

Merged
merged 44 commits into from
Jun 21, 2024
Merged

Conversation

lucaseduoli
Copy link
Collaborator

image

@lucaseduoli lucaseduoli self-assigned this May 15, 2024
Copy link

vercel bot commented May 15, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
langflow ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 31, 2024 7:15pm

const output_types = title.split("|");
const displayTitle = data.selected_output_type ?? output_types[0];
return !left && output_types.length > 1 ? (
<DropdownMenu>
Copy link
Collaborator

Choose a reason for hiding this comment

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

I believe it would enhance readability to create a separate component for this . The parameterComponent is already big enough, wouldn't you agree?
@lucaseduoli

Copy link
Contributor

Choose a reason for hiding this comment

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

good idea

This commit updates the handling of the `selected_output_type` attribute in the `Vertex` class. Previously, the attribute was assigned directly from the `data` dictionary, which could result in unexpected behavior. Now, the attribute is properly stripped and converted to a string before assignment, ensuring consistent behavior. This change improves the reliability and accuracy of the `selected_output_type` attribute in the `Vertex` class.
…ns for generic nodes

feat(types): add outputComponentType to define props for ComponentOutput component
…electing output types in generic nodes

feat(frontend): remove ComponentOutputs component and integrate its functionality into ParameterComponent
feat(frontend): update ParameterComponent to use OutputComponent for displaying output types
feat(frontend): update GenericNode to use OutputComponent for displaying output types and remove ComponentOutputs
feat(types): update ParameterComponentType to use number type for index instead of string
ogabrielluiz and others added 20 commits May 28, 2024 23:03
The code changes in this commit update the API modal utils to use the `InputFieldType` type instead of the deprecated `TemplateVariableType`. This change ensures that the codebase is up to date with the latest API types and improves the accuracy and clarity of the code.
This commit updates the field types in the `prompt.py` and `formatter/base.py` modules. The `DefaultPromptField` class in `prompt.py` now inherits from `InputField` instead of `TemplateField`. Similarly, the `format` method in the `FieldFormatter` class in `formatter/base.py` now accepts an `InputField` parameter instead of a `TemplateField` parameter. These changes ensure consistency and improve the accuracy of the code.
This commit migrates the base classes of the FrontendNode to the outputs field. Each base class is converted into an OutputField with the same name and type. This change ensures consistency and improves the structure of the code.
This commit adds the `inputs` and `outputs` fields to the `CustomComponent` class in the `custom_component.py` file. The `inputs` field is of type `List[Input]` and the `outputs` field is of type `List[Output]`. This change allows for better organization and management of the component's input and output fields.
This commit updates the title in the GenericNode component to use the `name` property instead of the `selected` or `types[0]` properties. This change improves the accuracy and clarity of the code.
This commit adds the `MultipleOutputsComponent` class to the `CustomComponent` module. The `MultipleOutputsComponent` class defines multiple inputs and outputs for the component. The `inputs` field includes an input for a string and an input for a number. The `outputs` field includes an output for a certain output and an output for another output. This change enhances the functionality and flexibility of the `CustomComponent` module.
This commit updates the `get_all` endpoint in the `endpoints.py` file to use `async` and `await` keywords. By making the `get_all` function asynchronous, it allows for better performance and responsiveness when retrieving all types from the langchain. This change improves the overall efficiency of the codebase.
This commit adds the __bool__ method to the CacheMiss class in the utils.py file. The __bool__ method returns False, allowing the CacheMiss object to be treated as False in boolean expressions. This change improves the functionality and usability of the CacheMiss class.
This commit adds the set_attributes method to the CustomComponent class in the custom_component.py file. The set_attributes method allows for setting attributes of the CustomComponent instance based on a dictionary of key-value pairs. This change enhances the flexibility and configurability of the CustomComponent class.
This commit adds the `ComponentFrontendNode` class to the `CustomComponent` module. The `ComponentFrontendNode` class defines a new frontend node for the `Component` type. It includes a template with a code input field. This change enhances the functionality and flexibility of the `CustomComponent` module.
Simplify the logic for creating new output fields in the `updateNewOutput` function of `reactflowUtils.ts`. Instead of mapping over the `outputTypes` array, directly assign a new output field to `sourceNode.data.node!.outputs`. The new output field includes the `outputTypes` as `types`, sets `selected` based on the `selected` variable, and sets `name` as a string representation of `outputTypes` joined with " | ". This change improves the clarity and efficiency of the code.
@ogabrielluiz ogabrielluiz merged commit 1fa3a6a into dev Jun 21, 2024
2 checks passed
@ogabrielluiz ogabrielluiz deleted the feature/output_dropdown branch June 21, 2024 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants