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

Refactor CustomComponentResponse and GenericNode to handle component type #2280

Merged
merged 2 commits into from
Jun 23, 2024

Conversation

ogabrielluiz
Copy link
Contributor

This pull request includes changes to the codebase that improve the handling of component types in the CustomComponentResponse model and the GenericNode component. The CustomComponentResponse model now includes a "type" field, and the GenericNode component has been updated to handle this field when updating the node code. These changes enhance the consistency and clarity of the API response and ensure that the GenericNode component can correctly handle different types of components.

…nt endpoint

This commit adds the CustomComponentResponse model to the schemas.py file, allowing the custom_component endpoint to return a structured response. The custom_component endpoint in the endpoints.py file has been updated to include the response_model parameter, specifying the CustomComponentResponse model. This ensures that the endpoint returns the built_frontend_node along with the type of the component_instance. These changes improve the consistency and clarity of the API response.
This commit updates the GenericNode component and its related hooks to handle the component type. The code changes in the index.tsx file of the GenericNode directory include modifying the updateNodeCode function to accept an additional "type" parameter. The handleNodeClass function in the use-handle-node-class.tsx file has also been updated to handle the "type" parameter. These changes ensure that the GenericNode component can correctly handle different types of components and update the node code accordingly.
Copy link

vercel bot commented Jun 23, 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 Jun 23, 2024 8:30pm

Copy link

render bot commented Jun 23, 2024

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jun 23, 2024
@dosubot dosubot bot added enhancement New feature or request javascript Pull requests that update Javascript code python Pull requests that update Python code labels Jun 23, 2024
Copy link
Collaborator

@lucaseduoli lucaseduoli left a comment

Choose a reason for hiding this comment

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

LGTM!

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Jun 23, 2024
@ogabrielluiz ogabrielluiz merged commit 13d53a8 into dev Jun 23, 2024
19 of 25 checks passed
@ogabrielluiz ogabrielluiz deleted the make_name_change branch June 23, 2024 22:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request javascript Pull requests that update Javascript code lgtm This PR has been approved by a maintainer python Pull requests that update Python code size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants