* 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 pull request includes several code refactorings to improve the
readability and maintainability of the codebase. The changes include
reordering and organizing the initialization parameters in the
QdrantComponent class, removing unused imports and cleaning up code
formatting in the OllamaModel.py file, updating comments and docstrings
for clarity and consistency in the OllamaModel.py file, and refactoring
the logic for setting the base URL in the get_model method of the
OllamaModel.py file to improve maintainability and readability. These
changes aim to make the codebase more organized and easier to understand
for future development and maintenance.
📝 (OllamaModel.py): Update comments and docstrings for clarity and consistency
🔧 (OllamaModel.py): Refactor the logic for setting the base URL in the get_model method to improve maintainability and readability
chore(create-release.yml): rename step name to 'Download Artifact' for better readability
chore(create-release.yml): rename step name to 'Create Release Notes' for better understanding of the action's purpose
* refactor(base.py): handle ImportError when importing is_pre_release function from langflow.version module to prevent crashing the application
feat(base.py): dynamically determine if the version is a pre-release version by checking for 'a', 'b', or 'rc' in the version number
* fix(Dockerfile): add missing backslash to ensure proper chaining of commands
* refactor: Update get_lifespan function to handle ImportError and dynamically determine the version number
The get_lifespan function in main.py has been updated to handle ImportError when importing the __version__ attribute from the langflow.version module. If the import fails, the version number is dynamically determined using the importlib.metadata.version function. This change ensures that the application does not crash when the langflow.version module is not available.
Note: This commit message follows the convention used in the recent user commits.
* chore: Add langflow-pre.db and langflow.db to .dockerignore
* chore: Update .dockerignore to include langflow-pre.db and langflow.db
* refactor: Add folder_id column to flow table and handle folder column migration
This commit adds the folder_id column to the flow table in the database. It also handles the migration of the folder column to the new folder_id column. This change allows for better organization and management of flows within folders.
Note: This commit message follows the convention used in the recent user commits.
* refactor: Update Dockerfiles to include user creation and environment variable
This commit updates the Dockerfiles to include the creation of a user with UID 1000 and the necessary permissions for the /app/langflow directory. It also adds the user's local bin directory to the PATH environment variable. This change improves the security and isolation of the application within the container.
Note: This commit message follows the convention used in the recent user commits.
* refactor: Update SplitTextComponent to store parent and text data in Record object
* chore(pre-release.yml): update call_docker_build job to use langflow-ai/langflow/.github/workflows/docker-build.yml@dev for better workflow organization and consistency
* merge dev
* chore: Update utils imports and add cn to nodeToolbarComponent
* fix(utils.py): change key parameter name from 'flow_id' to 'key' for consistency
fix(chat.py): remove unused import 'functools.partial' to improve code readability
refactor(chat.py): remove 'set_cache_coro' partial function and pass 'chat_service' directly to 'build_vertex' method for better code organization
feat(schemas.py): add 'used_frozen_result' field to ResultDataResponse and ResultData classes with default value of False for better tracking of frozen result usage
feat(base.py): add 'chat_service' parameter to 'build_vertex' method in Graph class to allow passing ChatService instance for cache operations
feat(base.py): update 'build_vertex' method in Graph class to handle caching of frozen vertices and set 'used_frozen_result' flag in ResultData class
feat(cache/service.py): change parameter name from 'flow_id' to 'key' in 'set_cache' and 'get_cache' methods for consistency
feat(cache/utils.py): add 'CacheMiss' class to represent cache miss situations for better error handling
* feat: Add check for None before setting 'used_frozen_result' flag in Graph class
* feat: Add frozen effect to buttons and improve code organization
The code changes introduce a frozen effect to buttons by adding new CSS classes and styles. This effect is achieved by applying borders, shadows, and background colors. Additionally, the code is refactored to improve code organization and remove unused imports.
Note: This commit message follows the convention used in the recent user commits.
* feat: Add frozen effect to buttons and improve code organization
* style(applies.css): Update border styles for frozen state to improve visual appearance and consistency
style(applies.css): Adjust opacity of frosted background for better readability
style(tailwind.config.js): Increase opacity of frozen-ring shadow for better visual effect
style(tailwind.config.js): Increase opacity of frosted-ring shadow for better visual effect
* feat(parameterComponent): add snowflake icon to ParameterComponent when node is frozen and not aligned left
* style(applies.css): Update border styles for frozen state and add border to improve visual appearance and consistency
* chore: Add type attribute to button in SecretKeyModal
* chore: Refactor Header component to fix autoLogin button visibility
* docs(api.mdx): update admonition message to remove reference to LANGFLOW_AUTO_LOGIN environment variable
docs(cli.mdx): update CLI command example to use 'run' subcommand instead of no arguments
feat(cli.mdx): add 'api-key' command to create API key for default superuser when LANGFLOW_AUTO_LOGIN is True
* docs(api.mdx): update admonition message to remove reference to LANGFLOW_AUTO_LOGIN environment variable
* chore: Fix typo in get-curl-code.tsx
---------
Co-authored-by: anovazzi1 <otavio2204@gmail.com>
This pull request updates the Dockerfiles to create a "langflow" directory and grant write permissions to it. This change ensures that the user inside the Docker container has the necessary permissions to write to the "langflow" directory.
Some docs syntax items @rodrigosnader requested -
1. Merge canvas and flows/components/projects doc into 1 doc
2. Move HF Spaces to install, remove page and nav item
3. Remove install from starter projects and link to install page
4. All title case nav
* Update OllamaModel.py
A draft to synchronize the model using the latest Langflow architecture and to improve it according to the latest Langchain specifications.
* Update OllamaModel.py
Checkout Models from api
* Update OllamaModel.py
* Update OllamaModel.py
---------
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
* Fixed shortcuts not working on mac
* fixed top level vertices and added timeout
* revert flowStore changes
* chore: Update worker timeout setting
* feat: Add endpoint to retrieve config settings
The commit adds a new endpoint `/config` to retrieve the configuration settings. This endpoint returns the `ConfigResponse` model, which includes the `timeout` value. The implementation handles any exceptions and logs them appropriately.
* feat: Add fetchConfig function to retrieve configuration settings
This commit adds a new function fetchConfig to the API utils module. The function makes an HTTP GET request to the /config endpoint and returns the configuration data. Any errors that occur during the request are logged and rethrown. This function will be used to initialize the application with the fetched configuration.
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
* revert changes
* feat: Add setupAxiosDefaults function to initialize Axios configurations
This commit adds a new function setupAxiosDefaults to the API utils module. The function fetches the configuration data using the fetchConfig function and sets up default configurations for Axios. It sets the base URL and timeout for Axios requests based on the fetched configuration. This function will be used to initialize Axios with the correct configurations.
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
* fix(langflow): rename 'timeout' setting to 'worker_timeout' for clarity and consistency
feat(langflow): add 'frontend_timeout' setting to control frontend API call timeout
chore(langflow): reorganize imports and constants in settings module for better readability
* Set frontend_timeout to 0
---------
Co-authored-by: ogabrielluiz <gabriel@langflow.org>
The code changes in `ChromaSearch.py` and `Chroma.py` import the `chromadb` library and use it to create a `HttpClient` object. This change enables the components to interact with a Chroma server for vector search functionality.
This commit message follows the established convention of starting with a type (feat for feature) and providing a concise summary of the changes.