* refactor: update _generate_code_hash function and enhance module name handling
- Removed the class_name parameter from _generate_code_hash for improved clarity and simplicity.
- Added a new function, get_module_name_from_display_name, to generate module names from display names in snake_case.
- Updated build_custom_component_template_from_inputs to use the new module name generation logic when module_name is None.
- Enhanced error handling in code hash generation to log exceptions appropriately.
- Updated unit tests to reflect changes in the _generate_code_hash function and to verify the new module name generation functionality.
* fix: enhance module name handling and error logging in build_custom_component_template
- Added logic to derive module names from display names when not provided, improving metadata accuracy.
- Refined error handling for code hash generation, ensuring exceptions are logged appropriately for better debugging.
* test: add comprehensive unit tests for metadata generation in custom components
- Introduced multiple tests to ensure that the `build_custom_component_template` function consistently generates metadata, including module names and code hashes, across various scenarios.
- Verified that metadata is correctly returned when module names are provided or omitted, and that code hashes change with component code modifications.
- Included tests for handling unicode characters in component code to ensure robustness in metadata generation.
* test: update unit tests to use Component class for metadata generation
- Refactored test cases to replace the CustomComponent with the new Component class, ensuring consistency in testing metadata addition in template builders.
- Adjusted mock component attributes to align with the updated class structure, enhancing clarity and maintainability of the tests.
* test: add unit tests for custom component metadata retrieval and consistency
- Introduced new tests for the /custom_component endpoint to verify that it returns accurate metadata, including module names and code hashes.
- Ensured that identical component code produces consistent metadata across multiple requests, enhancing the reliability of the custom component functionality.
* refactor: improve error logging in code hash generation
- Updated error logging in `build_custom_component_template_from_inputs` and `build_custom_component_template` to use debug level with exception context, enhancing clarity for debugging while reducing log noise.
- This change aims to provide more detailed insights during error occurrences without cluttering the error logs.
* Fallback to env var correctly when using tweaks
* Add unit test
* [autofix.ci] apply automated fixes
* refactor: improve docstrings for parameter update tests
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
* refactor: Standardize import statements and improve code readability across components
- Updated import statements to use consistent single quotes.
- Refactored various components to enhance readability and maintainability.
- Adjusted folder and file handling logic in the sidebar and file manager components.
- Introduced a new tabbed interface for the files page to separate files and knowledge bases, improving user experience.
* [autofix.ci] apply automated fixes
* feat: Introduce new Files and Knowledge Bases page with tabbed interface
- Added a new FilesPage component to manage file uploads and organization.
- Implemented a tabbed interface to separate Files and Knowledge Bases for improved user experience.
- Created FilesTab and KnowledgeBasesTab components for handling respective functionalities.
- Refactored routing to accommodate the new structure and updated import statements for consistency.
- Removed the old filesPage component to streamline the codebase.
* Create knowledgebase_utils.py
* Push initial ingest component
* [autofix.ci] apply automated fixes
* Create initial KB Ingestion component
* [autofix.ci] apply automated fixes
* Fix ruff check on utility functions
* [autofix.ci] apply automated fixes
* Some quick fixes
* Update kb_ingest.py
* [autofix.ci] apply automated fixes
* First version of retrieval component
* [autofix.ci] apply automated fixes
* Update icon
* Update kb_retrieval.py
* [autofix.ci] apply automated fixes
* Add knowledge bases feature with API integration and UI components
* [autofix.ci] apply automated fixes
* [autofix.ci] apply automated fixes (attempt 2/3)
* Refactor imports and update routing paths for assets and main page components. Adjust tab handling in the assets page to reflect URL changes and improve user navigation experience.
* [autofix.ci] apply automated fixes
* Add CreateKnowledgeBaseButton, KnowledgeBaseEmptyState, and KnowledgeBaseSelectionOverlay components. Refactor KnowledgeBasesTab to utilize new components and improve UI for knowledge base management. Introduce utility functions for formatting numbers and average chunk sizes.
* [autofix.ci] apply automated fixes
* PoV: Add Parquet data retrieval to KBRetrievalComponent (#9097)
* Add Parquet data retrieval to KBRetrievalComponent
Introduces a new output to KBRetrievalComponent for returning knowledge base data by reading Parquet files. Updates dependencies to include fastparquet for Parquet support.
* [autofix.ci] apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* Fix some ruff issues
* [autofix.ci] apply automated fixes
* feat: refactor file management and knowledge base components
- Replaced the existing assetsPage with a new filesPage to better organize file management functionalities.
- Introduced KnowledgePage to handle knowledge base operations, integrating KnowledgeBasesTab for displaying and managing knowledge bases.
- Added various components for file and knowledge base management, including CreateKnowledgeBaseButton, KnowledgeBaseEmptyState, and drag-and-drop functionality.
- Updated routing and imports to reflect the new structure and ensure consistency across the application.
- Enhanced user experience with improved UI elements and state management for file selection and operations.
* feat: implement delete confirmation modal for knowledge base deletion
- Added a DeleteConfirmationModal component to confirm deletion actions.
- Integrated the modal into the KnowledgeBasesTab for handling knowledge base deletions.
- Updated column definitions to include a delete button for each knowledge base.
- Enhanced user experience by ensuring deletion actions require confirmation.
- Adjusted styles for the knowledge base table to improve checkbox visibility.
* feat: enhance knowledge base metadata with embedding model detection
- Added `embedding_model` field to `KnowledgeBaseInfo` for improved metadata tracking.
- Implemented `detect_embedding_model` function to extract embedding model information from configuration files.
- Updated `get_kb_metadata` to prioritize metadata extraction from `embedding_metadata.json`, falling back to detection if necessary.
- Modified `KBIngestionComponent` to save embedding model metadata during ingestion.
- Adjusted frontend components to display embedding model information in knowledge base queries and tables.
* refactor: clean up tooltip and value getter comments in knowledge base columns
- Removed redundant comments in the `knowledgeBaseColumns.tsx` file to enhance code clarity.
- Simplified the tooltip and value getter functions for embedding model display.
* [autofix.ci] apply automated fixes
* refactor: simplify KnowledgeBaseSelectionOverlay component
- Removed the unused onExport prop and its associated functionality.
- Cleaned up code formatting for consistency and readability.
- Updated success message strings to use single quotes for uniformity.
* feat: implement bulk and single deletion for knowledge bases
- Added `BulkDeleteRequest` model to handle bulk deletion requests.
- Implemented `delete_knowledge_base` endpoint for single knowledge base deletion.
- Created `delete_knowledge_bases_bulk` endpoint for deleting multiple knowledge bases at once.
- Introduced `useDeleteKnowledgeBase` and `useDeleteKnowledgeBases` hooks for frontend integration.
- Updated `KnowledgeBaseSelectionOverlay` and `KnowledgeBasesTab` components to utilize new deletion functionality with user feedback on success and error handling.
* Initial support for vector search
* feat: add KnowledgeBaseDrawer component for enhanced knowledge base details
- Introduced `KnowledgeBaseDrawer` component to display detailed information about selected knowledge bases.
- Integrated mock data for source files and linked flows, with a layout for displaying descriptions and embedding models.
- Updated `KnowledgeBasesTab` to handle row clicks and open the drawer with relevant knowledge base data.
- Enhanced `KnowledgePage` to manage drawer state and selected knowledge base, improving user interaction and experience.
* [autofix.ci] apply automated fixes
* [autofix.ci] apply automated fixes (attempt 2/3)
* Fix ruff checks
* Update knowledge_bases.py
* feat: update mock data and enhance drawer functionality in KnowledgeBase components
- Replaced mock data in `KnowledgeBaseDrawer` with more descriptive placeholders.
- Added a reference to the drawer in `KnowledgePage` for improved click handling.
- Implemented logic to close the drawer when clicking outside, except for table row clicks.
- Enhanced row click handling to toggle drawer state based on current visibility.
* [autofix.ci] apply automated fixes
* Append scores column to rows
* refactor: improve knowledge base deletion and UI components
- Updated `useDeleteKnowledgeBase` and `useDeleteKnowledgeBases` to enhance parameter naming for clarity.
- Removed the `CreateKnowledgeBaseButton` component and its references to streamline the UI.
- Simplified the `KnowledgeBaseDrawer` and `KnowledgeBasesTab` components by removing mock data and improving state management.
- Enhanced the `KnowledgeBaseSelectionOverlay` to better handle bulk deletions and selection states.
- Refactored various components for consistent styling and improved readability.
* refactor: standardize import statements and improve code readability in SideBarFoldersButtonsComponent
- Updated import statements to use consistent single quotes.
- Refactored various function calls and state management for improved clarity.
- Enhanced folder handling logic and UI interactions for better user experience.
* feat: Add encryption for API keys in KB ingest and retrieval (#9129)
Add encryption for API keys in KB ingest and retrieval
Introduces secure storage of embedding model API keys by encrypting them during knowledge base ingestion and decrypting them during retrieval. Refactors metadata handling to include encrypted API keys, updates retrieval to support decryption and dynamic embedder construction, and improves logging for key operations. Removes legacy embedding client code in retrieval in favor of a provider-based approach.
* [autofix.ci] apply automated fixes
* Fix import of auth utils
* Allow appending to existing knowledge base
* [autofix.ci] apply automated fixes
* Update kb_ingest.py
* Update kb_ingest.py
* feat: enhance table component with editable Vectorize column functionality
- Implemented logic to determine editability of the Vectorize column based on other row values.
- Added checks to refresh grid cells upon changes to the Vectorize column.
- Updated TableAutoCellRender to conditionally disable editing based on Vectorize column state.
* New ingestion creation dialog
* [autofix.ci] apply automated fixes
* Clean up the creation process for KB
* [autofix.ci] apply automated fixes
* Clean up names and descriptions
* Update kb_retrieval.py
* chroma retrieval
* [autofix.ci] apply automated fixes
* Further KB cleanup
* refactor: update KB ingestion component and enhance NodeDialog functionality
- Restored SecretStrInput for API key in KB ingestion component.
- Modified NodeDialog to handle new value format and added support for additional properties.
- Introduced custom hooks for managing global variable states in InputGlobalComponent.
- Improved dropdown component styling and interaction.
- Cleaned up input component code for better readability and maintainability.
* Hash the text as id
* [autofix.ci] apply automated fixes
* Update kb_retrieval.py
* [autofix.ci] apply automated fixes
* Make sure to write out the source parquet
* Remove unneeded old code
* Add ability to block duplicate ingestion chunks
* [autofix.ci] apply automated fixes
* [autofix.ci] apply automated fixes (attempt 2/3)
* Rename retrieval component
* Better refresh mechanism for the retrieve
* Clean up some unused functionality
* Update kb_ingest.py
* Fix dropdown component logic to include checks for refresh button and dialog inputs
* Test the API key before saving knowledge
* [autofix.ci] apply automated fixes
* Allow storing updated api keys if provided at ingest time
* Add Knowledge Bases component and enhance Knowledge Base Empty State
- Introduced a new JSON configuration for Knowledge Bases, defining nodes and edges for data processing.
- Enhanced the KnowledgeBaseEmptyState component to include a button for creating a knowledge base template.
- Updated KnowledgeBasesTab to handle template creation, integrating flow management and navigation features.
* [autofix.ci] apply automated fixes
* [autofix.ci] apply automated fixes (attempt 2/3)
* Update Knowledge Bases.json
* Update Knowledge Bases configuration and enhance UI components
- Updated the code hash in the Knowledge Bases JSON configuration.
- Modified the KnowledgeBaseEmptyState component to change the button icon and text from "Try Knowledge Base Template" to "Create Knowledge".
- Cleared the options for the knowledge base selection dropdowns to ensure they reflect the current state of available knowledge bases.
* [autofix.ci] apply automated fixes
* Implement feature flag for Knowledge Bases functionality
- Added FEATURE_FLAGS.knowledge_bases to control the visibility of knowledge base components in the API and UI.
- Updated the router to conditionally include the knowledge bases router based on the feature flag.
- Modified KBIngestionComponent and KBRetrievalComponent to hide if the knowledge bases feature is disabled.
- Enhanced the initial setup to skip loading knowledge base starter projects when the feature is disabled.
- Updated frontend routes and sidebar components to conditionally render knowledge base options based on the feature flag.
- Adjusted API queries to return an empty array if the knowledge bases feature is disabled.
* [autofix.ci] apply automated fixes
* [autofix.ci] apply automated fixes (attempt 2/3)
* Refactor Knowledge Bases feature flag implementation
- Removed the FEATURE_FLAGS.knowledge_bases flag from backend components and frontend routes.
- Updated the API and UI to always include knowledge base components, simplifying the codebase.
- Adjusted the frontend feature flags to set ENABLE_KNOWLEDGE_BASES to false, ensuring knowledge base features are not displayed.
- Cleaned up related components and routes to reflect the removal of the feature flag, enhancing maintainability.
* revert
* [autofix.ci] apply automated fixes
* Remove Knowledge Bases JSON configuration and clean up KnowledgeBasesTab component by eliminating unused imports and template creation functionality.
* [autofix.ci] apply automated fixes
* Enhance routing structure by adding admin and login routes with protected access. Refactor flow routes for improved organization and clarity.
* added template back
* Use chroma for stats computation
* Fix ruff issue
* [autofix.ci] apply automated fixes
* Update Knowledge Bases.json
* Update Knowledge Bases.json
* Rename to just knowledge
* feat: enhance Jest configuration and add new tests for Knowledge Base components
- Updated jest.config.js to include a new setup file and refined test matching patterns.
- Introduced jest.setup.js for mocking globals and Vite-specific syntax.
- Added tests for KnowledgeBaseDrawer, KnowledgeBaseEmptyState, KnowledgeBaseSelectionOverlay, KnowledgeBasesTab, and KnowledgePage components.
- Created utility functions for testing and mock data for knowledge bases.
- Implemented tests for utility functions related to knowledge base formatting.
* [autofix.ci] apply automated fixes
* refactor: reorganize imports and clean up console log in Dropdown component
- Moved and re-imported necessary dependencies for better structure.
- Removed unnecessary console log statement to clean up the code.
* [autofix.ci] apply automated fixes
* [autofix.ci] apply automated fixes (attempt 2/3)
* feat: add success callback for knowledge base creation in NodeDialog component
- Introduced a new success callback to handle knowledge base creation notifications.
- Enhanced dialog closing logic with a delay for Astra database tracking.
- Reorganized imports for better structure.
* refactor: update table component to handle single-toggle columns
- Renamed functions and variables to improve clarity regarding single-toggle columns (Vectorize and Identifier).
- Updated logic to ensure proper editability checks for single-toggle columns.
- Adjusted related components to reflect changes in column handling and rendering.
* [autofix.ci] apply automated fixes
* feat: Add unit tests for KBIngestionComponent (#9246)
* [autofix.ci] apply automated fixes
* fix: remove unnecessary drawer open state change in KnowledgePage
* [autofix.ci] apply automated fixes
* [autofix.ci] apply automated fixes (attempt 2/3)
* Remove kb_info output from KBIngestionComponent (#9275)
* [autofix.ci] apply automated fixes
* Update Knowledge Bases.json
* Use settings service for knowledge base directory
Replaces the hardcoded knowledge base directory path with a value from the settings service. This improves configurability and centralizes directory management.
* Fix knowledge bases mypy issue
* test: Update file page tests for consistency and clarity
- Changed expected title text from "My Files" to "Files" for accuracy.
- Removed unnecessary parentheses in arrow functions for cleaner syntax.
- Updated test assertions to ensure visibility checks are clear and consistent.
- Improved readability by standardizing the formatting of test cases.
* test: Update expected title in file upload component test for accuracy
- Changed expected title text from "My Files" to "Files" to reflect the correct page title.
* [autofix.ci] apply automated fixes
* Fix tests on backend
* Update kb_ingest.py
* [autofix.ci] apply automated fixes
* Switch to two templates for KB
* Update names and descs
* [autofix.ci] apply automated fixes
* Rename templates
* [autofix.ci] apply automated fixes
---------
Co-authored-by: Deon Sanchez <69873175+deon-sanchez@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>
* Improve session fixture cleanup and engine handling
Refactors the session fixture to use an in-memory SQLite engine with proper disposal and ensures tables are dropped and the engine is disposed of after tests. This enhances resource management and test isolation.
* Update src/backend/tests/conftest.py
---------
Co-authored-by: Ítalo Johnny <italojohnnydosanjos@gmail.com>
* update MCP Tests
* [autofix.ci] apply automated fixes
* Update util.py
* [autofix.ci] apply automated fixes
* Refactor MCP session manager for better configurability and cleanup (#9176)
* Add log rotation and header validation features
Introduces support for log rotation via the LANGFLOW_LOG_ROTATION environment variable and CLI/config options, with documentation updates. Adds header validation and sanitization for MCP connections, ensuring RFC 7230 compliance and security. Frontend and backend now support passing custom headers for MCP servers. Includes extensive new and updated unit tests for header handling, MCP utilities, and log rotation.
* Add unit tests for MCP utilities and update disconnect logic
Added comprehensive unit tests for MCP utility functions, session management, header validation, and client classes in test_mcp_util.py. Updated MCPStdioClient and MCPSseClient disconnect methods for clearer session cleanup logic. Refactored test_mcp_component.py to remove redundant and duplicated tests, consolidating coverage in the new test suite.
* [autofix.ci] apply automated fixes
* Update test_mcp_memory_leak.py
* Update util.py
* Improve session and process cleanup in MCP
Added explicit session closing and a short delay to allow subprocess transports to clean up, reducing warnings and potential memory leaks. Test code now waits longer after cleanup and increases process termination timeout to ensure all child processes are properly terminated.
* Improve session and process cleanup logic
Enhanced MCPSessionManager to handle both async and sync session closing methods, using inspection to determine awaitability. Updated memory leak test to more robustly wait for and clean up child processes, logging process states and handling termination more gracefully.
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
* update MCP Tests
* [autofix.ci] apply automated fixes
* Update util.py
* [autofix.ci] apply automated fixes
* Refactor MCP session manager for better configurability and cleanup (#9176)
* Add log rotation and header validation features
Introduces support for log rotation via the LANGFLOW_LOG_ROTATION environment variable and CLI/config options, with documentation updates. Adds header validation and sanitization for MCP connections, ensuring RFC 7230 compliance and security. Frontend and backend now support passing custom headers for MCP servers. Includes extensive new and updated unit tests for header handling, MCP utilities, and log rotation.
* Add unit tests for MCP utilities and update disconnect logic
Added comprehensive unit tests for MCP utility functions, session management, header validation, and client classes in test_mcp_util.py. Updated MCPStdioClient and MCPSseClient disconnect methods for clearer session cleanup logic. Refactored test_mcp_component.py to remove redundant and duplicated tests, consolidating coverage in the new test suite.
* [autofix.ci] apply automated fixes
* Update test_mcp_memory_leak.py
* Update util.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: add import utilities for LangFlow components
- Introduced a new module `_importing.py` containing the `import_mod` function.
- This function dynamically imports attributes from specified modules, enhancing modularity and flexibility in component initialization.
- Comprehensive docstring added for clarity on usage and parameters.
* feat: implement dynamic imports for LangFlow components
- Added dynamic import functionality to various LangFlow components, allowing for lazy loading of attributes on access.
- Introduced mapping in each component's to manage imports efficiently.
- Enhanced error handling for import failures, providing clearer messages for missing attributes.
- Updated method to reflect available attributes for better introspection and tab-completion support.
- Comprehensive docstrings added to improve documentation and usability.
* test: add comprehensive tests for dynamic imports and component accessibility
- Introduced integration tests for dynamic import functionality, ensuring components are discoverable and instantiable post-refactor.
- Added unit tests for the `_import_utils` module, validating the `import_mod` function's behavior and error handling.
- Implemented tests to confirm all component modules are importable and maintain backward compatibility with existing import patterns.
- Enhanced performance tests to measure lazy loading efficiency and memory usage during component access.
- Ensured that all components have the required attributes for dynamic loading and that circular imports are prevented.
* chore: update ruff pre-commit hook to version 0.12.2 in configuration file
* refactor: update warning handling for dynamic imports
- Moved the warning suppression for LangChainDeprecationWarning into the dynamic import context to ensure it only applies during the import process.
- This change enhances clarity and maintains the original functionality while improving the robustness of the import mechanism.
* test: enhance dynamic import integration tests for component attributes
- Removed unnecessary import of AgentComponent and added assertions to verify essential attributes of OpenAIModelComponent, including display_name, description, icon, and inputs.
- Ensured that each input field has the required attributes for better validation of component integrity during dynamic imports.
* refactor: update import paths for Message class in conversation utilities
- Changed the import of the Message class from langflow.field_typing to langflow.schema.message across multiple utility files, ensuring consistency and alignment with the updated module structure.
- This refactor enhances code clarity and maintains compatibility with the latest schema definitions.
* refactor: remove Vectara components from LangFlow
- Deleted the Vectara components module from the codebase, streamlining the component structure.
- This change helps to reduce complexity and maintain focus on core functionalities.
* refactor: remove Vectara references from LangFlow component imports
- Eliminated Vectara from both the import statements and dynamic imports mapping, streamlining the component structure.
- This change contributes to reducing complexity and maintaining focus on core functionalities within the LangFlow framework.
* [autofix.ci] apply automated fixes
* fix: remove 'vectara' from __all__ in components module
* refactor: improve error handling tests for dynamic imports
* test: add tests for ModuleNotFoundError handling with None and special module names
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
* 🐛 (chroma.py, local_db.py): Handle ImportError when importing filter_complex_metadata function to avoid crashing the application
💡 (chroma.py, local_db.py): Add try-except block to gracefully handle ImportError and log a warning message if the function cannot be imported
* ♻️ (local_db.py): remove unnecessary try-except block and simplify document adding process in LocalDBComponent
* 🔧 (chroma.py): Remove unused import 'filter_complex_metadata' and add support for filtering complex metadata to prevent ChromaDB errors
🔧 (test_chroma_vector_store_component.py): Add test cases for filtering complex metadata, preserving simple metadata types, handling single file upload scenario, fallback behavior when import fails, and handling empty and None metadata values.
* [autofix.ci] apply automated fixes
* 🐛 (test_chroma_vector_store_component.py): fix failing test due to None value being filtered out by ChromaDB metadata handling
* 🔧 (test_chroma_vector_store_component.py): refactor test method names and data to improve clarity and consistency in metadata filtering and preservation logic
* 🐛 (test_chroma_vector_store_component.py): fix missing variable assignment for error message in mocked import error to improve error handling and debugging in tests
* [autofix.ci] apply automated fixes
* 🔧 (test_chroma_vector_store_component.py): delete the file test_chroma_vector_store_component.py as it is no longer needed in the project
* [autofix.ci] apply automated fixes
* ✨ (test_chroma_vector_store_component.py): add unit tests for ChromaVectorStoreComponent including create_db, create_collection_with_data, similarity_search, mmr_search, search_with_different_types, search_with_score, duplicate_handling, chroma_collection_to_data, metadata_filtering_with_complex_data, metadata_filtering_fallback
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
* refactor: Simplify flow execution validation by removing unnecessary asyncio.wait_for calls
Updated the validate_flow_execution function to directly use the client.post and client.get methods with a timeout parameter, improving code readability and maintainability. This change eliminates redundant timeout handling while ensuring consistent timeout values across API calls.
* refactor: Enhance template tests for improved structure and validation
Refactored the template tests in `test_starter_projects.py` to utilize parameterization for better readability and maintainability. Introduced helper functions to retrieve template files and disabled tracing for all tests. Updated individual test methods to validate JSON structure, flow execution, and endpoint validation, ensuring comprehensive coverage of template functionality. This change streamlines the testing process and enhances the robustness of the test suite.
* refactor: Update project metadata and import paths in starter project JSON files
Modified the metadata section in multiple starter project JSON files to reflect updated code hashes and module paths, transitioning from 'lfx' to 'langflow' components. This change enhances consistency across the codebase and ensures that the correct modules are referenced for improved maintainability and clarity.
* chore: Update template test commands to utilize parallel execution
Modified the commands in the Makefile and CI workflows to include the `-n auto` option for pytest, enabling parallel test execution for the starter project template tests. This change enhances test performance and efficiency across the codebase.
* chore: Remove news-aggregated.json file
Deleted the news-aggregated.json file
* Update test_template_validation.py
* [autofix.ci] apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* ♻️ (components.py): refactor get_and_cache_all_types_dict function to filter out base components path and only load custom components for traditional full loading. This improves code readability and maintainability.
* ✨ (test_component_loading_fix.py): Add tests for the component loading fix that filters out BASE_COMPONENTS_PATH from custom components.
* [autofix.ci] apply automated fixes
* 🐛 (test_component_loading_fix.py): remove unnecessary test case for GitHub issue #8967 and fix test_component_merging_logic method to handle custom component loading failure properly
♻️ (test_component_loading_fix.py): refactor test_component_loading_fix.py to improve readability and remove redundant try-except block in test_component_merging_logic
* [autofix.ci] apply automated fixes
* ♻️ (components.py): refactor _process_single_module function to simplify create_component_template call and improve code readability
♻️ (components.py): refactor _determine_loading_strategy function to handle component loading strategy based on lazy_load_components setting and improve code structure
* 📝 (components.py): add comments and improve readability in _process_single_module function
✨ (components.py): introduce _determine_loading_strategy function to determine and execute the appropriate component loading strategy based on settings service
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
* add template tests
* remove files
* adding validate flow build
* add validate endpoint and flow execution
* Update .github/workflows/template-tests.yml
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* Update src/backend/base/langflow/utils/template_validation.py
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* [autofix.ci] apply automated fixes
* change workflow running
* add ci
* fix test
* fix test
* delete when push
* fix: Exclude template tests from unit test bundle
Template tests are already run separately in CI via the test-templates job.
This change prevents duplicate execution and eliminates timeout failures
in the unit test suite by excluding slow template execution tests.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: Exclude template tests from unit test bundle
Template tests are already run separately in CI via the test-templates job.
This change prevents duplicate execution and eliminates timeout failures
in the unit test suite by excluding slow template execution tests.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: Exclude template tests from unit test bundle
Template tests are already run separately in CI via the test-templates job.
This change prevents duplicate execution and eliminates timeout failures
in the unit test suite by excluding slow template execution tests.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: Remove remaining merge conflict markers
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: Improve validate.py unit tests to eliminate CI failures
Fixed 4 failing tests in test_validate.py:
- test_code_with_syntax_error: Better error message handling for syntax errors
- test_raises_error_for_missing_function: Handle StopIteration along with ValueError
- test_creates_simple_class: Use optional constructor parameter to avoid TypeError
- test_handles_validation_error: Use proper ValidationError constructor from pydantic_core
- test_creates_context_with_langflow_imports: Remove invalid module patching
- test_creates_mock_classes_on_import_failure: Use proper import mocking
All 50 validate tests now pass consistently, improving CI stability.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* enhance: Add comprehensive edge case tests for template_validation.py
Added 6 additional test cases to improve coverage of template_validation.py:
- test_validate_stream_exception: Tests Graph.validate_stream() exception handling
- test_code_validation_other_exceptions: Tests TypeError/KeyError/AttributeError handling
- test_vertices_sorted_without_end_vertex_events: Tests variable usage tracking
- test_vertex_count_tracking: Tests vertex_count increment paths
- test_empty_lines_in_stream: Tests empty line handling in event streams
- test_event_stream_validation_exception: Tests exception handling in _validate_event_stream
These tests target the remaining 7 uncovered lines to maximize coverage percentage.
Total tests: 40 (all passing)
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
---------
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: Claude <noreply@anthropic.com>
* feat: Add smoke tests workflow for PR validation
- Adds smoke-test label trigger for running tests without API keys
- Runs backend tests excluding api_key_required markers
- Runs full frontend test suite with mocked APIs
- Provides fast feedback (~10-15 min) before lgtm label
- Enables external contributors to validate changes without API costs
- Comments results back to PR automatically
Usage: Add 'smoke-test' label to any PR to trigger
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: Fix YAML indentation in smoke-tests workflow script block
* refactor: Focus smoke tests on critical functionality only
- Run only 10 essential backend test files (version, schema, serialization, etc.)
- Run only frontend unit tests (skip integration/e2e)
- Reduce timeout from 15 to 8 minutes
- Target critical functionality without external dependencies
- Avoid problematic database/API-dependent tests
* fix: Use correct Jest CLI option --testPathPatterns
* add frontend tests
* add tests
* change to essential tests
* fix: Create superuser in test_load_bundles_from_urls test
The test_load_bundles_from_urls test was failing because the load_bundles_from_urls
function expects a superuser to exist in the database, but the test client fixture
sets LANGFLOW_AUTO_LOGIN=false by default, which doesn't create a superuser.
This fix creates a superuser in the test database before calling the function,
resolving the 'Superuser not found in the database' error.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* add on conditions
* fix: Check PR labels correctly for smoke test trigger
Change condition from github.event.label.name to
github.event.pull_request.labels.*.name to work with all trigger
events (synchronize, opened, etc), not just labeled events.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* add workdispatch
* remove initial test
* adding timeout minutes
* edit env var
---------
Co-authored-by: Claude <noreply@anthropic.com>
* Store mcp server headers
* Add headers on pre check url and is valid url
* adds validation of headers according to RFC 7230
* Fixed sanitized value
* Added backend tests for mcp util.py to increase coverage
* [autofix.ci] apply automated fixes
* [autofix.ci] apply automated fixes (attempt 2/3)
* make key pair input use flatmap id on data test ids
* added testids
* added random test names and added tests for persistence
* fix ruff lint
* [autofix.ci] apply automated fixes
* Fix mypy lint errors
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* Changed Youtube to YouTube
* Updated AIML to AI/ML API
* Updated AI/ML Model name
* Changed Anthropic description
* updated arXiv name
* Set Astra Vectorize as legacy
* Updated get env var
* Updates firecrawl names
* Updated Icon for Google Gen AI embeddings
* Add Space on Home Assistant
* Updated Hugging Face name
* Updated Maritalk Name
* Updated Not Diamond name
* Updated ScrapeGraph names
* Changed SearchApi Name
* Changed TwelveLabs naming
* Updated AstraDB naming
* Updated VertexAI naming
* Updated Wolfram
* Updated Yahoo naming
* Updated Yahoo Finance name
* Updated Yahoo Finance
* [autofix.ci] apply automated fixes
* Update google serper bundle
* updated ai ml icon name
* Updated maritalk
* Changed ai ml api name
* removed openai from base url
* Revert components-bundles changes
* revert changes on components-vector-stores
* Revert changes on deployment-hugging-face-spaces
* Revert changes on integrations-nvidia-ingest
* Revert changes on release-notes
* Update changes on sequential agent
* [autofix.ci] apply automated fixes
* fixed filterSidebar test
* updated filter edge test
* updated shard 11 test with new sidebar names
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* init auth forms
* Add iam endpoint
* Add radix radio
* Add radio group UI element
* Add IAM endpoint to types
* Add auth modal
* Remove auth from tools component
* Add auth modal to mcp server tab
* Add placeholders to fields
* Add dynamic headers
* changed authentication name
* CHanged paddings
* Added header and button under feature flag
* [autofix.ci] apply automated fixes
* update api key form field
* add credential handling and fix feature flag
* Update autologin condition
* design update
* style updates
* ci details
* revert ci logs
* test update, ff name update, and username + pass -> basic
* restore ci
* default fix
* added iam endpoint
* add oauth
* remove secretstr
* updated backend test and schema
* updated test
* updated test user can update
* test fix
---------
Co-authored-by: Mike Fortman <michael.fortman@datastax.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* ✨ (flows.py): Improve flow naming logic to handle duplicate names more effectively and accurately
📝 (test_rename_flow_to_save.py): Add unit tests to ensure correct numbering and handling of duplicate flow names
* [autofix.ci] apply automated fixes
* ✨ (test_rename_flow_to_save.py): refactor test functions to remove unnecessary session parameter and improve code readability
* 📝 (flows.py): improve regex pattern to extract numbers only from flows following a specific naming convention to avoid extracting numbers from the original flow name if it contains parentheses
* [autofix.ci] apply automated fixes
* 📝 (flows.py): improve comments for better readability and understanding of regex usage in extracting numbers from flow names
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* feat: Add dual output support to Agent component with structured JSON parsing
## Summary
- Add "Structured Response" output alongside existing "Response" output
- Filter out conflicting json_mode field from OpenAI inputs
- Implement robust JSON parsing with fallback handling
## Changes Made
### Agent Component (agent.py)
- Add second output: "Structured Response" (Data type) with tool_mode=False
- Filter json_mode from OpenAI inputs to prevent UI conflicts
- Add json_response() method with multi-stage JSON parsing:
- Direct JSON parsing for valid responses
- Regex extraction for embedded JSON in text
- Graceful error handling with diagnostic info
- Share execution between outputs (no duplicate agent runs)
- Fix model building to handle missing json_mode attribute
### Tests (test_agent_component.py)
- Add 9 comprehensive test cases covering:
- Dual output structure validation
- Input filtering verification
- JSON parsing (valid, embedded, error cases)
- Model building without json_mode
- Shared execution efficiency
- Frontend node structure
- Component initialization
## Benefits
- Users get both Message and Data output types to choose from
- Clean UI without confusing duplicate JSON toggles
- Robust JSON parsing handles various response formats
- Efficient single-execution approach
- Maintains backward compatibility
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* [autofix.ci] apply automated fixes
* update to templates with model list update
* [autofix.ci] apply automated fixes
* Update test_agent_component.py
* update to the test and update to templates
* [autofix.ci] apply automated fixes
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
* feat: filter out base components path in custom component loading
* revert changes to allow testing the function
* feat: add module_name parameter to custom component template functions
* feat: include full module name in component template creation
* feat: add module metadata to various starter project JSON files
* feat: add code hash generation for custom component templates
* test: add unit tests for code hash and module metadata functionality
* feat: add code hash to metadata in various starter project JSON files
* feat: refactor code hash generation to accept source code and class name
* feat: implement loading strategy for custom components in settings service
* Update metadata for various starter project JSON files to include code hashes and module references for ChatInput and ChatOutput components. This enhances traceability and consistency across the project configurations.
* refactor: improve _generate_code_hash function for better error handling and clarity
- Simplified the logic to generate a SHA256 hash of the source code.
- Added explicit error handling for empty source code, encoding issues, and type errors.
- Updated docstring to reflect changes in argument descriptions and added information about raised exceptions.
* test: add unit tests for metadata functionality in custom utils
- Introduced tests for the _generate_code_hash function, covering basic hash generation, error handling for empty and None source, hash consistency, and uniqueness for different code.
- Added tests to verify metadata addition in template building functions, ensuring that module names and code hashes are correctly included in the metadata of custom components.
---------
Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
* test: enhance agent component tests and add new fixture for database-less sessions
- Added `use_noop_session` fixture to facilitate testing without a database.
- Expanded `TestAgentComponent` with new tests for agent responses using the Calculator tool and validation across all OpenAI and Anthropic models.
- Updated `test_component.py` to include tests for message sending without a database, ensuring proper event handling and message integrity.
- Refactored existing tests for clarity and consistency.
* fix: enhance user retrieval logic in get_or_create_super_user and teardown_superuser functions
- Updated user retrieval in both functions to handle different result types from the database query, ensuring robustness against unexpected return values.
- Added checks for `first()` method and list type to improve error handling and maintainability.
* feat: add support for no-op database operations in settings
- Introduced `use_noop_database` configuration option to disable all database operations, controlled by the `LANGFLOW_USE_NOOP_DATABASE` environment variable.
- Updated the `use_noop_session` fixture to reflect the new environment variable for testing without a database.
* feat: implement NoopSession for database-less operations
- Added NoopSession class to provide a no-operation database session, allowing for testing and operation without a real database connection.
- Updated DatabaseService to utilize NoopSession when the `use_noop_database` setting is enabled, ensuring all database operations are disabled in this mode.
- Enhanced error handling and logging for session management, improving robustness in scenarios where the database is not in use.
* refactor: update import paths for NoopSession in test files
- Changed import path for NoopSession from `langflow.services.database.service` to `langflow.services.database.session` in both `test_agent_component.py` and `test_component.py`.
- This refactor improves code organization and aligns with recent changes in the project structure.
* feat: enhance NoopSession with result handling methods
- Added an internal _NoopResult class to the NoopSession, providing methods `first()`, `all()`, and `one_or_none()` for better handling of no-operation results.
- This enhancement improves the usability of NoopSession in testing scenarios by mimicking expected database query behaviors.
* refactor: improve logging for NOOP database session
- Changed the log level from warning to info for the NOOP database session message in the DatabaseService class.
- This adjustment enhances clarity in logging, indicating that all DB operations are disabled without implying an error condition.
* docs: improve docstring formatting for custom_component_update function
- Reformatted the docstring for the custom_component_update function to enhance readability by breaking long lines into multiple lines.
- This change improves documentation clarity, making it easier for developers to understand the function's purpose and behavior.
* docs: add LANGFLOW_USE_NOOP_DATABASE environment variable documentation
- Introduced documentation for the new LANGFLOW_USE_NOOP_DATABASE environment variable, which allows users to enable a no-op database mode, avoiding database connections and operations.
- This addition enhances the clarity of configuration options available for Langflow, aiding users in understanding how to run flows without a database.
* refactor: move NOOP database session logging to settings
- Removed the logging statement from the DatabaseService class and added it to the `set_use_noop_database` field validator in the Settings class.
- This change centralizes the logging for the NOOP database session, improving code organization and ensuring that the message is logged whenever the setting is applied.
* feat: add DataFrame output to Structured Output component
- Add new DataFrame output alongside existing Data output for structured data
- Single output: creates DataFrame with one row
- Multiple outputs: creates DataFrame with multiple rows, each containing a Data object
- Maintains backward compatibility with existing Data output
- Includes comprehensive test coverage for both single and multiple output scenarios
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* [autofix.ci] apply automated fixes
* [autofix.ci] apply automated fixes (attempt 2/3)
* [autofix.ci] apply automated fixes
* Update structured_output.py
* [autofix.ci] apply automated fixes
* udpate to tests
* [autofix.ci] apply automated fixes
* [autofix.ci] apply automated fixes (attempt 2/3)
* update to format instructions
* Update system prompt in structured output component test
Expanded the system prompt in the test for StructuredOutputComponent to provide more detailed extraction instructions, including handling of missing values, duplicates, and output format requirements. This improves test clarity and better simulates real-world extraction scenarios.
* [autofix.ci] apply automated fixes
* Update structured_output.py
* fix: return empty Data object instead of None in StructuredOutputComponent
Updated the return statement in the StructuredOutputComponent to return an empty Data object when there are no outputs, improving consistency in the output handling.
* [autofix.ci] apply automated fixes
---------
Co-authored-by: Claude <noreply@anthropic.com>
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: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
* feat: enhance DataFrame Operations component with contains filter and modern UI
- Add "contains" filter operator for partial string matching in DataFrame filters
- Update UI to use SortableListInput with icons for consistent modern design
- Add 7 filter operators: equals, not equals, contains, starts with, ends with, greater than, less than
- Fix deselection handling to prevent "unhashable type: list" errors
- Improve dynamic field visibility when operations are deselected
- Add comprehensive test suite with 25 tests covering all operations and edge cases
- Update placeholder text from "Select DataFrame Operation" to "Select Operation"
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* [autofix.ci] apply automated fixes
* Update dataframe_operations.py
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
* refactor: Simplify flow reading logic by removing unnecessary settings service dependency
* 🛠️ (flows.py): Remove settings_service parameter from _read_flow and related functions to streamline flow retrieval logic.
* 🔧 (flows.py): Adjust query to directly filter by user_id, enhancing clarity and reducing complexity.
* test: Enhance flow retrieval tests with user isolation checks
* 🧪 (test_flows.py): Remove hardcoded user_id from flow creation tests to ensure user-specific data handling.
* ✨ (test_flows.py): Add a new test to verify that users can only access their own flows, ensuring proper user isolation in flow retrieval.
* 🔧 (test_flows.py): Implement user creation and cleanup logic to maintain test integrity and avoid side effects.
* fix: update message input handling in LCAgentComponent and improve memory data retrieval
* Refactor MessageTextInput to MessageInput for consistency.
* Enhance input dictionary construction to handle different input types in LCAgentComponent.
* Update get_memory_data method to filter out current input value from retrieved messages.
* fix: update AgentComponent to include documentation link and improve input handling
* Added documentation link for AgentComponent.
* Removed memory inputs from the agent component for cleaner input management.
* Enhanced error handling in message_response method to ensure better validation and logging of exceptions.
* fix: enhance input handling in LCAgentComponent by updating message conversion
* Updated input dictionary construction in LCAgentComponent to use to_lc_message() for Message instances, improving input handling consistency.
* test: add regression test for message duplication in agent component
* Introduced a new test to verify that mathematical expressions do not experience message duplication when processed by the agent component.
* The test checks both input and output JSON to ensure correct handling of expressions like "2+2" without duplication errors.
* test: add workspace tag to regression test for message duplication in agent component
* Updated the regression test for mathematical expressions to include the "@workspace" tag, enhancing test categorization and organization.
* This change ensures better tracking and management of tests related to the agent component.
* fix: add temporary comment in get_memory_data to address message duplication
* Added a TODO comment in the get_memory_data method of AgentComponent to indicate a temporary fix for message duplication issues. This serves as a reminder to develop a more robust solution in the future.
* feat: add message extraction utility for BaseMessage
* Introduced a new helper function, _get_message_from_base_message, to extract and concatenate text content from BaseMessage instances, improving message handling.
* Updated input handling in handle_on_chain_start to utilize the new extraction function, ensuring consistent processing of input messages.
* refactor: standardize code snippets across starter project JSON files
* Updated the "value" field in multiple starter project JSON files to ensure consistent formatting and structure of code snippets.
* This change enhances readability and maintainability of the code examples provided in the starter projects.
* feat: add caching and content dictionary creation for images
* Introduced a new function, create_image_content_dict, to generate a content dictionary for multimodal inputs from image files, enhancing image handling capabilities.
* Implemented LRU caching to optimize performance for repeated image processing.
* Added comprehensive error handling and documentation for better usability and maintainability.
* refactor: update message handling to utilize create_image_content_dict
* Replaced direct image URL creation with create_image_content_dict for improved image content handling in the Data and Message classes.
* Adjusted the order of content in human messages to ensure text appears first, enhancing message structure and clarity.
* Removed deprecated to_lc_message method to streamline the codebase and improve maintainability.
* docs: enhance _get_message_from_base_message docstring for clarity
* Expanded the docstring for the _get_message_from_base_message function to provide detailed information on input types, expected behavior, and examples of usage.
* Improved documentation aims to enhance usability and maintainability of the code by clarifying how to extract text content from BaseMessage instances.
* refactor: enhance image path handling and update message content structure
* Modified the get_file_paths function to support both Image objects and string paths for improved flexibility in file handling.
* Updated test cases to reflect changes in image content structure, ensuring consistency in type and source type attributes.
* Introduced new tests for create_image_content_dict to validate successful creation and error handling for image content dictionaries.
* refactor: streamline message extraction in handle_on_chain_start
* Removed the _get_message_from_base_message function to simplify the codebase.
* Updated handle_on_chain_start to directly use the text method of BaseMessage for extracting message content, enhancing clarity and maintainability.
* feat: enhance input handling for multimodal messages
* Added functionality to process image content within input messages, ensuring images are included in chat history as HumanMessage instances.
* Updated input handling logic to separate image types from text, improving the structure and clarity of message content.
* This enhancement supports better management of multimodal inputs in the agent's chat history.
* feat: add to_lc_message method for converting Data to BaseMessage
* Introduced the to_lc_message method in the Message class to facilitate conversion of Data instances to BaseMessage.
* Implemented logic to handle both HumanMessage and AIMessage based on the presence of required keys and sender type.
* Added logging for missing required keys to improve debugging and maintainability.
* refactor: simplify sender check in Message class
* Updated the sender validation logic in the Message class to remove unnecessary checks for missing sender values.
* This change enhances code clarity and maintains the intended functionality for handling user messages with associated files.
* test: update test_message_from_human_text to reflect content type change
* Modified the test for message conversion to assert that lc_message.content is a string instead of a list.
* Updated assertions to ensure the content matches the expected text, enhancing test accuracy and reliability.
* fix: update sender validation in Message class and adjust test case
* Modified the sender validation logic to handle cases where the sender is not specified, defaulting to HumanMessage.
* Updated the corresponding test case to reflect this change, ensuring accurate type assertion for lc_message when no sender is provided.
* refactor: update import statements for consistency and clarity
* Replaced the import of BaseModel from langchain.pydantic_v1 with the direct import from pydantic to streamline dependencies.
* This change enhances code clarity and aligns with best practices for managing imports in the codebase.
---------
Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
Co-authored-by: Carlos Coelho <80289056+carlosrcoelho@users.noreply.github.com>
* chore: update pyleak dependency to version 0.1.14 in pyproject.toml and uv.lock
* fix(tests): enable pyleak marker in test files to address memory leak issues
* Fix langwatch component initialization and some QoL
* [autofix.ci] apply automated fixes
* Fix ruff and add unit tests
* [autofix.ci] apply automated fixes
* feat(langwatch): add utility for caching evaluators and refactor component to use it
* test(langwatch): add initial test file for LangWatchComponent and mock evaluator method
* fix(langwatch): use getattr for safer access to current_evaluator attribute
* test(langwatch): update cache clearing method to use utility function
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
* update
* [autofix.ci] apply automated fixes
* refactor: update file query logic and enhance error logging in file deletion
* refactor: enhance error handling and improve code clarity in MCP server list retrieval
* refactor: improve type hinting and code clarity in MCP servers file tests
* fix: handle potential None value for server configuration file in async server list retrieval
* Update test_files.py
* fix: autofix.ci / Update Starter Projects (pull_request)
* chore: Add API key environment variables to CI workflows
* Updated .github/workflows/ci.yml and .github/workflows/python_test.yml to include OPENAI_API_KEY, ANTHROPIC_API_KEY, and other relevant API keys as environment variables for CI jobs.
---------
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: Lucas Oliveira <62335616+lucaseduoli@users.noreply.github.com>
Co-authored-by: Carlos Coelho <80289056+carlosrcoelho@users.noreply.github.com>
Co-authored-by: italojohnny <italojohnnydosanjos@gmail.com>
* fix: improve predecessors check for loop component
- Enhanced the handling of cycle vertices to prevent infinite loops by ensuring that a vertex can only run if all pending predecessors have completed.
- Updated conditions for the first execution of cycle vertices to allow running only if all pending predecessors are also cycle vertices.
- This refactor improves the robustness of the vertex management system in asynchronous workflows.
* fix: update _mark_branch method to return visited vertices and refine predecessor mapping
* fix: prevent duplicate item dependencies in LoopComponent
* feat: add loop connection handling in Component class
- Introduced methods to process loop feedback connections, allowing components to connect outputs to loop-enabled inputs.
- Implemented checks to validate loop connections and ensure proper handling of callable methods from other components.
- Enhanced the edge creation logic to support special loop feedback edges targeting outputs instead of inputs.
* fix: enhance name overlap validation in FrontendNode
- Updated the validate_name_overlap method to exclude outputs that allow loops from the overlap check.
- Improved error message to include the display name of the component, along with detailed lists of input and output names for better debugging.
* fix: correct condition for executing cycle vertices in RunnableVerticesManager
- Updated the logic to ensure that a cycle vertex can only execute if it is a loop and all pending predecessors are cycle vertices. This change enhances the robustness of the vertex management system in asynchronous workflows.
* feat: implement comprehensive loop flow for URL processing
- Added a new loop flow that processes multiple URLs through a series of components including URLComponent, SplitTextComponent, LoopComponent, ParserComponent, PromptComponent, OpenAIModelComponent, StructuredOutputComponent, and ChatOutput.
- Enhanced the StructuredOutputComponent to include a detailed system prompt and refined output schema to ensure proper JSON formatting.
- Introduced a test case to validate the creation and execution of the loop flow, ensuring all components are correctly integrated and the expected execution order is maintained.
* refactor: enhance loop target handling in Component and Edge classes
- Introduced LoopTargetHandleDict to better manage loop target structures in the Component and Edge classes.
- Updated the Component class to utilize type casting for loop target handles, improving type safety.
- Refactored the Edge class to accommodate the new loop target handling, ensuring compatibility with existing edge structures.
- Removed deprecated message handling methods from the Component class to streamline the codebase and improve maintainability.
* test: skip OpenAI model integration test if API key is not set
- Added a conditional skip to the test_build_model_integration_reasoning method to prevent execution when the OPENAI_API_KEY environment variable is not set, ensuring tests run only in appropriate environments.
* [autofix.ci] apply automated fixes
* chore: add required secrets for OpenAI and Anthropic APIs in CI workflows
* Updated ci.yml to include OPENAI_API_KEY and ANTHROPIC_API_KEY secrets.
* Modified python_test.yml to mark these secrets as required for workflow execution.
* fix: update OPENAI_API_KEY check in test_loop.py to handle dummy values
* Modified the condition in the pytest skipif decorator to also skip tests when OPENAI_API_KEY is set to "dummy", ensuring more robust test execution.
* refactor: streamline component setup in test_loop.py
* Removed redundant comments and improved formatting for component initialization in the loop_flow function.
* Added missing system_prompt to StructuredOutputComponent to resolve "Multiple structured outputs" error.
* Updated test_loop_flow to ensure it tests the graph creation with proper loop feedback connection.
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* Update styleUtils.ts
* update to prompt component
* update to template
* update to mcp component
* update to smart function
* [autofix.ci] apply automated fixes
* update to templates
* fix sidebar
* change name
* update import
* update import
* update import
* [autofix.ci] apply automated fixes
* fix import
* fix ollama
* fix ruff
* refactor(agent): standardize memory handling and update chat history logic (#8715)
* update chat history
* update to agents
* Update Simple Agent.json
* update to templates
* ruff errors
* Update agent.py
* Update test_agent_component.py
* [autofix.ci] apply automated fixes
* update templates
* test fix
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Mike Fortman <michael.fortman@datastax.com>
* fix prompt change
* feat(message): support sequencing of multiple streamable models (#8434)
* feat: update OpenAI model parameters handling for reasoning models
* feat: extend input_value type in LCModelComponent to support AsyncIterator and Iterator
* refactor: remove assert_streaming_sequence method and related checks from Graph class
* feat: add consume_iterator method to Message class for handling iterators
* test: add unit tests for OpenAIModelComponent functionality and integration
* feat: update OpenAIModelComponent to include temperature and seed parameters in build_model method
* feat: rename consume_iterator method to consume_iterator_in_text and update its implementation for handling text
* feat: add is_connected_to_chat_output method to Component class for improved message handling
* feat: refactor LCModelComponent methods to support asynchronous message handling and improve chat output integration
* refactor: remove consume_iterator_in_text method from Message class and clean up LCModelComponent input handling
* fix: update import paths for input components in multiple starter project JSON files
* fix: enhance error message formatting in ErrorMessage class to handle additional exception attributes
* refactor: remove validate_stream calls from generate_flow_events and Graph class to streamline flow processing
* fix: handle asyncio.CancelledError in aadd_messagetables to ensure proper session rollback and retry logic
* refactor: streamline message handling in LCModelComponent by replacing async invocation with synchronous calls and updating message text handling
* refactor: enhance message handling in LCModelComponent by introducing lf_message for improved return value management and updating properties for consistency
* feat: add _build_source method to Component class for enhanced source handling and flexibility in source object management
* feat: enhance LCModelComponent by adding _handle_stream method for improved streaming response handling and refactoring chat output integration
* feat: update MemoryComponent to enhance message retrieval and storage functionality, including new sender type handling and output options for text and dataframe formats
* test: refactor LanguageModelComponent tests to use ComponentTestBaseWithoutClient and add tests for Google model creation and error handling
* test: add fixtures for API keys and implement live API tests for OpenAI, Anthropic, and Google models
* fix: reorder JSON properties for consistency in starter projects
* Updated JSON files for various starter projects to ensure consistent ordering of properties, specifically moving "type" to follow "selected_output" for better readability and maintainability.
* Affected files: Basic Prompt Chaining.json, Blog Writer.json, Financial Report Parser.json, Hybrid Search RAG.json, SEO Keyword Generator.json.
* refactor: simplify input_value type in LCModelComponent
* Updated the input_value parameter in LCModelComponent to remove AsyncIterator and Iterator types, streamlining the input options to only str and Message for improved clarity and maintainability.
* This change enhances the documentation and understanding of the expected input types for the component.
* fix: clarify comment for handling source in Component class
* refactor: remove unnecessary mocking in OpenAI model integration tests
* auto update
* update
* [autofix.ci] apply automated fixes
* fix openai import
* revert template changes
* test fixes
* update templates
* [autofix.ci] apply automated fixes
* fix tests
* fix order
* fix prompts import
* fix frontend tests
* fix frontend
* [autofix.ci] apply automated fixes
* add charmander
* [autofix.ci] apply automated fixes
* fix prompt frontend
* fix frontend
* test fix
* [autofix.ci] apply automated fixes
* change pokedex
* remove pokedex extra
* update template
* name fix
* update template
* mcp test fix
---------
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: Yuqi Tang <yuqi.tang@datastax.com>
Co-authored-by: Mike Fortman <michael.fortman@datastax.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
* Refactor test_components_path to run server in thread
The test now starts the CLI server in a separate thread on a free port, allowing asynchronous startup and avoiding port conflicts. This change improves test reliability and better simulates real server behavior.
* Update src/backend/tests/unit/test_cli.py
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* Improve error handling in run_flow CLI test helper
The run_flow function now raises a RuntimeError with a detailed message if the CLI invocation fails, making test failures easier to diagnose.
---------
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
* CodeRabbit Generated Unit Tests: Update unit tests in test_projects.py
* [autofix.ci] apply automated fixes
* 📝 CodeRabbit Chat: Add unit tests for projects API in test_projects.py
* [autofix.ci] apply automated fixes
* refactor(tests): streamline project tests and enhance Cyrillic character handling
- Removed redundant test cases for unauthorized project creation and duplicate project names.
- Consolidated Cyrillic character tests for clarity and improved documentation.
- Added constants for Cyrillic project name and description to enhance readability.
---------
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: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
* feat: update OpenAI model parameters handling for reasoning models
* feat: extend input_value type in LCModelComponent to support AsyncIterator and Iterator
* refactor: remove assert_streaming_sequence method and related checks from Graph class
* feat: add consume_iterator method to Message class for handling iterators
* test: add unit tests for OpenAIModelComponent functionality and integration
* feat: update OpenAIModelComponent to include temperature and seed parameters in build_model method
* feat: rename consume_iterator method to consume_iterator_in_text and update its implementation for handling text
* feat: add is_connected_to_chat_output method to Component class for improved message handling
* feat: refactor LCModelComponent methods to support asynchronous message handling and improve chat output integration
* refactor: remove consume_iterator_in_text method from Message class and clean up LCModelComponent input handling
* fix: update import paths for input components in multiple starter project JSON files
* fix: enhance error message formatting in ErrorMessage class to handle additional exception attributes
* refactor: remove validate_stream calls from generate_flow_events and Graph class to streamline flow processing
* fix: handle asyncio.CancelledError in aadd_messagetables to ensure proper session rollback and retry logic
* refactor: streamline message handling in LCModelComponent by replacing async invocation with synchronous calls and updating message text handling
* refactor: enhance message handling in LCModelComponent by introducing lf_message for improved return value management and updating properties for consistency
* feat: add _build_source method to Component class for enhanced source handling and flexibility in source object management
* feat: enhance LCModelComponent by adding _handle_stream method for improved streaming response handling and refactoring chat output integration
* feat: update MemoryComponent to enhance message retrieval and storage functionality, including new sender type handling and output options for text and dataframe formats
* test: refactor LanguageModelComponent tests to use ComponentTestBaseWithoutClient and add tests for Google model creation and error handling
* test: add fixtures for API keys and implement live API tests for OpenAI, Anthropic, and Google models
* fix: reorder JSON properties for consistency in starter projects
* Updated JSON files for various starter projects to ensure consistent ordering of properties, specifically moving "type" to follow "selected_output" for better readability and maintainability.
* Affected files: Basic Prompt Chaining.json, Blog Writer.json, Financial Report Parser.json, Hybrid Search RAG.json, SEO Keyword Generator.json.
* refactor: simplify input_value type in LCModelComponent
* Updated the input_value parameter in LCModelComponent to remove AsyncIterator and Iterator types, streamlining the input options to only str and Message for improved clarity and maintainability.
* This change enhances the documentation and understanding of the expected input types for the component.
* fix: clarify comment for handling source in Component class
* refactor: remove unnecessary mocking in OpenAI model integration tests