Simplify the getJsApiCode utility function in the get-js-api-code.tsx file. The unnecessary replacement of JavaScript boolean literals has been removed, improving code readability and maintainability.
This commit updates the CodeTabsComponent to handle an additional tab in the code tabs display. The previous implementation had a condition that checked if the active tab index was less than 4, but it has been updated to check if the active tab index is less than 5. This change ensures that the component can handle the new tab and display the corresponding content correctly. The code has been modified in the index.tsx file of the CodeTabsComponent directory.
This commit adds a new utility function called getJsApiCode to the apiModal/utils/get-js-api-code.tsx file. The function generates JavaScript code for interfacing with an API using the LangflowClient class. It takes several parameters including the flowId, isAuth, tweaksBuildedObject, and endpointName. The function constructs a LangflowClient instance and defines methods for making API requests, handling streams, and running flows. It also includes a main function that demonstrates how to use the LangflowClient to initiate a session and handle stream updates. This utility function improves code organization and reusability.
The create_or_update_starter_projects function in setup.py has been refactored to improve code organization. This change separates the function definition from the rest of the code, making it easier to read and maintain.
The Retriever class in constants.py has been refactored to improve code organization. This change separates the class definition from the rest of the code, making it easier to read and maintain.
The post_process_raw function in artifact.py has been updated to set the raw value to "Built Successfully ✨" when the artifact type is unknown. This change improves the clarity of the code and provides a more meaningful message for unknown artifact types.
Refactor the post_code_processing method in the CustomComponent class to improve code readability and maintainability. The changes include:
- Import the update_frontend_node_with_template_values function from langflow.template.utils.
- Update the function signature to accept new_build_config and current_build_config as parameters.
- Call the update_frontend_node_with_template_values function to 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.
The Makefile has been updated to ignore the integration tests when running the unit_tests target. This change improves the efficiency of the unit testing process by excluding unnecessary tests.
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.
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.
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.
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.
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.
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.
The call to build_frontend in the Makefile has been removed as it is no longer needed. This change improves the build process by eliminating unnecessary steps.
The import statement in types.py has been updated to use the `typing` module instead of the deprecated `TYPE_CHECKING` constant. This change improves code maintainability and ensures compatibility with the latest Python standards.
The timeout for waiting for the server to start in the pre-release.yml workflow file has been increased from 40 seconds to 120 seconds. This change allows more time for the server to start up before timing out, ensuring that the server is ready for testing.