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 prompt validation and code processing in Component and PromptComponent classes #2264

Merged
merged 10 commits into from
Jun 23, 2024

Commits on Jun 23, 2024

  1. refactor: Update prompt validation process in validate.py

    Refactor the prompt validation process in validate.py to improve code readability and maintainability. The changes include:
    
    - Update the import statement for process_prompt_template in api_utils.py.
    - Remove unused imports from api_utils.py.
    - Simplify the post_validate_prompt function by removing unnecessary conditional statements.
    - Replace the validate_prompt function call with process_prompt_template in post_validate_prompt.
    
    These changes enhance the efficiency and organization of the prompt validation process.
    ogabrielluiz committed Jun 23, 2024
    Configuration menu
    Copy the full SHA
    af80b84 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    64487f3 View commit details
    Browse the repository at this point in the history
  3. refactor: Handle error updating Component code in GenericNode

    When updating the Component code in GenericNode, handle any errors that occur. If an error occurs, display an error message with instructions to report the issue on Discord or GitHub. This improves the error handling and user experience when updating the Component code.
    ogabrielluiz committed Jun 23, 2024
    Configuration menu
    Copy the full SHA
    e7cd879 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    ec4b9c5 View commit details
    Browse the repository at this point in the history
  5. refactor: Update post_code_validation method in Component class

    Refactor the post_code_validation method in the Component class to improve code readability and maintainability. The changes include:
    
    - Rename the parameters to better reflect their purpose.
    - Update the function documentation to provide a clear explanation of the method's purpose.
    - Remove unnecessary comments and whitespace.
    - Improve variable naming for better clarity.
    
    These changes enhance the overall quality of the code and make it easier to understand and maintain.
    ogabrielluiz committed Jun 23, 2024
    Configuration menu
    Copy the full SHA
    f11e567 View commit details
    Browse the repository at this point in the history
  6. refactor: Update build_custom_component_template return type

    Update the return type of the build_custom_component_template function in utils.py to include the possibility of returning a Component object. This change ensures that the function can handle both CustomComponent and Component objects, improving flexibility and compatibility.
    ogabrielluiz committed Jun 23, 2024
    Configuration menu
    Copy the full SHA
    4a69704 View commit details
    Browse the repository at this point in the history
  7. refactor: Rename post_code_validation method to post_code_processing

    The post_code_validation method in the Component class has been renamed to post_code_processing to better reflect its purpose. This change improves code clarity and maintainability.
    ogabrielluiz committed Jun 23, 2024
    Configuration menu
    Copy the full SHA
    856797b View commit details
    Browse the repository at this point in the history
  8. refactor: Update PromptComponent post_code_processing method

    Refactor the post_code_processing method in the PromptComponent class to improve code readability and maintainability. The changes include:
    
    - Import the process_prompt_template function from langflow.base.prompts.api_utils.
    - Import the update_template_values function from langflow.template.utils.
    - Call the process_prompt_template function to update the template value.
    - Update the frontend_node with any values set in the current_build_config.
    - Remove unnecessary comments and whitespace.
    
    These changes enhance the overall quality of the code and make it easier to understand and maintain.
    ogabrielluiz committed Jun 23, 2024
    Configuration menu
    Copy the full SHA
    a7259f7 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    35b070c View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    35088ea View commit details
    Browse the repository at this point in the history