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: add Component Code Validator component and Tool #3016

Merged
merged 9 commits into from
Aug 7, 2024

Conversation

ogabrielluiz
Copy link
Contributor

This pull request adds the ComponentCodeValidator class to the helpers module in the langflow/components package. The ComponentCodeValidator class is responsible for validating the code of a component. It enhances the functionality of the application by providing code validation capabilities.

Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-3016.dmtpw4p5recq1.amplifyapp.com

Copy link
Contributor

Pull Request Validation Report

This comment is automatically generated by Conventional PR

Whitelist Report

Whitelist Active Result
Pull request is a draft and should be ignored
Pull request is made by a whitelisted user and should be ignored
Pull request is submitted by a bot and should be ignored
Pull request is submitted by administrators and should be ignored

Result

Pull request matches with one (or more) enabled whitelist criteria. Pull request validation is skipped.

Last Modified at 28 Jul 24 22:32 UTC

@github-actions github-actions bot added the enhancement New feature or request label Jul 28, 2024
@ogabrielluiz ogabrielluiz changed the title feat: Add Component Code Validator component feat: add Component Code Validator component and Tool Jul 29, 2024
@github-actions github-actions bot added enhancement New feature or request and removed enhancement New feature or request labels Jul 29, 2024
@ogabrielluiz ogabrielluiz force-pushed the feat/ccvalidatecomponents branch 2 times, most recently from b240b2d to 61ef5c8 Compare August 6, 2024 12:38
@ogabrielluiz ogabrielluiz marked this pull request as ready for review August 7, 2024 14:21
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Aug 7, 2024
@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Aug 7, 2024
@ogabrielluiz ogabrielluiz force-pushed the feat/ccvalidatecomponents branch from 704a399 to 3cda9d6 Compare August 7, 2024 15:41
This commit adds the `ComponentCodeValidator` class to the `helpers` module in the `langflow/components` package. The `ComponentCodeValidator` class is responsible for validating the code of a component. It takes a `component_code` input and uses it to build a custom component template. If there are any errors during the validation process, the error message and traceback are returned. This new class enhances the functionality of the application by providing code validation capabilities.
This commit updates the imports in the `component_code_validator.py` file. It moves the imports for `build_custom_component_template` and `get_instance_name` from the `backend.base.langflow.custom.utils` and `backend.base.langflow.inputs.inputs` modules to the `langflow.custom.utils` and `langflow.inputs.inputs` modules respectively. This change ensures that the correct modules are imported and improves the organization of the code.
This commit adds the `ValidateComponentTool` class to the `langflow/components/tools` package. The `ValidateComponentTool` is a component that validates the code of a component. It takes a `tool_name` and `tool_description` input and uses them to build a tool that validates the code. This new tool enhances the functionality of the application by providing code validation capabilities.
This commit updates the error message in the `utils.py` file. Instead of a generic error message, it now includes the specific exception that occurred. This change provides more detailed information to users when there is an invalid type conversion, helping them troubleshoot and fix the issue more effectively.
This commit modifies the ComponentCodeValidator to use `MultilineInput` and `Output`, enhancing its functionality and code clarity
…mplement code validation functionality for components
This commit introduces `to_dict`, `to_json`, and `from_json` methods for enhanced data serialization in the `Data` class
@ogabrielluiz ogabrielluiz force-pushed the feat/ccvalidatecomponents branch from 3cda9d6 to c795179 Compare August 7, 2024 18:21
@ogabrielluiz ogabrielluiz enabled auto-merge (squash) August 7, 2024 18:33
@ogabrielluiz ogabrielluiz merged commit 15a67f3 into main Aug 7, 2024
51 checks passed
@ogabrielluiz ogabrielluiz deleted the feat/ccvalidatecomponents branch August 7, 2024 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request lgtm This PR has been approved by a maintainer size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants