chore: update dependencies in poetry.lock and pyproject.toml
Update the versions of various dependencies in the poetry.lock and pyproject.toml files to their latest versions. This ensures compatibility and incorporates bug fixes and improvements provided by the updated dependencies.
* migrate autoLogin control variable to zustand store
* refactor: remove autoLogin control variable from authContext
The autoLogin control variable was removed from the authContext file to simplify the code and improve maintainability. The functionality related to auto login was migrated to the zustand store. This change ensures consistency and better organization of the authentication logic.
* [autofix.ci] apply automated fixes
* refactor: remove autoLogin control variable from authContext
* [autofix.ci] apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Cristhian Zanforlin Lousa <72977554+Cristhianzl@users.noreply.github.com>
refactor: fix logical operator in Graph class
Fixes a logical operator in the Graph class that was causing incorrect filtering of vertices based on input components. The operator was changed from "or" to "and" to ensure that both conditions are met before skipping the vertex. This resolves an issue where certain vertices were being skipped incorrectly.
Co-authored-by: Cristhian Zanforlin Lousa <72977554+Cristhianzl@users.noreply.github.com>
* 📝 (floatComponent/index.tsx): Add data-testid attribute to float input for testing purposes
🐛 (end-to-end tests): Update test selectors to match changes in component names for consistency and accuracy
✨ (freeze-path.spec.ts): Add end-to-end test for user ability to freeze a path in the application
🐛 (generalBugs-shard-0.spec.ts): Fix outdated component selector in end-to-end test for clearing chat messages
🐛 (generalBugs-shard-1.spec.ts): Fix outdated component selector in end-to-end test for deleting rows from a table message
🐛 (generalBugs-shard-3.spec.ts): Fix outdated component issue by updating the selector for the AlertTriangle icon and the API key input field, and selecting a different model option
🐛 (logs.spec.ts): Fix outdated component issue by updating the selector for the AlertTriangle icon and the API key input field, and selecting a different model option. Also, ensure the "built successfully" text is clicked within a specified timeout
🐛 (textInputOutput.spec.ts): Fix outdated component issue by updating the selector for the AlertTriangle icon and the API key input field, and selecting a different model option
* ⬆️ (typescript_test.yml): increase shardTotal value to 16 to match the updated shardIndex values for better test distribution.
* 📝 (inputComponent.spec.ts): remove unnecessary test case for clicking and checking collection name input field in InputComponent test to improve test focus and readability.
* Revert "refactor: update template api, handleonnewvalue and handlenodeclass hooks (#2628)"
This reverts commit b3c1b941b3.
* ✅ (inputComponent.spec.ts): add test case to check if the input element is checked after clicking on it
* ✨ (multiselectComponent/index.tsx): Refactor value assignment to handle both array and non-array values more efficiently
🔧 (inputComponent.spec.ts, intComponent.spec.ts, saveComponents.spec.ts): Update file paths to point to the correct location of test assets
* ✅ (filterSidebar.spec.ts): comment out two failing test expectations for helpersChat Memory and agentsTool Calling Agent to prevent test failures
📝 (folders.spec.ts): update file path to read collection.json from the correct location
📝 (saveComponents.spec.ts): update file path to read flow_group_test.json from the correct location
* ⬆️ (typescript_test.yml): increase the number of shardIndex values from 16 to 20 to distribute tests more evenly across shards.
* 📝 (folders.spec.ts): update file path to read collection.json file to fix file not found error
* add condition to merge-reports
* ✅ (filterSidebar.spec.ts): update test to check for visibility of agentsCSVAgent element instead of agentsTool Calling Agent element
🐛 (folders.spec.ts): increase timeout for page.waitForTimeout to 5000ms and add a comment suggesting to consider using a more reliable waiting mechanism. Also, add a comment to wait for the target element to be available before evaluation.
---------
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
* fix: disable error code "type-var" in mypy configuration
* refactor(VertexAiModel.py): restructure the return statement to improve readability and maintainability by using type casting for LanguageModel
* fix: remove unnecessary code related to vertex parent_node_id in Graph class
* fix: update node["frozen"] assignment to node["data"]["node"]["frozen"] in add_frozen function
* ✨ (flows.py): Add support for uploading flows to a specific folder by adding a folder_id parameter to the upload_file function and updating the flow object with the folder_id if provided
📝 (use-on-file-drop.tsx): Update import statements to include the new uploadFlowToFolder function and replace the usage of uploadFlowsFromFolders with uploadFlowToFolder
🔧 (use-drag-and-drop.tsx): Refactor the useDragAndDrop hook to remove unnecessary code related to file handling
⬆️ (index.ts): Add a new function uploadFlowToFolder to handle uploading flows to a specific folder in the MainPage services module
* ♻️ (flows.py): remove trailing whitespace to maintain code cleanliness and consistency
fixed the bug where pinecone component inserts embeddings 3 times
When we send the chunks with the embedding component to the Pinecone component, the generated embeddings are being saved three times instead of once.
🔧 (typescript_test.yml): Remove unnecessary steps and conditions in GitHub Actions workflow file
🔧 (authContext.tsx): Update cookie key from LANGFLOW_ACCESS_TOKEN to LANGFLOW_API_TOKEN for consistency
🔧 (Basic Prompting.spec.ts): Update test to click on correct dropdown option
🔧 (filterEdge-shard-0.spec.ts): Update test to check for correct element
🔧 (filterSidebar.spec.ts): Update test to check for correct elements
🔧 (generalBugs-shard-5.spec.ts): Update test to interact with correct element
🔧 (inputComponent.spec.ts): Update test to interact with correct elements
🔧 (store-shard-1.spec.ts): Update test to interact with correct elements and remove unnecessary code
* Added Custom Component URL
* Added Post Template Value mutation
* Changed HandleOnNewValue hook to ParameterValue mutation
* refactored some states
* Added NumberInput component to replace input type=number. Added logic to maintain cursor at the same place when editing
* Refactored post-template-value to remove all logic
* Removed hooks from custom hook and removed mutation definition from parametercomponent
* Added mutate-template helper to call debounced mutation
* Changed handle new value to use the created function and update as requested.
* Removed pDebounce from imports
* Refactored FetchDataOnMount to only call mutateTemplate
* Refactored ParameterComponent to use the new MutateTemplate and the loading from the mutation
* removed handle refresh button
* Changed handleOnNewValue to change the value of any parameter of a template field
* Changed hooks to receive node instead of data, added HandleOnNewValue hook on tableNodeCellRender
* added SetNodeClass to update internal table state of EditNodeModal
* Removed other handle new value and node class, updated every component to use the same one
* Updated parameter component to use the same nodeclass hook
* FIxed hook to only assign value if code is present
* Fixed type attribution on useHandleNodeClass
* 📝 (GenericNode/index.tsx): Remove commented-out code for openWDoubleClick in GenericNode component
🔧 (freezeAll.jsx): Refactor FreezeAllSvg component to use cn utility function for className and spread props
📝 (nodeToolbarComponent/index.tsx): Clean up commented-out code and unused elements in NodeToolbarComponent to improve code readability and maintainability
* [autofix.ci] apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* refactor: add LogFunctionType protocol for type hint
The LogFunctionType protocol is introduced to define the structure of a logging function that takes a message and an optional name parameter. This protocol will be used to ensure consistency and compatibility with other parts of the codebase when logging messages.
* refactor(callback.py): simplify import statements and type annotations for better readability
* refactor: add check-reviews job to ci.yml
* refactor(ci.yml): update path-filter condition to depend on the output of check-reviews job for improved readability and maintainability
* chore(ci.yml): remove check-reviews job and update path-filter condition to check for 'lgtm' label before running the job
* 📝 (headerComponent/index.tsx): Remove unnecessary width styling from header-end-division class
🔧 (sidebarComponent/index.tsx): Ensure correct import of cn function from utils/utils file
💡 (sidebarComponent/index.tsx): Refactor sidebarContent logic to cover all conditions and provide a default case if necessary
* 📝 (sidebarComponent/index.tsx): remove unnecessary comment about ensuring correct import of cn function
* 📝 (API): Add AxiosRequestConfig to import statement in api.tsx for better type checking
🔧 (API): Add useFlowsManagerStore to import statement in api.tsx for managing saveLoading state
♻️ (API): Refactor ApiInterceptor function in api.tsx to improve error handling and flow control
📝 (API): Update comments in api.tsx for better code readability and understanding
🔧 (API): Add setSaveLoading function to FlowsManagerStoreType in flowsManagerStore.ts for managing saveLoading state
* 🐛 (frontend): fix potential error when api response is null or undefined by adding optional chaining to data property access
* [autofix.ci] apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* feat: refactor upload_file function to handle optional tweaks parameter
Refactor the upload_file function in utils.py to handle the optional tweaks parameter. If the tweaks parameter is not provided, it is set to an empty dictionary. This change improves the flexibility and usability of the function.
* fix(get-python-api-code): set the endpoint in the correct variable
refactor: update path-filter job condition in ci.yml
The path-filter job condition in ci.yml has been updated to include an additional check for the 'workflow_dispatch' event. This change ensures that the job runs when the event is triggered manually, in addition to when the pull request is approved or when it is not a draft PR. The updated condition improves the flexibility and coverage of the path-filter job.
* refactor: move tests folder to src/backend
* chore(Makefile): update pytest commands to run tests from the correct directory paths for unit and integration tests
* refactor: update file path in test_custom_component.py
The file path in the test_custom_component.py file has been updated to use the correct relative path to the component_multiple_outputs.py file. This change ensures that the test code can access the correct file and improves the reliability of the test.
Update the langflow-base dependency in pyproject.toml to use the local path "./src/backend/base" with the "develop" flag. This change allows for easier development and testing of the langflow-base module.
* refactor: import nanoid only after setting up langwatch
* fix: update nanoid to version 2.0.0
* chore: Update langflow-base dependency to version 0.0.86
* Fixed Mutation Types to include options as undefined
* Updated mutation function type to not include params if it is undefined
* updated useAddUser type to match the new useMutationFunctionType
* updated useDeleteUser type to match the new useMutationFunctionType
* feat: Update useLoginUser mutation function type
The useLoginUser mutation function type has been updated to match the new useMutationFunctionType signature. This change ensures consistency and compatibility with other mutation functions in the codebase.
* chore: Update useLogout mutation function type
The useLogout mutation function type has been updated to match the new useMutationFunctionType signature. This change ensures consistency and compatibility with other mutation functions in the codebase.
* feat: Update useRefreshAccessToken mutation function type
The useRefreshAccessToken mutation function type has been updated to match the new useMutationFunctionType signature. This change ensures consistency and compatibility with other mutation functions in the codebase.
* feat: Update useResetPassword mutation function type
The useResetPassword mutation function type has been updated to match the new useMutationFunctionType signature. This change ensures consistency and compatibility with other mutation functions in the codebase.
* feat: Update useUpdateUser mutation function type
The useUpdateUser mutation function type has been updated to match the new useMutationFunctionType signature. This change ensures consistency and compatibility with other mutation functions in the codebase.
* chore: Update useDeleteMessages mutation function type
The useDeleteMessages mutation function type has been updated to match the new useMutationFunctionType signature. This change ensures consistency and compatibility with other mutation functions in the codebase.
* refactor: Update useUpdateMessage mutation function type
The useUpdateMessage mutation function type has been updated to match the new useMutationFunctionType signature. This change ensures consistency and compatibility with other mutation functions in the codebase.
* feat: Update usePostLikeComponent mutation function type
The usePostLikeComponent mutation function type has been updated to match the new useMutationFunctionType signature. This change ensures consistency and compatibility with other mutation functions in the codebase.
* chore: Update usePostRetrieveVertexOrder mutation function type
The usePostRetrieveVertexOrder mutation function type has been updated to match the new useMutationFunctionType signature. This change ensures consistency and compatibility with other mutation functions in the codebase.
* refactor: Update useGetProfilePicturesQuery function type
The useGetProfilePicturesQuery function type has been updated to match the new useQueryFunctionType signature. This change ensures consistency and compatibility with other query functions in the codebase.
* feat: Update profile picture chooser component to use ProfilePicturesQueryResponse
The profile picture chooser component has been updated to use the `ProfilePicturesQueryResponse` type from the `@/controllers/API/queries/files` module. This change ensures consistency and compatibility with other parts of the codebase.
* refactor: Update ProfilePictureForm to use ProfilePicturesQueryResponse
Refactor the ProfilePictureForm component to use the ProfilePicturesQueryResponse type from the "@/controllers/API/queries/files" module. This change ensures consistency and compatibility with other parts of the codebase.
* refactor: Update handleGetProfilePictures to use useGetProfilePicturesQuery
Refactor the handleGetProfilePictures function in the GeneralPage component to use the useGetProfilePicturesQuery hook instead of manually calling the useGetProfilePicturesQuery function. This change ensures consistency and compatibility with other parts of the codebase.
* Refactored logout to use the onSuccess and onError inside the API hook instead of in a new hook.
* fix: add check before setting up LangSmithTracer
Refactor the LangSmithTracer class in langsmith.py to improve error handling during initialization. The setup_langsmith method now checks for the presence of the LANGCHAIN_API_KEY environment variable before proceeding with the setup. This ensures that the tracer is only initialized when the necessary API key is available. Additionally, the order of operations within the __init__ method has been adjusted to ensure that the setup_langsmith method is called after the necessary attributes are assigned. These changes enhance the reliability and robustness of the LangSmithTracer.
* fix(langsmith.py): add conditional check to prevent executing code if tracer is not ready
---------
Co-authored-by: Lucas Oliveira <62335616+lucaseduoli@users.noreply.github.com>
* feat(agent.py): add support for handling message responses in LCAgentComponent to improve agent functionality and interaction with messages
* feat: add ToolEnabledLanguageModel type alias to constants.py
This commit adds a new type alias `ToolEnabledLanguageModel` to the `constants.py` file in the `field_typing` module. This type alias is used to define the type of language models that have tooling enabled. It includes the `BaseLanguageModel`, `BaseLLM`, and `BaseChatModel` types. This change enhances the typing capabilities of the codebase and improves the clarity of the code.
* feat: update agent.py to include support for ToolEnabledLanguageModel
This commit modifies the `agent.py` file to include support for the `ToolEnabledLanguageModel` in the `LCToolsAgentComponent` class. The `ToolEnabledLanguageModel` is now added as an input type in the `HandleInput` section. This change enhances the functionality of the agent by allowing it to work with language models that have tooling enabled. The addition of this input type improves the flexibility and versatility of the codebase.
* feat: add support for ToolEnabledLanguageModel in LCAgentComponent
This commit modifies the `agent.py` file to include support for the `ToolEnabledLanguageModel` in the `LCAgentComponent` class. The `ToolEnabledLanguageModel` is now added as an input type in the `HandleInput` section. This change enhances the functionality of the agent by allowing it to work with language models that have tooling enabled. The addition of this input type improves the flexibility and versatility of the codebase.
* feat: add AgentAsyncHandler for handling callbacks from Agents
This commit adds the `AgentAsyncHandler` class to handle callbacks from langchain in the `callback.py` file. The `AgentAsyncHandler` is an async callback handler that can be used to handle various events such as tool start, tool end, agent action, and agent finish. This change enhances the functionality of the codebase by providing a convenient way to handle callbacks from langchain and log the events if a log function is provided.
* chore: add field_serializer decorator to Log class for message serialization
This commit adds the `field_serializer` decorator to the `Log` class in the `schema.py` file. The decorator is used to serialize the `message` attribute of the `Log` class, ensuring that all nested objects are properly serialized. This change improves the serialization process and enhances the functionality of the codebase.
* feat: Fix issue with logs in LangSmithTracer
This commit fixes an issue in the `LangSmithTracer` class where logs were not being properly serialized. The `add_metadata` method now converts logs to dictionaries using the `model_dump` method if they are not already dictionaries. This ensures that all logs are correctly serialized and improves the functionality of the codebase.
* feat: Add support for Pydantic V1 models in Log serialization
* fix: Update LCAgentComponent to handle list results in result variable
This commit modifies the `LCAgentComponent` class in the `agent.py` file to handle list results in the `result` variable. If the `result` is a list, it is joined into a single string using the `text` attribute of each result dictionary. This change improves the functionality of the codebase by ensuring that the `result` variable is always a string, which is expected by the `Message` class.
* feat: Add "name" parameter to AgentAsyncHandler methods
This commit adds a "name" parameter to the `on_tool_start`, `on_tool_end`, `on_agent_action`, and `on_agent_finish` methods of the `AgentAsyncHandler` class in the `callback.py` file. The "name" parameter allows for specifying a name for the event, which can be useful for logging and tracking purposes. This change enhances the functionality of the codebase by providing more flexibility in handling callbacks and improves the clarity of the code.
* feat: Update AgentAsyncHandler constructor to support logging multiple loggable types
This commit updates the `AgentAsyncHandler` constructor in the `callback.py` file to support logging multiple loggable types. The `log_function` parameter now accepts a callable that can handle either a single `LoggableType` or a list of `LoggableType` objects along with a string representing the event name. This change enhances the flexibility of the codebase by allowing for more versatile logging options and improves the clarity of the code.
* refactor(callback.py): update type hints in AgentAsyncHandler constructor and methods for better readability and accuracy
refactor(callback.py): simplify on_tool_end method by using **kwargs for flexibility and consistency with other methods