* 🐛 (utils.py): fix cascade delete flow function to correctly delete related entities in the database and handle exceptions properly
* ✨ (grid/index.tsx): Update descriptionModal to differentiate between component and flow types for better user experience
✨ (list/index.tsx): Update descriptionModal to differentiate between component and flow types for better user experience
* [autofix.ci] apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* fix: enhance TableInput validation to support single dict and Data instances
* [autofix.ci] apply automated fixes
* fix: Improve TableInput validation error handling
Change TypeError to ValueError for Pydantic validation to ensure proper error catching. Added noqa comments to suppress linting warnings about error type.
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Ítalo Johnny <italojohnnydosanjos@gmail.com>
* Update component.py
* 🐛 (loop-component.spec.ts): fix clicking on incorrect element in test causing failure
* 🔧 (freeze-path.spec.ts): Remove redundant clicks on "Close" button in multiple test cases to improve test efficiency
🔧 (freeze.spec.ts): Remove redundant clicks on "Close" button in multiple test cases to improve test efficiency
---------
Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
* Fixed edge to start at left and right sides of handle
* Fixed neon to be the same size of default handle
* Fixed source and targets Y to work on loop edges as well
* feat: Add session ID support to tracing service
This commit adds support for setting the session ID in the tracing service. Two methods have been modified:
- In the `Graph` class, the `set_session_id` method has been added to set the ID of the current session.
- In the `ArizePhoenixTracer` class, the `__init__` method has been modified to accept a `session_id` parameter and store it.
These changes enable the tracing service to associate traces with specific sessions, improving trace management and analysis.
* refactor: Improve tracing session ID handling in Graph class
- Rename `set_session_id()` method to `set_tracing_session_id()`
- Add null check for tracing service when setting session ID
- Enhance method to only set session ID when tracing service is available
---------
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
* Fixing API endpoint in HF Component, adding unit test
* [autofix.ci] apply automated fixes
* Adding __init__.[y
* Removing unit tests, covered by another PR
---------
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: 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
* add outdated starter projects tests
* add api keys loaded from db values
* ✨ (Custom Component Generator.spec.ts): add initialGPTsetup function to setup GPT integration
📝 (Custom Component Generator.spec.ts): update test to handle existing API key and log a message if API key is already added
* updated colResizeDefault to be shift
* Made last column not resize less than the maximum amount
---------
Co-authored-by: anovazzi1 <otavio2204@gmail.com>
* ✨ (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>
Added a Proper Russian README Translation Create README.RU.md
I’ve translated the README into Russian to make it more accessible. The translation stays true to the original while ensuring clarity and natural flow 🚀
✨ (validate-raise-errors-components.spec.ts): add test to validate error messages on popups when an error is raised in custom components
📝 (add-custom-component.ts): add utility function to add custom components in tests for easier testing and validation of error messages
* ✨ (tests): update tag value from "@starter-project" to "@starter-projects" for consistency across test files.
* 📝 (changes-filter.yaml): add new path "src/backend/base/langflow/custom/**" to starter-projects section
♻️ (changes-filter.yaml): remove path "src/backend/base/langflow/components/**" from components section and add it to starter-projects section
♻️ (changes-filter.yaml): add new path "src/backend/base/langflow/custom/**" to components section
* 🐛 (component.py): fix a bug where the status was not being returned when there is only one output in the component
* 🔧 (ci.yml): Expand path filter outputs for more comprehensive CI testing
* fix docstring placement
* ✨ (group.spec.ts): update click event modifiers to use "ControlOrMeta" for better cross-platform compatibility
* ✨ (changes-filter.yaml): add new directory "src/backend/base/langflow/graph/" to starter-projects for processing in the build pipeline.
* 🔄 Refactor graph data structures from sets to lists for performance and compatibility
* 🔧 Optimize RunnableVerticesManager predecessor checks and type hints
---------
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
* 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
* ⚡️ Speed up method `Graph.find_runnable_predecessors_for_successor` by 129% in PR #6309 (`fix-order-loop`)
Here's the optimized version of the program.
### Changes and Optimizations.
* fix(serialization.py): update isinstance check for list and tuple to use union operator for better type checking
---------
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: codeflash-ai[bot] <148906541+codeflash-ai[bot]@users.noreply.github.com>
* chore: Update Pillow and Pandas dependencies to latest patch versions
* chore: Update NVIDIA AI Endpoints and Pillow dependencies
* feat: Add smolagents dependency to project requirements
* feat: Add HuggingFace model bridge for LangChain integration
Implement a model bridge that allows seamless conversion between LangChain and HuggingFace model interfaces, supporting message and tool call translations
* docs: Update usage example in LangChainHFModel to improve clarity
* fix: update smolagents dependency version to 1.8.0
---------
Co-authored-by: Edwin Jose <edwin.jose@datastax.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
⚡️ Speed up function `_truncate_value` by 45% in PR #6323 (`test-smol`)
To optimize the Python program for faster performance, we should make a few adjustments. Specifically, the use of multiple `isinstance` checks and logical conditioning can be streamlined to reduce the runtime overhead. Here's the optimized version of the program.
### Explanation.
1. **Order and Conditions**: We adjusted the order to check the limit first. This way, we only perform the `isinstance` check if the limit is set, thereby potentially reducing the number of checks needed.
2. **Combined Types**: Instead of using `isinstance(value, list | tuple)`, which uses the `|` operator for a union type, we use the more traditional tuple form `isinstance(value, (list, tuple))`. This makes it explicit that we’re checking against multiple types and can be a bit faster.
These changes should result in slight performance improvements by reducing the number of checks and short-circuiting earlier.
Co-authored-by: codeflash-ai[bot] <148906541+codeflash-ai[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
* 📝 (faiss.py): import Path and List modules for better type hinting and file path handling
🐛 (faiss.py): fix issue with building vector store when persist_directory is not provided
🐛 (faiss.py): fix issue with loading FAISS index when index file does not exist
📝 (faiss.py): add type hints for search_documents method parameters and return value
📝 (faiss.py): remove unnecessary logging statements from search_documents method
* [autofix.ci] apply automated fixes
* 📝 (faiss.py): add 'required' flag to the 'Persist Directory' input field to ensure it is mandatory for the user to provide a value
* 🔧 (faiss.py): refactor build_vector_store method to handle persist_directory more efficiently
🔧 (faiss.py): refactor search_documents method to handle persist_directory more efficiently
* [autofix.ci] apply automated fixes
* 🔧 (faiss.py): refactor get_persist_directory method to return resolved persist directory path or current directory if not set
♻️ (faiss.py): refactor build_vector_store and search_documents methods to use get_persist_directory method for path resolution
* ♻️ (faiss.py): refactor resolve_path method to be static and return a string instead of Path object for consistency and clarity
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* 📝 (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>