* Fixed bug where starter projects were refactored incorrectly
* fix: improve handling of selected outputs in custom component template builder
- Added checks to ensure selected output is valid before attempting to set its state.
- Enhanced code readability with comments explaining the logic for selecting outputs.
* Set selected output as the previous selected output
* Update base.py
---------
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
* feat: add formatPayloadTweaks utility and integrate into API code generation
* feat: integrate formatPayloadTweaks utility for centralized payload processing in API code generation
* refactor: clean up formatPayloadTweaks import and improve curl command formatting
* refactor: remove commented code and streamline payload processing in APITabsComponent
* fix: uncomment TextInput in INPUT_TYPES constant
* fix: uncomment TextInput in INPUT_TYPES and update filter-tweaks to include it
* refactor: update OutputComponent styles and enhance dropdown functionality
* Adjusted text size in OutputComponent for better readability.
* Improved dropdown button styling and added hover effects.
* Enhanced dropdown content layout to display output types alongside names.
* Added console log for outputs to assist in debugging.
* refactor: remove console log from OutputComponent for cleaner code
* refactor: streamline GenericNode component and enhance NodeOutputs functionality
* Removed conditional rendering for hidden outputs in GenericNode for cleaner code.
* Introduced hasExistingHiddenOutputs prop to NodeOutputs for better state management.
* Updated OutputComponent styles for improved visual consistency and output type display.
* style: update OutputComponent padding for improved layout
* Added padding to the OutputComponent for better spacing and visual consistency.
* Update pass_message.py
* Update src/backend/base/langflow/components/logic/pass_message.py
Co-authored-by: Eric Hare <ericrhare@gmail.com>
---------
Co-authored-by: Eric Hare <ericrhare@gmail.com>
Co-authored-by: Yuqi Tang <yuqi.tang@datastax.com>
* only allow customvals and options to be in the options list
* ✨ (general-bugs-dropdown-select-not-in-list.spec.ts): add additional test cases to cover dropdown selection functionality and ensure correct behavior in the frontend application
---------
Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
* Update loop.py
* [autofix.ci] apply automated fixes
* Update loop-component.spec.ts
* change dataframe input name to inputs
* [autofix.ci] apply automated fixes
* 🐛 (typescript_test.yml): increase the maximum shard count to 40 to improve test distribution and efficiency
* 🔧 (typescript_test.yml): adjust optimal shard count calculation to use a maximum of 10 shards instead of 40 for better test distribution
🐛 (loop-component.spec.ts): fix getByTestId selector to match the updated element ID for testing purposes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Yuqi Tang <yuqi.tang@datastax.com>
Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
* ⚡️ Speed up method `JobQueueService.create_queue` by 630% in PR #5940 (`refactor-build-flow`)
Certainly! To optimize the provided `JobQueueService` class to run faster, we should ensure the code efficiency in creating event managers and handling queues. We can speed up the process by making the following changes.
1. Remove redundant logger calls if they don't provide essential debugging or monitoring information.
2. Inline `create_default_event_manager` function to avoid redundant function calls while ensuring that the `EventManager` setup remains efficient.
3. Ensure faster dictionary access and error message handling.
Here is the rewritten and optimized code.
In this optimization.
1. The `create_queue` method was streamlined to reduce redundancy checks and fewer logger messages.
2. The `create_default_event_manager` function is integrated directly as `_create_default_event_manager` private method within the class.
3. Utilized list iteration instead of multiple function calls to register events efficiently in the `EventManager`.
These changes aim to maintain functionality while improving performance where possible, particularly in the setup process.
* fix: improve error messages in JobQueueService for better clarity
* [autofix.ci] apply automated fixes
* refactor: Relax event type constraint in EventManager
Change event type from a strict literal to a more flexible string type, allowing for greater extensibility in event registration
* [autofix.ci] apply automated fixes
* [autofix.ci] apply automated fixes
* fix: update send_event method to use str for event_type
* fix: change event_type parameter to str and handle invalid types in create_event_by_type
* fix: Add noqa comment to suppress linting warning for access_host assignment
---------
Co-authored-by: codeflash-ai[bot] <148906541+codeflash-ai[bot]@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* chore: update langchain-anthropic dependency to version 0.3.14 and adjust revision in uv.lock
* fix: add workaround for handling function calling in Anthropic output processing
* Fix indentation
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* fix: remove duplicate error message in _extract_output_text function
* fix: update _build_llm_model to handle missing attributes gracefully
* fix: handle max_tokens default value and improve error handling in AnthropicModelComponent
* fix: enhance input handling in Component class to manage deepcopy errors
* fix: add 'no_blockbuster' marker to pytest configuration for improved test control
* fix: refactor agent component tests to include all OpenAI and Anthropic models, improving validation and error reporting
* fix: update agent components to include pydantic validation and improve error handling across multiple starter projects
* fix: set default max_tokens value in AnthropicModelComponent and improve API URL handling
* fix: enhance error reporting in AgentComponent tests by capturing exceptions and response discrepancies for all Anthropic models
* chore: update package versions in uv.lock, including alembic, arize-phoenix-otel, bce-python-sdk, boto3-stubs, botocore-stubs, tornado, and others for improved compatibility and features
* fix: update agent components across multiple starter projects to include new imports and improve error handling
* fix: streamline max_tokens handling in AnthropicModelComponent for improved clarity and robustness
* [autofix.ci] apply automated fixes
* fix: update artifacts_raw type to allow None for better flexibility
* fix: initialize artifacts_raw as an empty dict if None to prevent errors
* fix: specify type for similarity_score to enhance type safety and clarity
* fix: refactor JSON parsing to improve variable naming and clarity
* fix: skip flaky test in Portfolio Website Code Generator until stabilized
---------
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
* Add nginx body size upload limit config
* Add nginx body size upload limit config
* Rename env variable to match existing max upload
* Rename env variable to match existing max upload
* Add export of Max_file_size_upload variable
* Add unit to max body size
* Remove unit from default assignment
* Apply comments and move config to default nginx conf template
---------
Co-authored-by: daniel.kaestner <daniel.kaestner@cas.de>
Co-authored-by: Dexter192 <DanielKaestner@otlook.de>
* refactor: Simplify flow execution and update input handling in MCP API
- Replaced `InputValueRequest` with `SimplifiedAPIRequest` for cleaner input management.
- Updated flow execution logic to utilize `simple_run_flow`, enhancing clarity and performance.
- Removed unnecessary background task handling and streamlined progress updates.
- Improved message collection from flow outputs, ensuring robust handling of results.
* fix: Add error handling for tool execution in MCP API
- Implemented a try-except block around the flow execution to catch and handle exceptions gracefully.
- Enhanced message collection logic to ensure that errors during tool execution are communicated back as text content.
- Improved robustness of the `handle_call_tool` function by ensuring all potential errors are captured and reported.
* fix: Improve error messaging in tool execution for MCP API
- Updated error handling in the `handle_call_tool` function to provide more descriptive error messages.
- Changed the error message format to include the flow name, enhancing clarity for debugging purposes.
- Ensured that all exceptions during tool execution are captured and reported as text content.
* refactor: Enhance message and result handling in handle_call_tool
- Improved the logic for processing outputs in the `handle_call_tool` function to handle messages and results more comprehensively.
- Streamlined the collection of text content from both messages and results, ensuring all relevant outputs are captured.
- Enhanced robustness by ensuring that all outputs are processed, regardless of their structure.
* refactor: Improve progress notification handling in handle_call_tool
- Updated the logic for progress task creation in the `handle_call_tool` function to ensure it only initializes when progress notifications are enabled and a progress token is present.
- Enhanced the cancellation and exception handling of the progress task to prevent potential errors when it is not created.
- Improved overall robustness of the function by ensuring that progress updates are managed correctly based on the current context.
* refactor: Streamline flow execution and message handling in ProjectMCPServer
- Replaced `InputValueRequest` with `SimplifiedAPIRequest` for improved input management.
- Updated flow execution to utilize `simple_run_flow`, enhancing clarity and performance.
- Refined progress notification handling to ensure tasks are only created when necessary.
- Improved message collection from flow outputs, ensuring robust handling of both messages and results.
- Enhanced error handling during tool execution to provide clearer feedback on failures.
* refactor: enhance progress update handling in ProjectMCPServer
Updated the send_progress_updates function to accept a progress token as an argument, improving its flexibility. Adjusted the task cancellation logic to use asyncio.gather for better exception handling. This change aims to streamline progress notifications when enabled.
* refactor: add group_outputs property to message configurations in starter projects
* Added truncation items as constant and reduced it to 100
* Added truncation test to regression
* get max items length from config
* changed typo in backend
* refactor: Improve NVIDIA System-Assist client initialization and error handling
- Updated the `maybe_register_rise_client` method to enhance error handling and remove unnecessary context management.
- Clarified the component description to specify Windows-only support.
- Improved input prompt information with an example for better user guidance.
* refactor: use constant for rise_initialized key in NvidiaSystemAssistComponent
Replaced hardcoded string with a constant for the rise_initialized key to improve code readability and maintainability.
* Create convertor.py
* [autofix.ci] apply automated fixes
* convert component
* [autofix.ci] apply automated fixes
* add Type_conversion base class with dispatchers for performance based conversion
* fix lint issues
* add type_convertor test
* [autofix.ci] apply automated fixes
* update tests
* fix tests
* update with auto conversion methods
* update function to component file
* feat: enhance input validation for Data, DataFrame, and Message types
* test: add unit tests for DataInput, MessageInput, and DataFrameInput data conversion
* updated changes to use type classes
* [autofix.ci] apply automated fixes
* add convert logic
* update converts
* Update converter.py
* [autofix.ci] apply automated fixes
* revert converter.py
* Update inputs.py
* Update test_inputs.py
* update to logic
* Update test_type_convertor_component.py
* update converter
* [autofix.ci] apply automated fixes
* refactor: rename conversion functions for clarity
Updated function names for converting inputs to Message, Data, and DataFrame types to improve readability and consistency. The changes include renaming `get_message_converter` to `convert_to_message`, `get_data_converter` to `convert_to_data`, and `get_dataframe_converter` to `convert_to_dataframe`. Additionally, added a check for dictionary input in the data conversion function.
* fix: add TYPE_CHECKING for conditional imports in message.py
Introduced TYPE_CHECKING to optimize imports for the DataFrame type, ensuring that the import only occurs during type checking. This change enhances performance and maintains compatibility with static type checkers.
* refactor: simplify data conversion methods in Message class
Removed unnecessary parameters from the `to_data` and `to_dataframe` methods in the Message class, enhancing clarity and reducing complexity. The methods now directly use instance attributes, improving code readability and maintainability.
* refactor: enhance DataFrame methods for clarity and type safety
Updated the `to_data` and `to_message` methods in the DataFrame class to improve clarity and type safety. The `to_data` method now directly converts the DataFrame to a Data object without parameters, and the `to_message` method uses the instance's data directly. Added TYPE_CHECKING for conditional imports to optimize performance and maintain compatibility with static type checkers.
* refactor: streamline Data class methods for improved clarity
Refactored the `to_message` and `to_dataframe` methods in the Data class to eliminate unnecessary parameters and directly utilize instance attributes. This change enhances code readability and maintainability while ensuring type safety with the appropriate imports for Message and DataFrame. Additionally, updated the logic to access instance data more intuitively.
* refactor: simplify conversion method calls by removing redundant arguments
* rename test file
* refactor: remove obsolete test file for data conversion
* refactor: add support for converting dictionary to DataFrame
---------
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: Carlos Coelho <80289056+carlosrcoelho@users.noreply.github.com>
Co-authored-by: Yuqi Tang <yuqi.tang@datastax.com>
* feat: Minimal experiment with zipping pre- and post-loop lists
Update test JSON to demonstrate a simple workflow using custom components for sequence generation and zipping, with a loop component to process the data. The changes include:
- Replaced previous components with custom components
- Added a sequence maker component
- Added a zipper component
- Configured loop component to work with the new components
- Updated flow description and last tested version
* feat: Refactor Loop Test workflow with enhanced component interactions
Update LoopTest.json to demonstrate a more complex data processing workflow:
- Modify MyZipper component to return Message instead of Data
- Update Loop component's stop condition logic
- Adjust node positions and connections
- Upgrade last tested version to 1.2.0
* test: Enhance Loop Component Test with JSON Parsing and Assertion
Add more robust testing for the Loop component by:
- Parsing TextOutput event from the response
- Extracting and parsing JSON data
- Adding detailed assertions to verify loop output
- Improving test coverage for loop component interactions
* refactor: simplify LoopTest.json structure and update node definitions
- Reduced the size of LoopTest.json by removing unnecessary edges and nodes.
- Updated node definitions for `ParseData` and `MessagetoData` components to enhance clarity and maintainability.
- Adjusted connections between nodes to reflect the new structure, ensuring proper data flow.
- Improved documentation within the JSON structure for better understanding of component functionalities.
* feat: add method to retrieve incoming edge by target parameter
- Implemented `get_incoming_edge_by_target_param` method in both `Component` and `Vertex` classes to facilitate the retrieval of source vertex IDs for incoming edges targeting specific parameters.
- Enhanced performance by caching outgoing and incoming edges in the `Vertex` class to avoid redundant calculations.
* feat: add dependency update method in LoopComponent
- Introduced `update_dependency` method to manage dependencies for the next iteration in the loop.
- Refactored existing logic to ensure proper handling of current items and loop termination conditions.
- Enhanced code clarity and maintainability by restructuring the flow of data processing within the loop.
* [autofix.ci] apply automated fixes
* refactor: update message assertions in TestLoopComponentWithAPI for accuracy
* feat: enhance LoopTest.json structure and component definitions
- Expanded the LoopTest.json file to include additional nodes and edges, improving the representation of component interactions.
- Updated definitions for `MyZipper`, `LoopComponent`, `MessagetoData`, and `ChatOutput` to enhance clarity and functionality.
- Introduced new properties and methods in components to support better data handling and processing.
- Improved documentation within the JSON structure for better understanding of component functionalities and usage.
* feat: add ran_at_least_once tracking to RunnableVerticesManager
- Introduced a new set, `ran_at_least_once`, to track vertices that have been executed at least once.
- Updated serialization methods to include the new property for state management.
- Enhanced logic in `all_predecessors_are_fulfilled` to prevent infinite loops for loop vertices that have already run.
* fix: add error handling for missing vertex in Component class
* refactor: improve variable naming and enhance readability in TestLoopComponentWithAPI
* feat: track vertex execution in run_manager by adding ran_at_least_once tracking
* feat: Enhance LoopComponent with dependency management and improved item output handling
- Added a method to update dependencies for the LoopComponent to ensure proper execution order.
- Improved item output logic to handle stopping conditions more effectively and update dependencies for subsequent runs.
- Refactored the item_output method to streamline the flow of data processing and context management.
* [autofix.ci] apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
Co-authored-by: Eric Hare <ericrhare@gmail.com>