* refactor: Simplify KnowledgeBaseEmptyState component and integrate handleCreateKnowledge function into KnowledgeBasesTab
- Refactored KnowledgeBaseEmptyState to accept handleCreateKnowledge as a prop, removing internal logic for flow creation.
- Updated KnowledgeBasesTab to implement handleCreateKnowledge, enhancing the flow creation process and improving component interaction.
* [autofix.ci] apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* feat(agent): enhance structured output handling with new input fields and validation
- Added and inputs to the AgentComponent for improved structured output formatting.
- Introduced method to streamline agent setup and memory data retrieval.
- Enhanced method to support structured output validation against a defined schema.
- Implemented error handling for JSON parsing and validation, ensuring robust output processing.
This update improves the flexibility and reliability of the agent's structured response capabilities.
* feat(agent): enhance structured output handling with new input fields and validation
- Added `format_instructions` and `output_schema` inputs to the AgentComponent for improved structured output formatting.
- Introduced `get_agent_requirements` method to streamline agent setup and memory data retrieval.
- Enhanced `json_response` method to support structured output validation against a defined schema.
- Implemented error handling for JSON parsing and validation, ensuring robust output processing.
This update improves the flexibility and reliability of the agent's structured response capabilities.
* feat(agent): add new input fields for enhanced agent configuration
- Introduced , , and inputs to the AgentComponent for improved agent configuration and interaction.
- Updated the handling of combined instructions to ensure clarity in agent behavior and output formatting.
- Enhanced JSON schema extraction process with clearer instructions for better structured output.
This update enhances the flexibility and usability of the agent component, allowing for more tailored interactions.
* feat(agent): add new input fields for enhanced agent configuration
- Introduced `agent_llm`, `system_prompt`, and `n_messages` inputs to the AgentComponent for improved agent configuration and interaction.
- Updated the handling of combined instructions to ensure clarity in agent behavior and output formatting.
- Enhanced JSON schema extraction process with clearer instructions for better structured output.
This update enhances the flexibility and usability of the agent component, allowing for more tailored interactions.
* template udpate
* test update
* refactor(tests): streamline mocking of get_agent_requirements in test_agent_component
- Consolidated the mocking of the `get_agent_requirements` method in multiple test cases for improved readability and consistency.
- Simplified the instantiation of `MockResult` objects to enhance clarity in test setup.
This refactor enhances the maintainability of the test code by reducing redundancy.
* [autofix.ci] apply automated fixes
* add new logging
* [autofix.ci] apply automated fixes
* update templates
* Update test_agent_component.py
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Carlos Coelho <80289056+carlosrcoelho@users.noreply.github.com>
* Refactor vectorstore components structure
Moved vectorstore components for Chroma, ClickHouse, Couchbase, DataStax, Elastic, Milvus, MongoDB, Pinecone, Qdrant, Supabase, Upstash, Vectara, and Weaviate into dedicated subfolders with __init__.py files for each. Updated Redis vectorstore implementation to reside in redis.py and removed the old vectorstores/redis.py. Adjusted starter project JSONs and frontend constants to reflect new module paths and sidebar entries for these vectorstores.
* Refactor vectorstore components and add lazy imports
Moved Datastax-related files from vectorstores to a dedicated datastax directory. Added lazy import logic to __init__.py files for chroma, clickhouse, couchbase, elastic, milvus, mongodb, pinecone, qdrant, supabase, upstash, vectara, and weaviate components. Cleaned up vectorstores/__init__.py to only include local and faiss components, improving modularity and import efficiency.
* [autofix.ci] apply automated fixes
* Refactor vectorstore components structure
Moved FAISS, Cassandra, and pgvector components to dedicated subdirectories with lazy-loading __init__.py files. Updated imports and references throughout the backend and frontend to reflect new locations. Removed obsolete datastax Cassandra component. Added new sidebar bundle entries for FAISS, Cassandra, and pgvector in frontend constants and style utilities.
* Add lazy imports and Redis chat memory component
Refactored the Redis module to support lazy imports for RedisIndexChatMemory and RedisVectorStoreComponent, improving import efficiency. Added a new redis_chat.py file implementing RedisIndexChatMemory for chat message storage and retrieval using Redis.
* Fix vector store astra imports
* Revert package lock changes
* More test fixes
* Update test_vector_store_rag.py
* Update test_dynamic_imports.py
* Update vector_store_rag.py
* Update test_dynamic_imports.py
* Refactor the cassandra chat component
* Fix frontend tests for bundle
* Mark Local DB as legacy
* Update inputComponent.spec.ts
* [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: Carlos Coelho <80289056+carlosrcoelho@users.noreply.github.com>
* fix: update import for get_and_cache_all_types_dict and adjust test to use it
* fix: update tests to log component counts without failing for CI compatibility
* [autofix.ci] apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* Added API key generation message, removed API key field from backend
* Added api key generation to mcp server tab
* Generate API key if project is configured to have API key auth
* removed isautologin logic
* Updated logic on frontend for when feature flag is disbalewd
* Added should generate api key on backend
* [autofix.ci] apply automated fixes
* [autofix.ci] apply automated fixes (attempt 2/3)
* Changed line clamp of success message
* Added reinstall notice to auth modal
* Changed mcp auth on mcp_projects, allow reinstall on clients
* Allow reinstall of clients
* [autofix.ci] apply automated fixes
* Changed copies
* Removed unused logger
* [autofix.ci] apply automated fixes
* Added type annotation
* Added removed servers type annotation
* Passed unauthorized to test
* Fixed mcp projects to use already existing auth when not api key and not auth_settings
* Updated tests to use user_test_project
* Updated typing
* updated token
* Removed part that unauthenticated if no token is available
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Arvydas Jonusonis <arvydas@jonusonis.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: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
* refactor: Enhance logging configuration with structured logging and buffer support
* feat: Add structlog dependency for enhanced logging support
* refactor: Update ruff dependency to version 0.12.7 and remove unused pylint references
* Refactor logging imports to use langflow.logging.logger
- Replaced instances of loguru logger with langflow.logging.logger across multiple files.
- Updated logging calls to use asynchronous methods where applicable (e.g., await logger.awarning).
- Ensured consistent logging practices throughout the codebase by standardizing the logger import.
* refactor: Add missing docstring rule to ruff configuration
* [autofix.ci] apply automated fixes
* [autofix.ci] apply automated fixes (attempt 2/3)
* [autofix.ci] apply automated fixes
* fix: update logger calls to use async methods in DatabaseService
* fix: update logger calls to use async methods in initialize_database and session_getter
* fix: update logger calls to use async methods in LangflowRunnerExperimental
* fix: update logger calls to use async methods across various services
* Refactor logging to use asynchronous logger methods across multiple components
- Updated logging calls in to use async logger methods for error handling and debugging.
- Modified to utilize async logging for error messages during file deletion.
- Changed logging in , , and other agent-related files to use async methods for error and debug messages.
- Refactored logging in various components including , , , and others to ensure consistent use of async logging.
- Updated , , and to replace synchronous logging with asynchronous counterparts.
- Ensured all logging changes maintain the original message structure while enhancing performance with async capabilities.
* [autofix.ci] apply automated fixes
* fix: update logger calls to use async methods in various components
* feat: add InterceptHandler to route standard logging messages to structlog
* refactor: remove async_file parameter from logger configuration
* fix: correct log level mapping and enhance log rotation validation
* refactor: remove unused logging import and streamline schema imports
* Refactor logging in AssemblyAI components and other modules to use exc_info for better error tracing
- Updated logging statements in AssemblyAI components (e.g., assemblyai_get_subtitles, assemblyai_lemur, assemblyai_list_transcripts, etc.) to use logger.debug with exc_info=True for improved error context.
- Modified logging in various helper and utility functions to enhance error reporting.
- Ensured consistent logging practices across the codebase for better maintainability and debugging.
* refactor: remove InterceptHandler from logger configuration to avoid recursion
* refactor: enhance test coverage for logger module with comprehensive test cases
* refactor: add rule to ignore mutable objects without __hash__ method in linter
* fix various lint issues
* refactor: update function signatures to improve clarity and consistency
* refactor: streamline import statements and enhance response handling in voice mode
* refactor: simplify lifespan cleanup logic
* refactor: remove unused caplog fixture and improve graph test clarity
* fix: specify logger type as BoundLogger for clarity
* [autofix.ci] apply automated fixes
* refactor: remove unused logger and correct return statement in arun_flow_from_json
* refactor: update logger usage to support async methods in tests
* fix: correct datetime bounds for hypothesis strategies to avoid timezone issues
* fix: update warning message for invalid string input type in tests
* refactor: simplify message handling tests by removing database session mocks
* refactor: remove redundant comment from test_max_size function in test_logger.py
* fix: update patch target for DEV setting in remove_exception_in_production test
* fix: update patch target for DEV setting in remove_exception_in_production test
* fix: update patching of DEV setting in remove_exception_in_production tests to use module import
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* Added Traceloop SDK for colecting traces and metrics from Langflow
* [autofix.ci] apply automated fixes
* added test case for traceloop
* Revert "[autofix.ci] apply automated fixes"
This reverts commit 3a68113f0de65b2397ac88d1fc2cae8f786adbd7.
* Updated logic for verifying returned callbacks list length
* [autofix.ci] apply automated fixes
* api key strip validation and updated logger warning
* Add graceful fallback for Traceloop LangChain callback handler
* Removed TraceloopLangChainCallbackHandler
* default URL moved to configuration constant
* add Timeout Protection to add trace method
* add resource cleanup method for traceloop
* fix(tracing): unify span lifecycle and fix async mismatch in TraceloopTracer
- Remove incorrect asyncio.wait_for usage on synchronous method
- Store active spans in _span_map to properly end them in end_trace
- Prevent duplicate unrelated spans for same component
- Use trace.get_tracer_provider().force_flush() for correct flushing
- Add explicit close() method for manual flush at shutdown
- Enforce HTTPS in TRACELOOP_BASE_URL validation
- Improve reliability of cleanup in __del__
* stable uv.lock from upstream/main
* Fix: ensure type-safe metadata handling
* Block PYMYSQL intrumentor and relaxed https constraint
* fix(tracing): handle invalid input/output type conversion for traceloop attributes
* fix: Reduced cognitive complexity of get_trace_as_metadata method
* fix: organize child spans under single root span and added type conversion methods
* fix: Linting and formatting
* uv.lock reset to upstream main
* [autofix.ci] apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Sandesh R <sandesh@ibm.com>
* refactor: Update KnowledgeBaseEmptyState component text and structure
- Changed header text from "No knowledge bases" to "Welcome to Knowledge Base!" for improved user engagement.
- Updated description to clarify the action of creating a knowledge base.
- Renamed button text from "Create Knowledge" to "New Knowledge Base" for consistency and clarity.
- Reorganized imports for better readability.
* [autofix.ci] apply automated fixes
* grammar
* fix: Reintroduce useParams import and enhance KnowledgeBaseEmptyState description
- Added missing import for useParams from react-router-dom.
- Updated description text to specify "reusable knowledge bases" for clarity.
* [autofix.ci] apply automated fixes
* fix: Update KnowledgeBaseEmptyState button text for clarity
- Changed button text from "New Knowledge Base" to "New Knowledge Base template" to provide clearer context for users.
* feat: Add Array.prototype.toSorted polyfill and update tests for BundleItem and SidebarBundles components
- Implemented a polyfill for Array.prototype.toSorted to ensure compatibility in Jest environment.
- Updated tests for BundleItem to reflect that the component should render even when dataFilter has no items.
- Adjusted SidebarBundles tests to confirm correct rendering behavior with empty dataFilter and provided dataFilter scenarios.
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* 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>
* feat: Add telemetry for unhandled exceptions
Add comprehensive exception telemetry to capture and send unhandled
exceptions to Scarf analytics for better error tracking and debugging.
Features:
- ExceptionPayload schema with type, message, context, and stack hash
- TelemetryService.log_exception() method for exception logging
- Integration in FastAPI exception handlers and lifespan events
- Stack trace hashing for grouping similar exceptions
- Respects existing do_not_track privacy settings
Context tracking:
- "handler" - exceptions in HTTP request processing
- "lifespan" - exceptions during app startup/shutdown
Sends data to: https://langflow.gateway.scarf.sh/exception
Includes comprehensive unit and integration tests covering all
functionality and edge cases.
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* fix: Improve exception telemetry implementation
- Replace MD5 with SHA256 for better security practices
- Use contextlib.suppress instead of try-except-pass patterns
- Fix telemetry_service scope issue in lifespan function
- Improve test exception handling to follow best practices
- All linting checks now pass with proper code style
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
* refactor the exception logging
* [autofix.ci] apply automated fixes
* update comment
* use mock url
* fix: remove telemetry logging for lifespan cancellation during shutdown
---------
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>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
* refactor and test coverage
* code issue cleanup
* test and coverage fixes
* fix test + pr comments
* cleanup
* test debugging
* cleanup
* try again
* No logs
* fix test
* 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.
* fix anchors
* type convert and structured output components
* vector store intro and flow example
* reorg some vector search components by provider
* still on vector stores
* vector store example and outputs
* finish vector store page
* corrections to astra db vector store
* start split text component
* save file and smart function
* llm router
* parser
* still on dataframe
* finish datafram ops
* remove-extra-kv-pair-and-clarify-serialization-from-python
---------
Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com>
* 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>
* bug: re-add NVIDIA Remix starter template (#8994)
feat: add NVIDIA Remix starter template
Introduced a new JSON configuration file for the NVIDIA Remix starter project, defining nodes and edges for chat input, output, and agent interactions. This setup enhances the integration of the NVIDIA RTX Remix Toolkit REST API, providing a structured approach for building chat-based applications.
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
* chore(release): bump to 1.5.0.post2
* bug: re-add NVIDIA Remix starter template (#8994)
feat: add NVIDIA Remix starter template
Introduced a new JSON configuration file for the NVIDIA Remix starter project, defining nodes and edges for chat input, output, and agent interactions. This setup enhances the integration of the NVIDIA RTX Remix Toolkit REST API, providing a structured approach for building chat-based applications.
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
* Bump langflow-base version to 0.5.0.post2
Updated the langflow-base package version in pyproject.toml and uv.lock to 0.5.0.post2 for release or deployment purposes.
---------
Co-authored-by: Sebastián Estévez <estevezsebastian@gmail.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
* Set 'Include Metadata' as non-advanced option
Changed the 'Include Metadata' parameter in KBRetrievalComponent from advanced to non-advanced, making it more visible in the UI.
* [autofix.ci] apply automated fixes
* Update Knowledge Retrieval.json
* [autofix.ci] apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* clarify-file-upload-with-api-snippet
* style
* Apply suggestions from code review
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>
---------
Co-authored-by: April I. Murphy <36110273+aimurphy@users.noreply.github.com>