The pre-commit configuration file `.pre-commit-config.yaml` was updated to remove the `pretty-format-json` hook and exclude `tsconfig.*.json` files. This change improves the formatting consistency of the codebase.
Note: The commit message has been generated based on the provided code changes and recent commits.
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 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 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.
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.
* chore: Update utils.py to handle SecretStr field type as str with password and load_from_db attributes
* Update utils.py to handle SecretStr field type as str with password and load_from_db attributes
* docs(migration): add UPSTASH_VECTOR_REST_URL and UPSTASH_VECTOR_REST_TOKEN to the list of default environment variables
pyproject.toml: add upstash-vector package as a dependency with version 0.4.0
src/backend/base/langflow/components/vectorsearch/UpstashSearch.py: create UpstashSearchComponent for implementing a Vector Store using Upstash
src/backend/base/langflow/components/vectorstores/Upstash.py: create UpstashVectorStoreComponent for implementing a Vector Store using Upstash
src/backend/base/langflow/services/settings/constants.py: add UPSTASH_VECTOR_REST_URL and UPSTASH_VECTOR_REST_TOKEN to the list of variables to get from the environment
* ✨ (UpstashSearch.py): Add support for 'number_of_results' and 'text_key' parameters in UpstashSearchComponent to enhance search functionality
♻️ (Upstash.py): Refactor UpstashVectorStoreComponent to include 'text_key' parameter for consistency and improved functionality
* ♻️ (Upstash.py): refactor UpstashVectorStoreComponent to improve code readability and maintainability by restructuring the instantiation of UpstashVectorStore instances based on conditions and adding support for adding documents directly to the instance.
* feat: Update langchain-core, langchainhub, langsmith, and requests dependencies to latest versions
The code changes include adding a new step in the `.github/workflows/docker-build.yml` file to wait for Docker Hub to propagate. Additionally, a new script `factory_restart_space.py` is added in the `scripts` directory to restart the HuggingFace Spaces build. This script uses the `HfApi` and `rich` libraries to interact with the HuggingFace Hub API and print the space runtime.
Note: The commit message has been generated based on the provided code changes and recent commits.
The code changes include adding a new step in the `.github/workflows/docker-build.yml` file to wait for Docker Hub to propagate. Additionally, a new script `factory_restart_space.py` is added in the `scripts` directory to restart the HuggingFace Spaces build. This script uses the `HfApi` and `rich` libraries to interact with the HuggingFace Hub API and print the space runtime.
Note: The commit message has been generated based on the provided code changes and recent commits.
♻️ (TableComponent): remove unused useCallback import and add autoHeight
✨ (convert-to-table-rows): add helper function to convert objects to table rows
♻️ (SwitchOutputView): refactor to use new convertToTableRows helper and improve type checks
♻️ (OutputModal): change modal size to medium-log for better visualization
♻️ (IOFieldView): refactor to use new rows and columnMode props in RecordsOutputComponent
♻️ (baseModal): remove unnecessary comma in ReactElement type array
✨ (baseModal): add new size option "medium-log" for modal component
♻️ (textOutputView): simplify TextOutputView component props
♻️ (api): add params and messages to VertexBuildTypeAPI
♻️ (api): add type to logs in VertexDataTypeAPI
♻️ (api): make artifacts optional in VertexDataTypeAPI
♻️ (chat): make artifacts optional in FlowPoolObjectType
✨ (components): add playgroundDisabled to InputListComponentType
♻️ (components): fix formatting in various component types
♻️ (utils.ts): remove unused imports to clean up the code
✨ (utils.ts): add 'all' mode to extractColumnsFromRows for more flexibility
* Remove outdated pages from example folder
* Repopulate with component-of-the-day pages with videos
* Update Notion index image
* Python version 3.10 -> Python >= 3.10
* feat: read flows from local directory at startup
* cleanup
* add check
* fix
* fix
* fix by endpoint name
---------
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
* feat: Add support for running flows by endpoint name
This commit modifies the `simplified_run_flow` endpoint in `endpoints.py` to allow running flows using the endpoint name instead of the flow ID. It introduces a new route parameter `flow_id_or_name` which can accept either a UUID or a string representing the endpoint name. The code first attempts to parse the parameter as a UUID, and if that fails, it queries the database to find a flow with the matching endpoint name. This change improves the usability of the API by providing an alternative way to identify flows for execution.
* feat: Add endpoint_name field to FlowType
This commit adds the `endpoint_name` field to the `FlowType` interface in the `index.ts` file. The `endpoint_name` field is an optional string that represents the name of the endpoint associated with the flow. This change allows for more flexibility in identifying flows by endpoint name instead of just the flow ID. It improves the usability of the codebase by providing an alternative way to reference flows.
* 🐛 (endpoints.py): change type of flow_id_or_name parameter from Union[str, UUID] to str to simplify the API and improve readability
* feat: Add migration utility functions for table, column, foreign key, and constraint existence checks
This commit adds utility functions to the `migration.py` module in the `langflow.utils` package. These functions provide convenient ways to check the existence of tables, columns, foreign keys, and constraints in a database using SQLAlchemy. The functions `table_exists`, `column_exists`, `foreign_key_exists`, and `constraint_exists` take the table name, column name, foreign key name, and constraint name respectively, along with the SQLAlchemy engine or connection object. They use the `Inspector` class from `sqlalchemy.engine.reflection` to retrieve the necessary information and return a boolean value indicating whether the specified element exists in the database. These utility functions improve the readability and maintainability of the codebase by encapsulating the common existence checks in a reusable and modular way.
* feat: Add unique constraints for per-user folders and flows
This commit adds unique constraints for per-user folders and flows in the database. It introduces the `unique_folder_name` constraint for the `folder` table, ensuring that each user can have only one folder with a specific name. Similarly, it adds the `unique_flow_endpoint_name` and `unique_flow_name` constraints for the `flow` table, enforcing uniqueness of endpoint names and flow names per user. These constraints improve data integrity and prevent duplicate entries in the database, providing a more robust and reliable system.
* feat: Add poetry installation and caching steps to GitHub Actions workflow
This commit updates the GitHub Actions workflow file `action.yml` to include additional steps for installing poetry and caching its dependencies. The `run` step now installs poetry using the specified version and ensures that the poetry binary is available in the PATH. Additionally, the workflow now includes a step to restore pip and poetry cached dependencies using the `actions/cache` action. These changes improve the workflow by providing a more efficient and reliable way to manage poetry dependencies and caching.
* refactor: Improve error handling in update_flow function
This commit improves the error handling in the `update_flow` function in `flows.py`. It adds a new `elif` condition to check if the exception is an instance of `HTTPException` and re-raises it. This ensures that any `HTTPException` raised during the update process is properly handled and returned as a response. Additionally, it removes the unnecessary `else` block and simplifies the code logic. This refactor enhances the reliability and maintainability of the `update_flow` function.
* Refactor code to remove console.log statements
* Refactor code to remove console.log statements
* ⬆️ (pyproject.toml): upgrade uncurl dependency to version 0.0.11
* 📝 (flows.py): Add docstring to the read_flows function to provide information about its purpose, arguments, and return value
📝 (parse.py): Add comments and docstrings to the parse_context function to explain its purpose and how it works
📝 (APIRequest.py): Add a new method update_build_config to handle parsing of curl commands and update build configuration based on the parsed context
* refactor: Improve value change detection logic in DictComponent
* refactor: Improve value change detection logic in DictAreaModal
* refactor: Update APIRequest to handle parsing of curl commands and update build configuration
This commit updates the APIRequest class in APIRequest.py to handle parsing of curl commands and update the build configuration based on the parsed context. It introduces a new method, update_build_config, which parses the curl command using the parse_context function and updates the build configuration with the parsed information. Additionally, it handles JSON decoding errors when parsing the data field of the curl command. This improvement enhances the functionality and flexibility of the APIRequest component.
* feat: Add support for handling headers as dictionaries in APIRequest
* refactor: Parse curl commands and update build configuration in APIRequest
This commit refactors the APIRequest class in APIRequest.py to handle parsing of curl commands and update the build configuration based on the parsed context. It introduces a new method, update_build_config, which parses the curl command using the parse_context function and updates the build configuration with the parsed information. Additionally, it handles JSON decoding errors when parsing the data field of the curl command. This improvement enhances the functionality and flexibility of the APIRequest component.
* ✨ (test_data_components.py): add new test case to parse curl command into build configuration for API requests
* 🐛 (src/backend/base/langflow/components/data/APIRequest.py): fix type hinting issue for bodies variable in APIRequest class
* ♻️ (dictComponent): improve value change detection logic
🐛 (parameterComponent): remove unnecessary console.log statement
* ♻️ (frontend): remove redundant comments and clean up code formatting
♻️ (editNodeModal): refactor to use nodeId instead of passing data directly
* ♻️ (editNodeModal): refactor to use data prop instead of nodeId for better data handling
♻️ (nodeToolbarComponent): refactor to improve code readability and consistency
This pull request removes the `NATIVE_CATEGORIES` constant and
simplifies the logic for checking the template code value in the
`GenericNode` component. The logic now checks if the
`data.node.template.code.value` exists before proceeding. Additionally,
the logic for checking the template code value has been simplified by
removing the unnecessary check for
`NATIVE_CATEGORIES.includes(types[data.type])`.
This commit refactors the rendering of the handle button in the ParameterComponent. It improves the readability and maintainability of the code by simplifying the logic and removing unnecessary ternary operators.