* feat: Enhance Locust load testing for Langflow run endpoint
Refactor locustfile to provide more robust and configurable load testing:
- Add dynamic configuration via environment variables
- Improve error handling and logging
- Implement realistic flow run simulation
- Add connection and timeout handling
- Support API key authentication
- Enhance stats tracking and error reporting
* fix: Improve transaction logging error handling and performance
- Add `no_autoflush` context to prevent unnecessary database operations
- Change transaction logging error from exception to error level logging
- Simplify error handling in log_transaction function
* chore: Add Locust to development dependencies
Update project dependencies by adding Locust (version 2.32.9) to the development requirements, supporting load testing capabilities
* feat: Optimize database connection settings for improved performance and scalability
- Increase default pool_size from 10 to 20 for better connection handling
- Adjust max_overflow to 40 to support higher concurrent connections
- Extend db_connect_timeout from 20 to 30 seconds
- Add pool_recycle and echo settings to db_connection_settings
- Enhance documentation for database connection settings, highlighting SQLite limitations
* feat: Add Locust load testing configuration to Makefile
- Introduce comprehensive Locust load testing target with configurable parameters
- Support flexible testing scenarios with customizable users, spawn rate, and host
- Enable headless and interactive testing modes
- Add environment variable support for API key, flow ID, and other testing parameters
- Provide sensible default values for load testing configuration
* refactor: Remove unused retry configuration in Locust load testing
- Remove RETRY_DELAY and MAX_RETRIES environment variables
- Simplify FlowRunUser configuration by eliminating unused retry settings
- Maintain existing wait time configuration for load testing
* feat: Enforce FLOW_ID requirement for Locust load testing
- Add mandatory validation for FLOW_ID environment variable
- Raise a clear ValueError if FLOW_ID is not provided
- Remove default flow ID to ensure explicit configuration
- Improve load testing configuration robustness
* feat: Add configurable request timeout for Locust load testing
- Introduce `locust_request_timeout` parameter in Makefile
- Update locustfile to use configurable request timeout from environment variable
- Set dynamic connection and network timeout based on REQUEST_TIMEOUT
- Improve request handling with flexible timeout configuration
* revert change to database connection retry
* ✨ (data_to_dataframe.py): add a new component to convert Data objects into a DataFrame for easier data manipulation and analysis.
* [autofix.ci] apply automated fixes
* 📝 (data_to_dataframe.py): improve documentation for the build_dataframe method to explain the process of building a DataFrame from Data objects
* ✨ (test_data_to_dataframe.py): Add unit tests for DataToDataFrameComponent to ensure proper construction of DataFrame from Data objects with various fields and configurations.
* ✨ (test_data_to_dataframe.py): Refactor test_data_to_dataframe.py to use pandas module instead of turtle for DataFrame operations
♻️ (test_data_to_dataframe.py): Refactor test_data_to_dataframe.py to improve readability and consistency in DataFrame testing assertions
* [autofix.ci] apply automated fixes
* 🔧 (test_data_to_dataframe.py): improve variable naming for better readability and consistency in test cases
* [autofix.ci] apply automated fixes
* ✨ (test_data_to_dataframe_component.py): Add unit tests for DataToDataFrameComponent to ensure correct behavior and functionality.
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* ✨ (save_to_file.py): Add a new component 'SaveToFileComponent' to save DataFrames, Data, or Messages to various file formats. This component allows users to select the input type, file format, and file path for saving the data.
* [autofix.ci] apply automated fixes
* 🔧 (save_to_file.py): refactor variable names for better readability and consistency
🐛 (save_to_file.py): handle unsupported input types and formats by raising ValueErrors with informative error messages
* [autofix.ci] apply automated fixes
* ✨ (test_save_to_file_component.py): Add unit tests for the SaveToFileComponent to ensure proper saving of data to various file formats and handling of different input types.
* [autofix.ci] apply automated fixes
* 📝 (save_to_file.py): Add support for handling different types of message text in the SaveToFileComponent class to ensure proper saving to file
🔧 (test_save_to_file_component.py): Refactor test cases in the SaveToFileComponent test file for better readability and maintainability
* [autofix.ci] apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* feat: add is_loop property to Vertex class for detecting looping outputs
* feat: improve vertex runnability logic for graph traversal
- Update `is_vertex_runnable` to handle loop vertices more robustly
- Modify `are_all_predecessors_fulfilled` to better manage cycle dependencies
- Change adjacency maps to use sets for more efficient predecessor/successor tracking
* refactor: change graph adjacency maps from lists to sets for improved performance
- Update graph data structures to use sets instead of lists for predecessor, successor, and parent-child maps
- Modify type hints and method signatures to reflect the change from list to set
- Improve graph traversal and vertex tracking efficiency by using set operations
* 📝 (youtube_transcripts.py): update description of YouTubeTranscriptsComponent to be more concise and accurate
✨ (youtube_transcripts.py): add new output option 'data_output' to provide transcript along with the source video URL
🔧 (youtube_transcripts.py): add method 'get_data_output' to handle the new 'data_output' output option and return a Data object with transcript, video URL, and error message
* [autofix.ci] apply automated fixes
* 📝 (youtube_transcripts.py): improve documentation for get_data_output method to provide a clear description of the returned data object and its contents
🐛 (youtube_transcripts.py): handle specific exceptions from the youtube_transcript_api library to provide more informative error messages and improve error handling in the get_data_output method
* [autofix.ci] apply automated fixes
* 🐛 (youtube_transcripts.py): handle case where no transcripts are found by updating the error message and returning a default data object
🔧 (youtube_transcripts.py): refactor get_data_output method to use a default data object and combine all transcript parts into a single continuous text
* [autofix.ci] apply automated fixes
* ✨ (test_youtube_transcript_component.py): Add unit tests for YouTubeTranscriptsComponent to test various functionalities such as component initialization, output generation, error handling, and setting translation languages.
* [autofix.ci] apply automated fixes
* ✅ (test_youtube_transcript_component.py): update file_names_mapping fixture to return a non-empty list to properly test different versions of file names mapping in the YouTube transcripts component
* [autofix.ci] apply automated fixes
* 📝 (test_youtube_transcript_component.py): Add docstrings and improve variable names for better readability and maintainability
🔧 (test_youtube_transcript_component.py): Refactor error handling in test methods to use descriptive error messages and improve code readability
* [autofix.ci] apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* feat: FIrst pass at file management API
* [autofix.ci] apply automated fixes
* Add delete and edit endpoints
* [autofix.ci] apply automated fixes
* Add file size and duplicate name handling
* Ensure the File model has a unique name
* Ensure count is before extension
* [autofix.ci] apply automated fixes
* Add the correct path to the return
* Added function to handle list of paths in File component
* [autofix.ci] apply automated fixes
* Update input_mixin.py
* Refactor to a v2 endpoint
* Add unit tests
* Update test_files.py
* Update frontend.ts
* [autofix.ci] apply automated fixes
* Remove extension from name
* Cast the string type for like
* Update files.py
* Update base.py
* Update base.py
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Lucas Oliveira <lucas.edu.oli@hotmail.com>
* feat: implement get_or_create_default_folder function to ensure default folder exists for users
* refactor: replace create_default_folder_if_it_doesnt_exist with get_or_create_default_folder for user folder creation
* test: add unit tests for get_or_create_default_folder function
* ✨ (generalBugs-shard-10.spec.ts): refactor test script to improve readability and maintainability by chaining actions on page elements instead of using separate lines for each action
---------
Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
* feat: Implement serialization functions for various data types and add a unified serialize method
* feat: Enhance serialization by adding support for primitive types, enums, and generic types
* fix: Update Pinecone integration to use VectorStore and handle import errors gracefully
* test: Add hypothesis-based tests for serialization functions across various data types
* refactor: Replace custom serialization logic with unified serialize function for consistency and maintainability
* refactor: Replace recursive serialization function with unified serialize method for improved clarity and maintainability
* refactor: Replace custom serialization logic with unified serialize function for improved consistency and clarity
* refactor: Enhance serialization logic by adding instance handling and streamlining type checks
* refactor: Remove custom dictionary serialization from ResultDataResponse for streamlined handling
* refactor: Enhance serialization in ResultDataResponse by adding max_items_length for improved handling of outputs, logs, messages, and artifacts
* refactor: Move MAX_ITEMS_LENGTH and MAX_TEXT_LENGTH constants to serialization module for better organization
* refactor: Simplify message serialization in Log model by utilizing unified serialize function
* refactor: Remove unnecessary pytest marker from TestSerializationHypothesis class
* optimize _serialize_bytes
Co-authored-by: codeflash-ai[bot] <148906541+codeflash-ai[bot]@users.noreply.github.com>
* feat: Add support for numpy integer type serialization
* feat: Enhance serialization with support for pandas and numpy types
* test: Add comprehensive serialization tests for numpy and pandas types
* fix: Update _serialize_dispatcher to return string representation for unsupported types
* fix: Update _serialize_dispatcher to return the object directly instead of its string representation
* optmize conditional
Co-authored-by: codeflash-ai[bot] <148906541+codeflash-ai[bot]@users.noreply.github.com>
* optimize length check
Co-authored-by: codeflash-ai[bot] <148906541+codeflash-ai[bot]@users.noreply.github.com>
* fix: Update string and list truncation to include ellipsis for clarity
* fix: Update _serialize_primitive to exclude string type from primitive handling
* feat: Enhance serialization to handle numpy types and introduce unserializable sentinel
* fix: Update test cases for serialization of numpy boolean values for consistency
---------
Co-authored-by: codeflash-ai[bot] <148906541+codeflash-ai[bot]@users.noreply.github.com>
* Add tests for run_flow_from_json with fake environment variables
- Implemented test_run_flow_with_fake_env to validate flow execution with a fake .env file.
- Added test_run_flow_with_fake_env_TWEAKS to check flow execution using environment variables loaded from the fake .env file.
* Replace keys in tweaks with their corresponding environment variable values
- Implemented a function to recursively replace keys in the tweaks dictionary with values from the provided environment variables.
* updated to use better way to load test json file
* [autofix.ci] apply automated fixes
* [autofix.ci] apply automated fixes
* refactor: improve test readability and consistency in load tests
- Renamed variable `TWEAKS` to `tweaks_dict` for clarity and consistency across tests.
- Updated test function names to follow a consistent naming convention.
- Enhanced comments for better understanding of test intentions.
- Minor formatting adjustments to improve code readability.
* feat: add aload_flow_from_json and arun_flow_from_json to module exports
* fix: correct file path handling in aload_flow_from_json function
* fix: improve environment variable handling in aload_flow_from_json function
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
* feat: Add tool_mode field to Output model for tool usage specification
* fix: Specify type for component_toolkit in to_toolkit method
* feat: Add method to determine if output should be skipped in ComponentToolkit
* [autofix.ci] apply automated fixes
* test: Add tool_mode field to Output model in test schema
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* feat: Add database connection settings configuration
Introduce a new `db_connection_settings` dictionary to centralize database connection parameters. Mark `pool_size` and `max_overflow` as deprecated, recommending the use of the new configuration dictionary instead.
* refactor: Improve database connection settings handling
Add a method to build connection kwargs that merges deprecated settings with the new db_connection_settings, providing a more flexible and backwards-compatible approach to database connection configuration.
* fix: Resolve SQLAlchemy async engine pool configuration for SQLite
Explicitly set AsyncAdaptedQueuePool for SQLite connections to address potential async engine configuration issues. This ensures proper pool handling when creating database connections, particularly for SQLite databases.
* test: Add mock testing for bundle loading from GitHub URLs
Enhance test coverage for `load_bundles_from_urls()` by introducing a mock fixture to simulate zip file content and mocking HTTP requests. This allows testing the bundle loading mechanism without making actual network calls.
* [autofix.ci] apply automated fixes
* test: Enhance GitHub URL detection test with mocking and improved coverage
Refactor `test_detect_github_url` to use AsyncMock and patch for more robust testing of GitHub URL detection, including verification of API calls and handling of different URL scenarios.
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* refactor: add test for sorting vertices in unconnected graph
Add a new test case to the `test_get_sorted_vertices_with_unconnected_graph` function in the `test_utils.py` file. This test verifies the correct sorting of vertices in an unconnected graph. The test defines a graph structure and checks that the first layer contains the input vertices and the remaining layers contain the rest of the vertices in the correct order.
Refactor the code to improve test coverage and ensure the correctness of the sorting algorithm.
* refactor: improve handling of unconnected vertices in graph sorting
* [autofix.ci] apply automated fixes
* Refactor: Update start_component_id in test_get_sorted_vertices_with_unconnected_graph
The start_component_id parameter in the test_get_sorted_vertices_with_unconnected_graph function was updated to "A" to improve the handling of unconnected vertices in graph sorting.
* Refactor: Improve handling of unconnected vertices in graph sorting
* [autofix.ci] apply automated fixes
* Refactor: Add test_filter_vertices_from_vertex function to test_utils.py
* Refactor: Add error handling for missing graph information in filter_vertices_up_to_vertex and filter_vertices_from_vertex functions
* [autofix.ci] apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* feat: add arxiv component
* [autofix.ci] apply automated fixes
* test: add initial test suite for arxiv component
* fix: correct test formatting for ArXiv component
* fix: implement tests for ArXivComponent following TestBatchRunComponent pattern
* fix: ArXivComponent test formatting
* [autofix.ci] apply automated fixes
* refactor: update imports and skip version tests for new component
* fix: fix line breaks in test file
* [autofix.ci] apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* feat: add dialog support to dropdown components and enhance AstraDB integration
- Introduced a new NodeDialog component for improved user interaction when connecting to Astra DB.
- Updated AstraDBVectorStoreComponent to include a dialog option for creating new collections.
- Enhanced dropdown components to support dialog functionality, allowing users to create new options directly from the dropdown.
- Added `hasDialog` property to relevant component types to manage dialog visibility.
- Refactored utility functions to support new naming conventions and improve code clarity.
* [autofix.ci] apply automated fixes
* Remove creation parameters, add new inputs for dialog
* Update astradb.py
* [autofix.ci] apply automated fixes
* Update the mixins for dialog_inputs
* [autofix.ci] apply automated fixes
* [autofix.ci] apply automated fixes
* refactor: standardize JSON formatting and clean up input types in Vector Store RAG configuration
- Reformatted JSON structure for better readability, ensuring consistent indentation and line breaks.
- Updated input types across various components to use array notation for clarity.
- Removed extraneous entries in package-lock.json to streamline dependencies.
- Enhanced overall maintainability of the configuration files.
* Add new options_metadata field to dropdown mixin
* Update test_astra_component.py
* Properly set dictionary mapping
* Update astradb.py
* Fix collection loading
* [autofix.ci] apply automated fixes
* Update astradb.py
* Update astradb.py
* [autofix.ci] apply automated fixes
* [autofix.ci] apply automated fixes (attempt 2/3)
* Enhance AstraDB integration and update dropdown components
- Updated the AstraDBVectorStoreComponent to include new input fields for database and collection creation, with default options for selection.
- Refactored dropdown components to support dynamic dialog inputs, improving user interaction for creating new options and refreshing lists.
- Updated package-lock.json to reflect dependency upgrades, including Rollup and SWC packages.
This commit improves the functionality and usability of the AstraDB integration and dropdown components, ensuring a smoother user experience.
* Update astradb.py
* Fix autodetection
* Enhance dropdown components to support options metadata
- Added `optionsMetaData` prop to Dropdown and DropdownComponent for improved data handling.
- Updated rendering logic in Dropdown to display metadata alongside options, enhancing user experience.
- Modified type definitions to include `optionsMetaData` in relevant components.
These changes improve the flexibility and usability of dropdown components, allowing for richer data presentation.
* Refactor and enhance AstraDB integration and dropdown components
- Updated the `Vector Store RAG.json` configuration for improved formatting and consistency in output and input types.
- Enhanced the `NodeDialogComponent` to accept `dialogInputs` as a prop, allowing for more dynamic content rendering.
- Modified the `Dropdown` component to use `onSelect` instead of `onClick` for better accessibility and user interaction.
- Improved rendering logic in the `Dropdown` component to conditionally display icon options based on the presence of `dialogInputs`.
These changes enhance the usability and flexibility of the AstraDB integration and dropdown components, providing a more intuitive user experience.
* Don't inherit from dict input in new inputs
* [autofix.ci] apply automated fixes
* Update astradb.py
* update logic for dropdown
* Fix the number of records per collection
* Update astradb.py
* [autofix.ci] apply automated fixes
* [autofix.ci] apply automated fixes (attempt 2/3)
* feat: Enhance Dropdown and Parameter Render Components
- Updated Dropdown component to integrate post template value handling and refresh functionality.
- Refactored ParameterRenderComponent to conditionally render based on dialog inputs.
- Improved DropdownComponent to accept additional props for better flexibility.
These changes improve the overall functionality and usability of the dropdown components within the application.
* Set unknown to none to hide unavailable fields
* Update astradb.py
* Refactor Dropdown Component for Enhanced Usability
- Removed unnecessary state initialization and improved code readability.
- Updated button elements within the dropdown to enhance user interaction.
- Added loading state indication for the refresh button.
- Filtered out null values from options metadata for cleaner rendering.
These changes streamline the dropdown functionality and improve the user experience.
* Refactor NodeDialog, Dropdown, and ParameterRender Components
- Commented out debug logs in NodeDialogComponent to clean up console output.
- Enhanced Dropdown component to conditionally render icon options based on dialog inputs.
- Updated ParameterRenderComponent to check for the length of dialog inputs before rendering.
These changes improve code readability and ensure components behave correctly based on input conditions.
* [autofix.ci] apply automated fixes
* Cleanup some tests
* Fix ruff style issue
* [autofix.ci] apply automated fixes
* Fix environment specification
* [autofix.ci] apply automated fixes
* Update starter project template
* Update astradb.py
* Remove backwards compatibility features
* [autofix.ci] apply automated fixes
* Small tweak to autodetect
* [autofix.ci] apply automated fixes
* Refactor NodeDialogComponent to Dynamically Render Inputs
- Replaced static content in NodeDialogComponent with dynamic rendering based on dialogInputs.
- Introduced NodeInputField and RenderInputParameters components for better modularity.
- Enhanced footer with Cancel and Save buttons, improving user interaction.
These changes enhance the flexibility and usability of the NodeDialogComponent, allowing it to adapt to varying input configurations.
* Refactor NodeDialogComponent: Remove Unused Imports
- Commented out unused imports in NodeDialogComponent to clean up the code.
- This change enhances code readability and prepares the component for future updates.
No functional changes were made; the focus was on improving code quality.
* Refactor Dropdown and ParameterRender Components for Improved Readability and Functionality
- Renamed functions in Dropdown component for clarity: `renderOptionsList` and `renderCreateOptionDialog` to `oldRenderOptionsList` and `renderCustomOptionDialog`, respectively.
- Enhanced the rendering logic in Dropdown to streamline the display of options and metadata.
- Simplified the return structure in ParameterRenderComponent to always render the RefreshParameterComponent, improving code consistency.
- Updated RefreshParameterComponent to conditionally display the refresh button based on the presence of dialog inputs.
These changes improve code readability and maintainability while ensuring consistent behavior across components.
* [autofix.ci] apply automated fixes
* Add the new naming conventions to deletion fields
* [autofix.ci] apply automated fixes
* [autofix.ci] apply automated fixes
* Add new cloud provider options for database creation
* [autofix.ci] apply automated fixes
* [autofix.ci] apply automated fixes (attempt 2/3)
* Make dialog inputs a dictionary of inputs
* [autofix.ci] apply automated fixes
* Update astradb.py
* Update astradb.py
* [autofix.ci] apply automated fixes
* [autofix.ci] apply automated fixes (attempt 2/3)
* Update astradb.py
* [autofix.ci] apply automated fixes
* added mock data for testing
* Clean up the reactive flow
* [autofix.ci] apply automated fixes
* Fix the dialog inputs
* Update Vector Store RAG.json
* Update Vector Store RAG.json
* Update astradb.py
* Update astradb.py
* [autofix.ci] apply automated fixes
* Update astradb.py
* Update astradb.py
* Switch dialog inputs from list to dictionary
* Update astradb.py
* Refactor NodeDialogComponent to utilize useDialogSubmit hook for handling dialog submissions and streamline input rendering. Remove unused props and mock data, enhancing clarity and maintainability. Update DropdownComponent to remove unnecessary content prop. Introduce useDialogSubmit hook for improved API interaction and loading state management.
* New structure for dialog inputs
* [autofix.ci] apply automated fixes
* [autofix.ci] apply automated fixes (attempt 2/3)
* No need for the input type on token
* Flip order of ingest and search
* [autofix.ci] apply automated fixes
* Remove id field from factory
* Remove other id field
* [autofix.ci] apply automated fixes
* Refactor directory_reader.py to simplify file filtering logic
* Refactor flowSidebarComponent to filter out bundles and custom components in CategoryGroup
* [autofix.ci] apply automated fixes
* Refactor NodeDialogComponent to utilize dialogInputs directly, removing mock data and enhancing parameter rendering. Update Dropdown and ParameterRenderComponent types to accept single dialogInputs object. Remove unused useDialogSubmit hook.
* ✨ (NodeDialogComponent/index.tsx): Introduce handleNewValue function to handle updating node template values based on user input
🔧 (NodeDialogComponent/index.tsx): Add support for process.env.PORT environment variable to be able to run app on a configurable port
🔧 (dropdownComponent/index.tsx): Add nodeId prop to Dropdown component to pass node id for better context
🔧 (parameterRenderComponent/index.tsx): Update handleOnNewValue prop to accept key parameter for better handling of new values
🔧 (parameterRenderComponent/types.ts): Add nodeId property to BaseInputProps type for better context and consistency
* Don't load the new collection names from db
* Update astradb.py
* Temporary disabling of dialog inputs functionality
* Update directory_reader.py
* Fix problematic uv.lock line
* Update uv.lock
* Update Vector Store RAG.json
* Update Vector Store RAG.json
* refactor: enhance dropdown and refresh button logic for better user experience
- Updated the dropdown component to disable the trigger button when there are no options available or when certain conditions are met.
- Removed the old render options list to streamline the dropdown rendering process.
- Improved the loading state handling in the dropdown to provide clearer feedback to users.
- Refactored the refresh button logic to ensure it only displays when appropriate conditions are met, enhancing the component's responsiveness.
* [autofix.ci] apply automated fixes
* Allow combobox specification of api endpoint
* [autofix.ci] apply automated fixes
* [autofix.ci] apply automated fixes
* [autofix.ci] apply automated fixes
* Update Vector Store RAG.json
* Add back api_endpoint option for compatibility
* Update Vector Store RAG.json
* [autofix.ci] apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Eric Hare <ericrhare@gmail.com>
Co-authored-by: anovazzi1 <otavio2204@gmail.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
* Added backend to allow loop on output
* Added custom edge for looping components
* Added allows_loop to output type
* Added output_types to target handle if its a loop
* Fixed valid_connection to allow loops
* Added the loop handle to the outputs
* Added infinity icon
* Fixed clean edges to not delete loop edge
* Implement loop checking before build.
* Implemented looping indicator
* Fixed belzier path
* [autofix.ci] apply automated fixes
* 🔧 (reactflowUtils.ts): refactor cleanEdges and detectBrokenEdges functions to improve code readability and maintainability by extracting repeated logic into variables and reducing code duplication.
* [autofix.ci] apply automated fixes
* Add from_loop_target_handle method to TargetHandle class and update type field
* Enhance Edge class to handle loop target handles and validate loop edges
* Add output_names attribute and get_value_from_output_names method to Vertex class
* Add overlap check for input and output names in Component class
* Fix default value assignment in ComponentVertex to handle output names correctly
* Clarify error message for missing attributes in Component class
* Added backend to allow loop on output
* Added custom edge for looping components
* Added allows_loop to output type
* Added output_types to target handle if its a loop
* Fixed valid_connection to allow loops
* Added the loop handle to the outputs
* Added infinity icon
* Fixed clean edges to not delete loop edge
* Implement loop checking before build.
* Implemented looping indicator
* Fixed belzier path
* [autofix.ci] apply automated fixes
* 🔧 (reactflowUtils.ts): refactor cleanEdges and detectBrokenEdges functions to improve code readability and maintainability by extracting repeated logic into variables and reducing code duplication.
* [autofix.ci] apply automated fixes
* Add from_loop_target_handle method to TargetHandle class and update type field
* Enhance Edge class to handle loop target handles and validate loop edges
* Add output_names attribute and get_value_from_output_names method to Vertex class
* Add overlap check for input and output names in Component class
* Fix default value assignment in ComponentVertex to handle output names correctly
* Clarify error message for missing attributes in Component class
* feat: add loop component 🎁🎄 (#5429)
* add loop component 🎁🎄
* [autofix.ci] apply automated fixes
* fix: add loop component to init
* [autofix.ci] apply automated fixes
* refactor(loop): rename loop input variable and improve code quality
- Renamed 'loop' input to 'loop_input' for clarity.
- Simplified logic for checking loop input and aggregating results.
- Enhanced type hints for better code readability and maintainability.
* refactor(loop): add type hint to initialize_data method for improved clarity
* fix: mypy error incompatible return value type
* feat: adds test cases for loop component compatibility with the APIs, Loop component updates to support API (#5615)
* add loop component 🎁🎄
* [autofix.ci] apply automated fixes
* fix: add loop component to init
* [autofix.ci] apply automated fixes
* refactor(loop): rename loop input variable and improve code quality
- Renamed 'loop' input to 'loop_input' for clarity.
- Simplified logic for checking loop input and aggregating results.
- Enhanced type hints for better code readability and maintainability.
* refactor(loop): add type hint to initialize_data method for improved clarity
* adding test
* test cases added
* Update test_loop.py
* adding test
* test cases added
* Update test_loop.py
* update with the new test case method!
* Update test_loop.py
* tests updates
* Update loop.py
* update fix
* issues loop issues
* reverting debug mode params
* solves lint errors and fix the tests
* fix: mypy error incompatible return value type
* [autofix.ci] apply automated fixes
---------
Co-authored-by: Rodrigo Nader <rodrigosilvanader@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: italojohnny <italojohnnydosanjos@gmail.com>
* feat: improve model input fields for Cohere component (#5712)
feat: improve model input fields for cohere component
1. Make api_key field required
2. Convert temperature to SliderInput with range 0-2
3. Add info description to temperature slider
* refactor: improve naming consistency in DataCombiner component (#5471)
* refactor: improve naming consistency in DataCombiner component
- Rename MergeOperation to DataOperation
- Rename component to DataCombinerComponent
- Convert operation enum values to uppercase
- Update method names for consistency
* [autofix.ci] apply automated fixes
* fix: resolved linting errors in __init__.py
* [autofix.ci] apply automated fixes
* Changed operation names to capitalize only first letter
* refactor: rename DataCombinerComponent to MergeDataComponent for better clarity and backwards compatibility
* [autofix.ci] apply automated fixes
* fix: Translate Portuguese text to English in merge_data.py
* feat: add required to data_inputs in MergeDataComponent
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
* refactor: Refactor Wikipedia API component (#5432)
* refactor(wikipedia): Refactor Wikipedia API component
* test: add unit tests for WikipediaAPIComponent
* [autofix.ci] apply automated fixes
* refactor: improve WikipediaAPIComponent tests and fix lint issues
* [autofix.ci] apply automated fixes
* fix: resolve lint issues in WikipediaAPIComponent tests
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
* fix: pass slider input values correctly, add test (#5735)
* ✨ (base.py): Update field validation to include "slider" type in addition to "float" type for better parameter handling
📝 (constants.py): Add "slider" type to the list of DIRECT_TYPES for consistency and completeness
* ✅ (test_inputs.py): add unit test for SliderInput class to ensure it initializes with correct value
* 🐛 (base.py): fix comparison of field type with a list by changing it to a set to ensure correct condition evaluation
* [autofix.ci] apply automated fixes
* fix format
* [autofix.ci] apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* feat: make AWS credentials required in bedrock component (#5710)
1. Make aws_access_key_id field required
2. Make aws_secret_access_key field required
* chore: update test durations (#5736)
Co-authored-by: ogabrielluiz <24829397+ogabrielluiz@users.noreply.github.com>
* feat: add truncation to ResultDataResponse (#5704)
* chore: Update dependencies and improve platform markers in configuration files
- Added 'hypothesis' version 6.123.17 to dev-dependencies in pyproject.toml.
- Updated platform markers from 'sys_platform' to 'platform_system' for better compatibility in uv.lock, affecting multiple packages including 'jinxed', 'colorama', and 'appnope'.
- Ensured consistency in platform checks across various dependencies to enhance cross-platform support.
This update improves the project's dependency management and ensures better compatibility across different operating systems.
* feat: Enhance ResultDataResponse serialization with truncation support
- Introduced a new method `_serialize_and_truncate` to handle serialization and truncation of various data types, including strings, bytes, datetime, Decimal, UUID, and BaseModel instances.
- Updated the `serialize_results` method to utilize the new truncation logic for both individual results and dictionary outputs.
- Enhanced the `serialize_model` method to ensure all relevant fields are serialized and truncated according to the defined maximum text length.
This update improves the handling of large data outputs, ensuring that responses remain concise and manageable.
* fix: Reduce MAX_TEXT_LENGTH in constants.py from 99999 to 20000
This change lowers the maximum text length limit to improve data handling and ensure more manageable output sizes across the application.
* test: Add comprehensive unit tests for ResultDataResponse and VertexBuildResponse
- Introduced a new test suite in `test_api_schemas.py` to validate the serialization and truncation behavior of `ResultDataResponse` and `VertexBuildResponse`.
- Implemented tests for handling long strings, special data types, nested structures, and combined fields, ensuring proper serialization and truncation.
- Enhanced coverage for logging and output handling, verifying that all fields are correctly processed and truncated as per the defined maximum text length.
- Utilized Hypothesis for property-based testing to ensure robustness and reliability of the serialization logic.
This update significantly improves the test coverage for the API response schemas, ensuring better data handling and output management.
* feat: Add function to validate models with tool calling function and related fixes in agent component (#5720)
* Update nvidia.py
* update agent experience with improving model selection
update agent experience with improving model selection and making only the tool calling models available.
* variable clean up
* [autofix.ci] apply automated fixes
* Update src/backend/base/langflow/base/models/model_input_constants.py
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
* Update src/backend/base/langflow/base/models/model_input_constants.py
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
* added default models
* [autofix.ci] apply automated fixes
* [autofix.ci] apply automated fixes (attempt 2/3)
* format errors solved
* [autofix.ci] apply automated fixes
* Update model.py
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
* feat: assistants agent improvements (#5581)
* assistants agent improvements
* remove alembic init file
* vector store / file upload support
* use sync file object (required by sdk)
* steps
* self.tools initialization
* improvements for edwin
* add name and switch to MultilineInput
* ci fixes
* refactor: enhance flow type safety and clean up unused code (#5669)
* 📝 (use-save-flow.ts): add AllNodeType and EdgeType imports to improve type safety in useSaveFlow hook
📝 (index.tsx): remove unused setNoticeData function to clean up code and improve readability
* refactor: Remove unused code in GeneralPage component
* refactor: Remove unused code in cardComponent/index.tsx
---------
Co-authored-by: anovazzi1 <otavio2204@gmail.com>
* feat: Add `required=True` to essential inputs across Langflow components (#5739)
* fix: add required validation to input fields
Ensures mandatory fields are properly marked as required across components.
* fix: add required validation to input fields
Ensures mandatory fields are properly marked as required across components.
* fix: add required validation to input fields
field: model_name
* fix: add required validation to input fields
field: model and base_url
* fix: add required validation to input fields
input: mistral_api_key
* fix: add required validation to input fields
inputs: model, base_url, nvidia_api_key
* fix: add required validation to input fields
inputs: model, base_url
* fix: add required validation to input fields
input: openai_api_key
* fix: add required validation to input fields
inputs: message, embedding_model
* fix: add required validation to input fields
inputs: model_name, credentials
* fix: add required validation to input fields
inputs: aws_secret_access_key, aws_access_key_id
* fix: add required validation to input fields
inputs: input_text, match_text
* fix: add required validation to input fields
inputs: input_message
* fix: add required validation to input fields
inputs: input_value
* fix: add required validation to input fields
input: data_input
* fix: add required validation to input fields
inputs: input_value
* fix: add required validation to input fields
input: data_input
* fix: add required validation to input fields
input: data_input
* fix: add required validation to input fields
input: data_input
* fix: add required validation to input fields
input: data_input
* fix: add required validation to input fields
inputs: data_inputs, embeddings
* fix: add required validation to input fields
inputs: api_key, input_value
* fix: add required validation to input fields
inputs: password, username, openai_api_key, prompt
* fix: add required validation to input fields
inputs: api_key, transcription_result
* fix: add required validation to input fields
inputs: api_key, transcription_result, prompt
* fix: add required validation to input fields
input: prompt
* fix: add required validation to input fields
input: api_key
* fix: add required validation to input fields
inputs: api_key, transcript_id
* fix: add required validation to input fields
inputs: audio_file, api_key
* [autofix.ci] apply automated fixes
* [autofix.ci] apply automated fixes (attempt 2/3)
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* feat: make YouTube Transcripts URL field required (#5686)
feat: Enhance YouTube Transcripts component by adding required field validation to URL input
This change ensures that users provide a video URL before using the YouTube Transcripts component, preventing potential runtime errors due to missing video source.
* fix: Fix memory leak when creating components (#5733)
Fix memory leak when creating components
* test: Update API key requirements and test configurations for frontend tests (#5752)
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: italojohnny <italojohnnydosanjos@gmail.com>
Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
Co-authored-by: Vinícios Batista da Silva <vinicios.batsi@gmail.com>
Co-authored-by: Raphael Valdetaro <79842132+raphaelchristi@users.noreply.github.com>
Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: ogabrielluiz <24829397+ogabrielluiz@users.noreply.github.com>
Co-authored-by: Sebastián Estévez <estevezsebastian@gmail.com>
Co-authored-by: anovazzi1 <otavio2204@gmail.com>
Co-authored-by: VICTOR CORREA GOMES <112295415+Vigtu@users.noreply.github.com>
Co-authored-by: Christophe Bornet <cbornet@hotmail.com>
Co-authored-by: Lucas Oliveira <62335616+lucaseduoli@users.noreply.github.com>
* Updated loop.py component
* [autofix.ci] apply automated fixes
* update test file
* fix: handle None values in input names and improve type hints
* [autofix.ci] apply automated fixes
* Added loop component test
* Added comments
* test: add 'allow_loop' field to Output dictionary in test_output_to_dict method
* fix: correct key name in Output dictionary from 'allow_loop' to 'allows_loop' in test_output_to_dict method
* Updated frontend loop test
* Updated examples
* 🐛 (generalBugs-shard-9.spec.ts): Fix incorrect test selector for chat memory output element
🐛 (loop-component.spec.ts): Fix incorrect test selector for chat output element
🐛 (generalBugs-shard-3.spec.ts): Fix incorrect test selector for open AI model output element
* [autofix.ci] apply automated fixes
* refactor: update return type in AgentComponent to use dotdict for build_config
This change modifies the return statement in the AgentComponent class to utilize a dotdict for the build_config, enhancing the structure and accessibility of the returned configuration data.
* [autofix.ci] apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: Rodrigo Nader <rodrigosilvanader@gmail.com>
Co-authored-by: italojohnny <italojohnnydosanjos@gmail.com>
Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
Co-authored-by: Vinícios Batista da Silva <vinicios.batsi@gmail.com>
Co-authored-by: Raphael Valdetaro <79842132+raphaelchristi@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: ogabrielluiz <24829397+ogabrielluiz@users.noreply.github.com>
Co-authored-by: Sebastián Estévez <estevezsebastian@gmail.com>
Co-authored-by: anovazzi1 <otavio2204@gmail.com>
Co-authored-by: VICTOR CORREA GOMES <112295415+Vigtu@users.noreply.github.com>
Co-authored-by: Christophe Bornet <cbornet@hotmail.com>
* feat: improve model input fields for huggingface component
1. Make model_id, inference_endpoint and api_token fields required
2. Convert temperature to SliderInput with range 0-2
3. Update temperature info to match HuggingFace's description
Co-authored-by: Vinícios Batista da Silva <vinicios.batsi@gmail.com>
* feat(huggingface): update model selection and temperature input
This commit enhances the HuggingFace component by implementing a fixed list of
large language models in the dropdown selection and improving the temperature
input with a slider control.
Key changes in src/backend/base/langflow/components/models/huggingface.py:
- Add DEFAULT_MODEL constant set to "meta-llama/Llama-3.3-70B-Instruct"
- Replace model_id StrInput with DropdownInput containing pre-selected models:
* meta-llama/Llama-3.3-70B-Instruct (default)
* mistralai/Mixtral-8x7B-Instruct-v0.1
* mistralai/Mistral-7B-Instruct-v0.3
* meta-llama/Llama-3.1-8B-Instruct
* Qwen/Qwen2.5-Coder-32B-Instruct
* Qwen/QwQ-32B-Preview
* openai-community/gpt2
* custom option
- Add real_time_refresh to model_id dropdown for dynamic updates
- Implement custom model input field that shows/hides based on selection
- Replace temperature FloatInput with SliderInput for better UX:
* Added RangeSpec with min=0, max=2, step=0.01
* Maintains default value of 0.8
- Add build_config update logic to handle custom model visibility
- Update API URL generation to support custom model IDs
- Import RangeSpec and SliderInput from langflow packages
Co-authored-by: Vinícios Batista da Silva <vinicios.batsi@gmail.com>
* [autofix.ci] apply automated fixes
* test(huggingface): update tests for enhanced model selection and UI controls
This commit updates the test suite to verify the new features and changes in
the HuggingFace component, ensuring proper functionality of the model selection
dropdown and improved temperature control.
Key changes in src/backend/tests/unit/components/models/test_huggingface.py:
- Update test_huggingface_inputs to verify new DropdownInput for model_id:
* Check DEFAULT_MODEL as default value
* Verify presence of 'custom' option
* Validate required and real_time_refresh settings
- Add verification for custom_model field:
* Confirm initial custom_model hidden state
* Verify required flag
- Add specific checks for temperature SliderInput:
* Validate default value of 0.8
* Verify RangeSpec configuration (min=0, max=2, step=0.01)
- Improve test structure with detailed assertions for field configurations
- Update imports to include DEFAULT_MODEL constant
Related to previous commit that enhanced the HuggingFace component with
fixed model list and slider controls.
Co-authored-by: Vinícios Batista da Silva <vinicios.batsi@gmail.com>
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* feat: implement function to truncate json
* refactor: apply JSON truncation function in models
* fix: update code to use the standard field serialization format
* Update src/backend/base/langflow/services/database/models/transactions/model.py
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
* Update src/backend/base/langflow/services/database/models/transactions/model.py
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
* Update src/backend/base/langflow/services/database/models/vertex_builds/model.py
---------
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
* ✨ (inputs.py): Update default prompt input types to include "MessageTextInput" for improved user experience
📝 (styleUtils.ts): Add color definition for "MessageTextInput" node to enhance visual representation in the frontend
* 📝 (text.py): Update input_types for "Value" to include "Message" for better clarity
📝 (memory.py): Update input_types for "Session ID" to include "Message" for consistency
📝 (message.py): Update input_types for "Session ID" to include "Message" for uniformity
📝 (self_query.py): Update input_types for "Query" to only include "Message" for consistency
📝 (create_data.py): Update input_types for fields to only include "Message" for consistency
📝 (update_data.py): Update input_types for fields to only include "Message" for consistency
📝 (inputs.py): Update DEFAULT_PROMPT_INTUT_TYPES to only include "Message" for consistency
📝 (styleUtils.ts): Remove "MessageTextInput" from nodeColors and nodeColorsName for consistency
* 📝 (model.py): update display name from "Text" to "Message" for better clarity
📝 (url.py): update display name from "Text" to "Message" for better consistency
📝 (memory.py): update display name from "Text" to "Message" for better understanding
📝 (text.py): update display name from "Text" to "Message" for better semantics
📝 (llm_math.py): update display name from "Text" to "Message" for improved readability
📝 (runnable_executor.py): update display name from "Text" to "Message" for better context
📝 (sql_generator.py): update display name from "Text" to "Message" for clearer communication
📝 (text.py): update display name from "Text" to "Message" for better consistency
📝 (parse_data.py): update display name from "Text" to "Message" for enhanced understanding
📝 (wikidata_api.py): update display name from "Text" to "Message" for improved semantics
📝 (test_cycles.py): update display name from "Text" to "Message" for better clarity
* [autofix.ci] apply automated fixes
* 🔧 (App.css): change width property value to fit-content to improve layout responsiveness
* fix: resolve merge conflicts and clean up URLComponent implementation in starter projects
- Removed conflicting sections in the JSON files for 'Custom Component Maker' and 'Graph Vector Store RAG'.
- Ensured the URLComponent class is correctly defined with methods for URL validation and content fetching.
- Updated input and output definitions for better clarity and functionality.
* 🐛 (freeze.spec.ts): fix incorrect test selectors for handle-textinput-shownode and handle-parsedata-shownode elements to match updated element IDs
* 📝 (NodeOutputfield/index.tsx): Add id prop to InspectButton component for better identification
🔧 (freeze-path.spec.ts, freeze.spec.ts, stop-building.spec.ts, decisionFlow.spec.ts, similarity.spec.ts, textInputOutput.spec.ts, generalBugs-shard-5.spec.ts, fileUploadComponent.spec.ts): Update test selectors to match changes in UI components for better test accuracy
* ✨ (duckduckgo.spec.ts): update the test to click on a specific element with the test ID "output-inspection-data-duckduckgosearch" instead of "output-inspection-data" to match the updated frontend implementation.
* ✨ (youtube-transcripts.spec.ts): update selector for clicking on transcript element to match changes in the frontend code, ensuring the test remains accurate
---------
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* Update ollama.py
* ollama models refactor
* ollama embeddings support for model filters
* formatting
* Update src/backend/base/langflow/components/embeddings/ollama.py
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
* [autofix.ci] apply automated fixes
* fix test
* reverting test
* refactor: Update Ollama components to use async URL validation
- Changed `is_valid_ollama_url` method to be asynchronous in both `ollama.py` files.
- Updated calls to `is_valid_ollama_url` to use `await` for proper async handling.
- Modified URL validation logic to ensure compatibility with async operations.
- Improved overall responsiveness of the Ollama components by leveraging async HTTP requests.
* reverting to empty list!
---------
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
refactor(tests): remove benchmark markers from server init tests
- Removed unnecessary @pytest.mark.benchmark decorators from multiple performance test functions in test_server_init.py.
- This change streamlines the test suite by eliminating redundant benchmarking annotations, while maintaining the integrity of the tests.
* style: Add icon property to WebhookComponent class
* style: Update input components in APIRequest class
* fix pr
* [autofix.ci] apply automated fixes
* remove debug print statement from api_request component
* remove debug print statement from api_request component
* feat: add dynamic cURL mode to APIRequestComponent
- Add cURL command parsing and field population
- Implement dynamic UI updates based on cURL input
- Support JSON body and headers extraction from cURL
- Add real-time refresh for cURL mode toggle
* refactor(APIRequestComponent): improve HTTP methods and cURL handling
- Add DELETE method support
- Enhance cURL parameter handling and UI visibility
- Fix JSON decode error handling with specific exception
- Update method visibility for DELETE requests
* style: Update input components in APIRequest class
* [autofix.ci] apply automated fixes
* remove debug print statement from api_request component
* remove debug print statement from api_request component
* feat: add dynamic cURL mode to APIRequestComponent
- Add cURL command parsing and field population
- Implement dynamic UI updates based on cURL input
- Support JSON body and headers extraction from cURL
- Add real-time refresh for cURL mode toggle
* refactor(APIRequestComponent): improve HTTP methods and cURL handling
- Add DELETE method support
- Enhance cURL parameter handling and UI visibility
- Fix JSON decode error handling with specific exception
- Update method visibility for DELETE requests
* [autofix.ci] apply automated fixes
* git commit -m "ui(api-request): adjust field visibility and requirements
- Move query_params to advanced section
- Make URL field required"
* feat(api): enhance curl parsing and update unit tests
- Improve MultilineInput handling in APIRequestComponent for curl commands
- Update parse_curl unit test to match expected data structure
- Ensure consistent format for headers and body in test assertions
* [autofix.ci] apply automated fixes
* fix(api-request): improve UI/UX and fix initial field visibility
- Fix body field flickering on component load
- Enhance URL/cURL field toggle behavior
* ✅ (filterSidebar.spec.ts): add tests for clicking on edit button modal, show headers button, and closing the modal to ensure correct behavior and visibility of elements
* 📝 (dictComponent/index.tsx): update data-testid attribute to dynamically set based on editNode value for better testability
📝 (nestedComponent.spec.ts): update test data and selectors to match changes in dictComponent/index.tsx for accurate testing
* refactor(api_request): improve component UX and field handling
- Update tool_mode placement to align with main branch changes
- Remove temporary required field validation to prevent UI conflicts
- Add field clearing logic when switching between cURL and URL modes
- Update component description to be more concise
* git commit -m "fix: resolve merge conflicts with upstream in api request component
* fix: resolve merge conflicts with upstream in api request component
* Delete src/backend/tests/unit/test_data_components.py
BREAKING CHANGE: Removed test_data_components.py as it has been replaced by test_api_request_component.py
* git commit -m "test(api-request): update test_parse_curl to match TableInput format
* style(test_api-request): apply ruff formatting rules
* [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 <cristhian.lousa@gmail.com>
Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
* refactor: Improve error handling in aupdate_messages function
* Update src/backend/base/langflow/memory.py
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
* fix(tests): updating a non-existing message adds a new message now
- Updated the test name from `test_aupdate_nonexistent_message` to `test_aupdate_nonexistent_message_generates_a_new_message` for better clarity.
- Modified the assertion to expect that a new message is generated when attempting to update a nonexistent message, changing the expected length of the updated messages from 0 to 1.
* [autofix.ci] apply automated fixes
* fix(tests): update message handling in tests for non-existent messages
- Refactored tests to ensure that attempting to update a non-existent message raises a ValueError instead of creating a new message.
- Updated test names and assertions for clarity and accuracy, ensuring they reflect the expected behavior when handling messages that do not exist in the database.
---------
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* fix: Adjust chat input handling in layer sorting logic
* fix: Update chat input sorting logic and assertions in tests
* [autofix.ci] apply automated fixes
* fix: Update test assertion for chat input sorting to reflect changes in expected output
* [autofix.ci] apply automated fixes
* fix: update vertex sorting logic to handle start_component_id condition
- Modified the condition for sorting layers to include a check for start_component_id being None, ensuring correct behavior when this parameter is not set.
- This change improves the accuracy of the vertex sorting process in the graph utility functions.
* fix: update test assertion for vertex IDs in test_get_vertices
- Modified the test assertion in `test_get_vertices` to reflect the expected output, ensuring it only checks for "ChatInput" in the returned IDs.
- This change improves the accuracy of the test by aligning it with the current expected behavior of the endpoint.
* [autofix.ci] apply automated fixes
* [autofix.ci] apply automated fixes (attempt 2/3)
* [autofix.ci] apply automated fixes (attempt 3/3)
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Ítalo Johnny <italojohnnydosanjos@gmail.com>
* refactor(tools): overhaul Python REPL component with modern tool mode
BREAKING CHANGE: Complete redesign of PythonREPL component architecture
- Replace legacy tool mode with modern tool_mode=true implementation
- Add automatic import detection for both global and from-imports
- Remove manual global_imports field in favor of automatic detection
- Implement CodeInput type support with FieldTypes.CODE
- Update schema to handle new parameters for agent compatibility
- Improve error handling and logging for import failures
The component now automatically handles imports without manual configuration,
supports modern tool mode, and provides better integration with the agent
system through updated schema definitions.
* refactor(python-repl): remove name parameter
* feat(security): add required global imports validation
- Add explicit global imports input for security control
- Set both global_imports and python_code as required fields
- Remove AST-based import analysis in favor of explicit imports
* [autofix.ci] apply automated fixes
* fix: remove generic exception handling in python_repl
Removed overly broad exception handling to comply with linting rules.
* fix
* test(python-repl): update component test to match current implementation
- Remove assertions for deprecated outputs (api_run_model, api_build_tool)
- Add assertions for current 'results' output
- Add detailed input validation tests for global_imports and python_code
- Verify input configurations including type, default values, and required status
- Ensure component template structure matches frontend requirements
This change aligns the test suite with the current PythonREPLToolComponent
implementation, improving test coverage and maintaining component reliability.
* revert(tools): restore Python REPL component to original implementation
Due to backward compatibility concerns, reverting the Python REPL component
to its initial implementation state to maintain stability and prevent breaking changes.
* feat(tools): mark Python REPL component as deprecated & Legacy
* feat(tools): add Python REPL Core component
* [autofix.ci] apply automated fixes
* fix(tests): mark Python REPL Core as unreleased component
* fix(__init__): fix
* feat(python-repl): improve example clarity for printing the results
* fix(tests): resolve KeyError in test_component_versions
* style(python-repl): format description string to follow PEP 8 guidelines
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
* refactor: Update Serp API component to standard output pattern
* test: add unit tests for SerpAPIComponent
* [autofix.ci] apply automated fixes
* fix: rename component class to avoid conflict with legacy version
* [autofix.ci] apply automated fixes
* fix: update SerpAPI to extend LCToolComponent
* [autofix.ci] apply automated fixes
* deprecate: mark SerpAPIComponent as legacy and deprecated
* refactor: update Serp API component tests to use new SerpComponent
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
* feat: implement vertex build logging with maximum retention policy
- Added functionality to log vertex builds while maintaining a maximum number of builds per vertex.
- Introduced a new setting `max_vertex_builds_per_vertex` to configure the retention limit.
- Updated `log_vertex_build` method to delete older entries in a single transaction if the limit is exceeded.
- Enhanced error handling to ensure database integrity during logging operations.
* feat: enhance transaction logging with maximum retention policy
- Implemented functionality to log transactions while maintaining a maximum limit on the number of transactions stored in the database.
- Introduced logic to delete older transactions when the limit is exceeded, ensuring efficient database management.
- Enhanced error handling to maintain database integrity during transaction logging operations.
* feat: enhance vertex build logging with global and per-vertex retention policy
- Updated the log_vertex_build function to maintain a maximum number of vertex builds globally and per vertex.
- Introduced new settings for global maximum builds to keep and per-vertex maximum builds.
- Implemented logic to delete older entries both globally and per vertex in a single transaction, ensuring efficient database management.
* fix: import dependency
* fix: update max_vertex_builds_per_vertex setting to improve build retention policy
- Changed the maximum number of builds per vertex from 5 to 2 to enhance resource management.
- This adjustment aims to optimize database storage and ensure older builds are deleted more efficiently.
* fix: ensure flow_id is a UUID in get_vertex_builds_by_flow_id function
- Added a check to convert flow_id from string to UUID if necessary, improving type safety and preventing potential errors during database queries.
* feat: add test for multiple flow builds and vertex build verification
- Implemented a new asynchronous test to validate that multiple builds of a flow generate the expected number of vertex builds.
- The test includes detailed logging of vertex build states and ensures that the number of builds per vertex adheres to the configured maximum.
- Introduced session ID generation for each request to simulate real-world usage and added delays to maintain request order.
- Enhanced verification logic to assert the correctness of build counts and validity after multiple requests.
* refactor: optimize vertex build deletion logic with CTEs
- Replaced the previous deletion logic in the log_vertex_build function with Common Table Expressions (CTEs) for improved clarity and performance.
- Introduced global and per-vertex ranking CTEs to streamline the process of identifying and deleting older vertex builds based on configured limits.
- This change enhances the efficiency of the database operations while maintaining the existing retention policies for vertex builds.
* [autofix.ci] apply automated fixes
* fix: remove unnecessary db.refresh call in log_vertex_build function
- Eliminated the redundant await db.refresh(table) line in the log_vertex_build function to streamline the deletion process.
- This change improves the efficiency of the function by reducing unnecessary database operations while maintaining the integrity of the vertex build logging logic.
* Revert "refactor: optimize vertex build deletion logic with CTEs"
This reverts commit d741233e5c3fadd79d91fbe246b005f3855300df.
* feat: enhance vertex build retrieval and logging with detailed documentation and retention policies
- Updated the `get_vertex_builds_by_flow_id` function to include comprehensive docstring documentation, clarifying its purpose, arguments, and return values.
- Refined the `log_vertex_build` function to support configurable maximum builds to keep globally and per vertex, with improved transaction handling and error management.
- Added detailed docstrings for both functions to improve code readability and maintainability.
- Ensured that the function handles string to UUID conversion for `flow_id` seamlessly, enhancing type safety.
- This update aims to improve the clarity of the codebase and ensure efficient management of vertex builds in the database.
* feat: add unit tests for vertex build logging and retention policies
- Introduced new test suite for vertex build logging, including tests for basic logging, global and per-vertex limits, integrity error handling, and concurrent logging.
- Implemented fixtures for generating sample vertex build data and mock settings to streamline testing.
- Enhanced tests to verify that the logging mechanism adheres to configured retention policies, ensuring efficient management of vertex builds in the database.
- This addition aims to improve code coverage and ensure the reliability of vertex build functionalities.
* refactor(database): replace direct table column references with col() function for consistency and clarity in query construction
* refactor(database): remove IntegrityError handling in transaction logging functions
- Eliminated the IntegrityError exception handling in the log_transaction and log_vertex_build functions to simplify error management.
- This change streamlines the transaction process by relying on a general exception handler, improving code clarity and maintainability.
* refactor(tests): convert mock_settings fixture to async and utilize asyncio.to_thread for Settings instantiation
- Updated the mock_settings fixture to be asynchronous, improving compatibility with async test cases.
- Replaced direct instantiation of Settings with asyncio.to_thread to ensure non-blocking behavior during tests.
- This change enhances the test suite's performance and aligns with the asynchronous nature of the application.
* refactor(tests): update mock_settings fixture to async for improved test performance
- Converted the mock_settings fixture to an asynchronous function, allowing for better compatibility with async test cases.
- Utilized asyncio.to_thread for the instantiation of Settings, ensuring non-blocking behavior during tests.
- This change enhances the overall performance of the test suite and aligns with the asynchronous architecture of the application.
* fix(tests): correct mock_settings fixture and remove async usage
- Fixed a typo in the import statement for datetime in the test_vertex_builds.py file.
- Changed the mock_settings fixture back to a synchronous function, removing the unnecessary use of asyncio.to_thread for Settings instantiation.
- This update ensures compatibility with the existing test structure while maintaining the intended functionality of the mock settings.
* refactor(tests): streamline vertex build logging test for improved clarity and efficiency
- Consolidated build creation and insertion logic in `test_log_vertex_build_with_different_limits`.
- Enhanced readability by reducing redundancy in build sorting and insertion steps.
- Maintained functionality to ensure limits on total and per-vertex builds are correctly enforced.
This refactor aims to improve the maintainability of the test while ensuring it accurately verifies the logging behavior of vertex builds.
* refactor(tests): comment out failing test for vertex build generation
- Temporarily disable `test_multiple_runs_with_no_payload_generate_max_vertex_builds` due to issues with its execution.
- The test was designed to verify the correct number of vertex builds generated during multiple flow builds but requires further investigation and fixes before re-enabling.
This change aims to maintain test suite stability while addressing underlying issues in the test logic.
---------
Co-authored-by: italojohnny <italojohnnydosanjos@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>