* feat: Add deletion_field parameter to AstraDBVectorStoreComponent for document management
- Introduced a new 'deletion_field' input to specify a metadata field for deleting documents before loading new data.
- Enhanced the _add_documents_to_vector_store method to handle document deletion based on the specified field, improving data management capabilities.
* Merging with main
* [autofix.ci] apply automated fixes
* [autofix.ci] apply automated fixes
* - Enhanced the info string for the 'deletion_field' parameter to improve readability.
- Optimized the deletion logic by using a set comprehension to eliminate duplicates when gathering delete values from documents.
* [autofix.ci] apply automated fixes
* Update src/backend/base/langflow/components/vectorstores/astradb.py
Co-authored-by: Madhavan <msmygit@users.noreply.github.com>
* [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: Madhavan <msmygit@users.noreply.github.com>
* Fix Google Embeddings model dimension mismatch.
* edit model size
* [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>
* refactor(tests): add new fixtures to files tests
- Introduced new pytest fixtures for creating API keys, active users, and flows to streamline test setup.
- Updated file upload, download, list, and delete tests to utilize the new fixtures, improving clarity and maintainability.
- Ensured that flow IDs are correctly referenced in all file operations, enhancing test accuracy.
- Added cleanup logic in fixtures to maintain database integrity after tests.
This refactor improves the organization of test cases and ensures that they are more robust and easier to understand.
* fix(tests): clear services cache in test fixtures
- Added logic to clear the services cache in both `conftest.py` and `test_files.py` fixtures to ensure a clean state for tests.
- This change prevents potential interference between tests by resetting the service manager's factories and services before each test run.
* refactor(tests): streamline file upload tests and remove unused mocks
- Removed the mock implementation of StorageService from the test fixtures to simplify the test setup.
- Introduced new fixtures to set maximum file size upload limits, enhancing test flexibility.
- Updated file upload, download, and list tests to directly use the new fixtures, improving clarity and maintainability.
- Ensured that uploaded file content is accurately tested, reflecting changes in the upload and download logic.
* Refactor: Update EditNodeComponent to hide table options and block hide
* 🐛 (model.py): fix issue with search_documents method not returning empty list when search_query is empty
♻️ (model.py): refactor search_documents method to handle search_query logic more efficiently
📝 (chroma.py): add typing_extensions override import for build_vector_store method to improve code readability
* ✨ (tests): add unit tests for ChromaVectorStoreComponent
- Introduced new test suite for ChromaVectorStoreComponent, covering various functionalities including database creation, collection management, similarity and MMR searches, and duplicate handling.
- Implemented tests for creating collections with and without data, ensuring proper functionality and data integrity.
- Verified search capabilities with different query types and result limits, enhancing overall test coverage for the component.
* fix: remove unnecessary whitespace in model.py and add missing import in chroma.py
* fix: mypy error module has no attribute "timeout"
* ♻️ (async_helpers.py): Remove unnecessary type hint ignore comment from timeout_context function
* 📝 (async_helpers.py): add a comment with issue reference PGH003 to document the reason for ignoring type checking in timeout_context function
* ♻️ (async_helpers.py): Remove unnecessary type hint comment to improve code readability and maintainability
* ♻️ (async_helpers.py): Add type ignore comment to suppress miscellaneous type error for timeout_context function
* ♻️ (async_helpers.py): refactor timeout_context function to remove unnecessary type ignore comments and improve code readability
* [autofix.ci] apply automated fixes
* 📝 (async_helpers.py): add a blank line for better code readability and consistency
* fix: mypy error: incompatible redefinition
---------
Co-authored-by: anovazzi1 <otavio2204@gmail.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: italojohnny <italojohnnydosanjos@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* feat: add MockLanguageModel for testing language model interactions
- Introduced a new mock implementation of BaseLanguageModel to facilitate unit testing.
- Implemented methods to simulate responses and handle message processing.
- Added functionality to generate mock responses based on input messages.
- Ensured compatibility with existing language model interfaces for seamless integration in tests.
* refactor: simplify test_structured_output_component by replacing MagicMock with MockLanguageModel
- Removed extensive mock implementations of BaseLanguageModel in tests.
- Replaced instances of MagicMock with a new MockLanguageModel for better clarity and maintainability.
- Streamlined test cases for structured output generation and error handling.
- Ensured compatibility with existing test structure while enhancing readability.
* fix: rename utils.py to useful.py to avoid namespace conflict
---------
Co-authored-by: italojohnny <italojohnnydosanjos@gmail.com>
* fix(tests): update supported versions in constants.py to include new releases
- Updated SUPPORTED_VERSIONS to reflect the latest versions: 1.0.19, 1.1.0, and 1.1.1.
- This change ensures that tests are aligned with the most current versioning.
* refactor(tests): update file_names_mapping for input, output, and prompt components
- Removed outdated version entries (1.0.15 to 1.0.18) and added new versions (1.1.0 and 1.1.1) for ChatInput, TextInput, ChatOutput, and Prompt components.
- Ensures test cases are aligned with the latest component versions for improved accuracy and reliability.
* fix(tests): update file_names_mapping in TestTextOutputComponent to reflect new versioning
- Removed outdated version entries (1.0.17, 1.0.18) and added new versions (1.1.0, 1.1.1) for TextOutput component.
- Ensures test cases are aligned with the latest component versions for improved accuracy and reliability.
fix(tests): update ComponentTestBase to skip tests when file_names_mapping is empty
- Modified the test method to skip the test instead of raising an AssertionError when no file names mapping is provided.
- Improved user feedback by providing a clear message indicating the reason for skipping the test.
* Refactor: Commented out TextInput and TextOutput components
* Refactor: Add function to check if graph has output vertex connected to it
* Refactor: Add function to skip messages based on vertex configuration and message type
* Refactor: Update function to check for chat output in graph vertices
* Refactor: Enhance message skipping logic to include vertex existence check
---------
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
✨ (model.py): introduce MultilineInput class to handle system messages in LCModelComponent for better organization and readability
📝 (Basic Prompting.json): Update node IDs and edge IDs for better readability and consistency in the JSON file.
📝 (Basic Prompting.json): Update node properties to display a chat message in the Playground instead of generating text using OpenAI LLMs
♻️ (Basic Prompting.json): Refactor field_order and outputs properties for the Chat Output node to include new fields and remove unnecessary ones
✨ (Basic Prompting.json): Update ChatOutput component to include new inputs and outputs for better customization and functionality. Add support for storing messages, setting sender type, and customizing message appearance.
✨ (Basic Prompting.json): Update field names and values for better clarity and consistency
♻️ (Basic Prompting.json): Refactor field names and values to improve readability and maintainability
✨ (Basic Prompting.json): Update the content of the file to include a new class 'OpenAIModelComponent' with inputs for configuring OpenAI model settings and methods for building the model and handling exceptions. Remove the 'data_template' field and update 'input_value' field to 'MessageInput'. Add new fields 'json_mode', 'max_tokens', 'model_kwargs', and 'model_name' with their respective configurations.
📝 (Basic Prompting.json): Update values and descriptions for fields in the Basic Prompting starter project to improve clarity and usability. Add a new field for temperature control with a default value of 0.1.
* refactor: add create_stream_tokens_event_manager for handling streaming events
* feat: integrate EventManager into run_graph_internal for enhanced event handling
- Added EventManager import and parameter to run_graph_internal function.
- Updated function call to include event_manager for improved event management during graph execution.
* feat: enhance Graph class with event_manager parameter
- Added event_manager parameter to multiple methods in the Graph class to facilitate better event management during graph execution.
- Updated process and run methods to include event_manager, ensuring it is passed through to relevant function calls.
- Improved documentation for methods to reflect the new event_manager parameter.
* feat: implement streaming support in flow execution with EventManager integration
- Added support for streaming responses in the simplified_run_flow endpoint, allowing real-time event handling during flow execution.
- Introduced consume_and_yield and run_flow_generator functions to manage event consumption and client communication.
- Integrated EventManager for enhanced event tracking, including success and error notifications.
- Updated endpoint documentation to reflect new streaming capabilities and parameters.
- Improved error handling and logging for better debugging and client disconnection management.
* refactor: remove request logging from simplified_run_flow endpoint
- Removed the logging of the request object in the simplified_run_flow function to streamline logging and reduce verbosity.
- This change enhances the clarity of logs by focusing on essential information during flow execution.
* feat: improve gitloader component
* [autofix.ci] apply automated fixes
* feat(git.py): refactor GitLoaderComponent to support asynchronous operations and improve temporary directory management
- Convert methods to async to enhance performance with file operations.
- Implement async context manager for handling temporary clone directories.
- Update binary file check and content filtering to be asynchronous.
* fix(git.py): enhance GitLoaderComponent with improved file filtering and binary check
- Refactor file filtering logic to utilize fnmatch for pattern matching.
- Introduce a new method to check for binary files based on null byte detection.
- Update content filtering to handle exceptions more gracefully.
- Modify temporary directory cleanup to use rmdir instead of remove for better directory management.
- Adjust load_documents method to utilize asyncio.to_thread for lazy loading of documents.
* refactor(git.py): enhance GitLoaderComponent with improved file filtering and binary check
- Refactor binary file check to be synchronous and handle exceptions more gracefully.
- Introduce new methods for checking file patterns and content patterns, allowing for more flexible filtering.
- Consolidate filtering logic into a single method for better maintainability.
- Update load_documents method to run lazy loading in a separate thread for improved performance.
* feat(tests): add unit tests for GitLoaderComponent file filtering and binary detection
- Introduced new test suite for GitLoaderComponent, including tests for binary file detection and file pattern matching.
- Implemented temporary file creation for testing various file types and permissions.
- Added tests for combined filtering functionality, ensuring robust handling of file and content patterns.
* refactor(git.py): improve pattern handling and content filtering in GitLoaderComponent
- Refactored pattern handling to use a more descriptive variable name `pattern_list` for clarity.
- Enhanced content filtering by ensuring proper encoding when reading file content.
- Updated regex validation to include a test string check for better error handling.
- Removed unnecessary comments to streamline the code and improve readability.
* fix: exception TypeError
TypeError: object async_generator can't be used in 'await' expression
---------
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>
* Call __enter__ to make current langwatch trace available globally so users can more easily add more context to it, like final input and output. This means also skipping setting the root_span input and output if already set
* Update LangWatch logo
* feat(conditional-router): rename 'matches regex' to 'regex'
- Simplify the operator name in the ConditionalRouter component
- Update dropdown options for better UX
- Maintain existing functionality while using more concise naming
* [autofix.ci] apply automated fixes
---------
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: fetch composio apps list dynamically
* Ensure apps only get loaded once API key is entered
* Add comment
* typo fix
---------
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
* Added Minimized field to backend to make component start as minimized
* Added minimized as true to chat components
* Added showNode default value as the opposite of minimized
* Changed starter projects to new components
* [autofix.ci] apply automated fixes
* [autofix.ci] apply automated fixes (attempt 2/3)
* Fixed Freeze and DecisionFlow tests
* Fixed other tests that involved chatoutput and chatinput
* Restored tests that didnt fail
* Fixed stop playground test
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* Fixed FlowHeader model validator, adding data and removing it if flow is not a component
* [autofix.ci] apply automated fixes
* Fixed flowheader to use fieldvalidator instead of modelvalidator
* [autofix.ci] apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* convert flow ids to uuids when loading from dir
* Edit a migration file to check for foreign key existence
* [autofix.ci] apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* refactor: Simplify agent input text content construction
* Change HUMAN to Input
---------
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
* feat(component): enhance merge data with standard operations
- Add standard merge operations (concatenate, append, merge, join)
- Add operation selection via dropdown
- Return DataFrame output type
- Implement separate merge strategies
* style(component): improve merge data formatting
- Add MIN_INPUTS_REQUIRED constant
- Use descriptive DataFrame variable names
- Move return statement to else block
- Use list comprehension for better performance
- Fix unused loop variable
- Improve overall code formatting
* [autofix.ci] apply automated fixes
* Update src/backend/base/langflow/components/processing/merge_data.py
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
* refactor: adjust merge_data operations to use langflow.schema.DataFrame
* Update Merge Data component name and description
* [autofix.ci] apply automated fixes
* refactor: enhance data merging logic in DataMergerComponent
- Improved type hinting for combined data structures to enhance code clarity.
- Streamlined the concatenation and merging operations to ensure consistent handling of string and object types.
- Updated the logic to correctly append values to lists when merging data inputs, improving data integrity in the merging process.
* revert merge data changes
* add data merger component
* refactor: remove DataMergerComponent and clean up imports
- Deleted the DataMergerComponent to streamline the processing components.
- Updated the __init__.py file to reflect the removal of the DataMergerComponent from the exports.
* refactor: enhance MergeDataComponent with new merge operations
- Introduced a new enum, MergeOperation, to define various data merging strategies: CONCATENATE, APPEND, MERGE, and JOIN.
- Updated the merge_data method to return a DataFrame instead of a list of Data objects, improving data handling.
- Enhanced input validation to ensure a minimum number of data inputs are provided.
- Streamlined the merging logic to support different operations, improving flexibility and usability of the component.
---------
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: add OpenRouter component for multi-provider model access
- Add OpenRouter integration with provider-based model selection
- Support dynamic model fetching from OpenRouter API
- Implement temperature and max tokens controls
- Add site URL and app name for rankings
- Include model tooltips with context length and descriptions
* fix: restore SambaNova component in models __init__.py
* refactor: simplify OpenRouter build_model method
* [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>
* refactor: Rename store message component to message store
* [autofix.ci] apply automated fixes
* refactor: Rename store message component to message store
* [autofix.ci] apply automated fixes
* [autofix.ci] apply automated fixes
* fix: restore StoreMessage name for backwards compatibility
* fix(core): rename store_message.py for compatibility
- Restore original filename to maintain system compatibility
- Ensure consistent file naming across codebase
* fix(ui): correct output message display name
- Update Output display_name from "Stored Messages" to "Stored Message"
- Maintain consistency in singular/plural naming conventions
* refactor: rename message_store to store_message in helpers module
- Updated import statement in __init__.py to reflect the new module name for MessageStoreComponent.
- This change improves clarity and consistency in the component naming convention.
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
* ✨ (csv.py): Add support for passing Pandas kwargs to the CSV agent for more customization and flexibility.
* 📝 (csv.py): mark 'is_list' attribute as True for the 'Pandas Kwargs' parameter to indicate it can accept a list of values
* fix: AstraDBCQLToolComponent
Tool part is working fine but the direct Data output fails cause of partition key issue
* Ruff fix
* [autofix.ci] apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* refactor: streamline imports and enhance flow header response handling in flows.py
- Consolidated import statements for better readability.
- Updated the response structure in the function to utilize for improved data validation and consistency.
* refactor: enhance FlowHeader model with detailed field descriptions and validation
- Updated FlowHeader model to include field descriptions for better clarity and documentation.
- Introduced a model validator to ensure data integrity before processing.
- Streamlined import statements for improved readability.
---------
Co-authored-by: Lucas Oliveira <62335616+lucaseduoli@users.noreply.github.com>
* feat(components): add LangWatch evaluator component
* feat(langwatch): add tracing integration and custom endpoint support
* style(langwatch): update component name and svg icon
* [autofix.ci] apply automated fixes
* Clean code with code formatting styles
* Add contexts and expected_output also as dynamic fields
* refactor(langwatch): remove redundant logging and improve type hinting
- Removed unnecessary logger exception calls in error handling sections to streamline the code.
- Added type hinting for the trace_id assignment to enhance code clarity and maintainability.
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Rogério Chaves <rogeriochaves@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
* fix: update pre-commit configuration for ruff formatting args
* fix: update variable type constant from GENERIC_TYPE to CREDENTIAL_TYPE
* feat: enhance variable service to handle decryption for generic type and update default variable type to CREDENTIAL_TYPE
* feat: add abstract method to retrieve all variables for a user in VariableService
* feat: implement get_all method in KubernetesSecretService to retrieve and decrypt user variables
* refactor: update variable tests to use fixtures for generic and credential types
- Renamed and refactored test fixtures for better clarity and reusability.
- Updated tests to utilize `generic_variable` and `credential_variable` fixtures instead of hardcoded values.
- Enhanced assertions to ensure correct handling of variable types, including encryption for credential variables and decryption for generic variables.
- Improved test structure for creating, reading, updating, and deleting variables, ensuring consistency across test cases.
* refactor: update get_all method signatures in variable services to return VariableRead
- Changed return type of the get_all method in VariableService, KubernetesSecretService, and DatabaseVariableService from list[Variable | None] to list[VariableRead].
- This update enhances type consistency across variable services and aligns with the new VariableRead model for improved data handling.
* fix: update variable type assertion in test_update_variable to CREDENTIAL_TYPE
- Changed the assertion in the `test_update_variable` test to verify that the result type is now `CREDENTIAL_TYPE` instead of `GENERIC_TYPE`.
- This update aligns the test with recent changes in variable type handling, ensuring accurate validation of variable updates.
* fix: update variable type assertion in test_create_variable to CREDENTIAL_TYPE
- Changed the assertion in the `test_create_variable` test to verify that the result type is now `CREDENTIAL_TYPE` instead of `GENERIC_TYPE`.
- This update ensures consistency with recent changes in variable type handling and improves the accuracy of the test validation.
fix: enhance load_from_db field checks in custom component update and parameter loading
- Updated the condition in to ensure that only includes fields with a defined value.
- Modified the function to skip parameters that are either not present or have a falsy value, improving robustness in parameter handling.
* add dataframe operations component
* populate entire new column with value
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
* [autofix.ci] apply automated fixes
* Add unit tests for DataFrame operations in `test_dataframe_operations.py`
* **Import modules**
- Import `pytest` and `pandas` for testing DataFrame operations
* **Define test cases**
- Define test cases for edge cases like empty DataFrames and invalid column names
- Include tests for operations like "Head", "Tail", and "Replace Value"
- Use `pytest.mark.parametrize` to test multiple operations with different inputs
- Add detailed assertions to verify the correctness of DataFrame operations
* [autofix.ci] apply automated fixes
* Remove test cases for DataFrame operations from `test_dataframe_operations.py`. This deletion includes all unit tests related to various DataFrame operations such as adding, dropping, filtering, and renaming columns, as well as handling edge cases like empty DataFrames and invalid operations. The removal streamlines the test suite by eliminating outdated or redundant tests.
* Add unit tests for DataFrame operations in
- Introduced a new test file for organizing test components.
- Updated import paths for to reflect the new module structure.
- Refactored test cases to use for better readability and maintainability.
- Enhanced assertions in tests for various DataFrame operations, including handling of empty DataFrames and invalid operations.
- Improved code formatting for consistency and clarity.
* Refactor DataFrameOperationsComponent for improved readability and maintainability
- Consolidated import statements for clarity.
- Renamed variable `df` to `dataframe_copy` for better understanding.
- Streamlined the `perform_operation` method by replacing `elif` with `if` statements for clearer logic flow.
- Enhanced error message for unsupported operations to improve debugging.
These changes aim to enhance the code structure and make future modifications easier.
* Update unit tests for DataFrame operations in `test_dataframe_operations.py`
- Modified expected values in parameterized tests for various DataFrame operations, including "Add Column", "Filter", "Sort", "Head", "Tail", and "Replace Value" to reflect new test scenarios.
- Adjusted assertions to ensure they correctly validate the output of operations, particularly for lists of expected values.
- Enhanced error handling in the test for invalid operations to provide clearer feedback on unsupported operation types.
These changes improve the accuracy and robustness of the unit tests for DataFrame operations.
* Refactor DataFrameOperationsComponent methods to return DataFrame instances consistently
---------
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* chore: rename the type BaseChatMessageHistory to Memory
* Added Memory type with same color as BaseChatMessageHistory
* [autofix.ci] apply automated fixes
---------
Co-authored-by: Lucas Oliveira <lucas.edu.oli@hotmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>