-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Conversation
lucaseduoli
commented
May 15, 2024
![image](https://private-user-images.githubusercontent.com/62335616/330888661-2a7f77f0-24a5-4c51-a62d-c04090379fc8.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE5NDYwNTMsIm5iZiI6MTcyMTk0NTc1MywicGF0aCI6Ii82MjMzNTYxNi8zMzA4ODg2NjEtMmE3Zjc3ZjAtMjRhNS00YzUxLWE2MmQtYzA0MDkwMzc5ZmM4LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MjUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzI1VDIyMTU1M1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTE1NmIwYTNmNGQzNGY4Mjk4ZWZkNzhlYmNlOGJjYjIzZWIyOGE4YmIwYjQ1NDczZThhZjlkODk4ZTVjNTRmMmEmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.VJmUswxMY0m9bLK_TpvIwzx-aBXTxGYfFMl8QvwUhy0)
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
const output_types = title.split("|"); | ||
const displayTitle = data.selected_output_type ?? output_types[0]; | ||
return !left && output_types.length > 1 ? ( | ||
<DropdownMenu> |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
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.