* added a color change in cursor to help user find the cursor in the canvas page
* [autofix.ci] apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com>
* Add 'tags' column to 'flow' table and update models
- Added migration script to include 'tags' column in 'flow' table.
- Updated `Flow` model to include `tags` field.
- Introduced `Tags` enum in `schema.py` for predefined tag values.
* Update `tags` column to use JSON type in Flow model
* Add conditional checks for 'tags' column in Alembic migration script
* Make 'tags' field nullable in Flow model
* Add default value for 'tags' field in Flow model
* Update default values for 'tags' field in Flow model
* resolveQdrant Vector Store doesnt' use the advanced fields when ingesting documents #3749
* resolveQdrant Vector Store doesnt' use the advanced fields when ingesting documents #3749
* [autofix.ci] apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This pull request fixes the `run_flow_from_json` function by adding `session_id` parameter. This update ensures that session management is properly handled during flow execution.
Changes include:
- Added `session_id` as an optional input parameter.
- Updated function documentation to reflect the inclusion of the new parameter.
- Added unit test for run_flow_from_json input parameters
This fix enhances the function's usability by allowing for better tracking of individual sessions.
* feat(YahooFinanceTool): enhance tool with new inputs for data retrieval methods
* test: fix test
* test: fix test units
* test: fix import
* fix: rename component
* Fix instantiation of YfinanceToolComponent in complex_agent.py
---------
Co-authored-by: italojohnny <italojohnnydosanjos@gmail.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
* feat: Add skipFallback parameter to ForwardedIconComponent
This commit adds a new skipFallback parameter to the ForwardedIconComponent in the genericIconComponent module. The skipFallback parameter allows developers to skip rendering the fallback component when using Suspense. This can be useful in cases where the fallback component is not needed or should be handled differently.
* feat: Add skipFallback parameter to IconComponentProps
* feat: Add skipFallback parameter to IconComponentProps and ForwardedIconComponent
This commit adds the skipFallback parameter to the IconComponentProps and ForwardedIconComponent. This parameter allows skipping the fallback icon rendering when the specified icon is not found. The skipFallback parameter is used in the ParentDisclosureComponent to conditionally render the chevron-down or chevron-right icon based on the component's state.
The commit also updates the defaultOpen value in the ParentDisclosureComponent in the ExtraSidebarComponent. The defaultOpen value is set to true, ensuring that the "Integrations" section is always expanded when the component is rendered.
* refactor: Update ExtraSidebarComponent layout and styling
* [autofix.ci] apply automated fixes
* move file
* move file
* move file
* move file
* move file
* Update NotionLogo size
* Update size of AssemblyAI logo
* Update colors and names for AssemblyAI in styleUtils.ts
* Update BUNDLES_SIDEBAR_FOLDER_NAMES in constants.ts
* [autofix.ci] apply automated fixes
* add changes from pr #3934
* chore: add cache.db to .gitignore
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Fix message list order
The system message should be inserted into the first position of the message list instead of being appended at the last position.
* Set `_has_cycle_edges` to `True` for source and target vertices in cycle edges
* feat: Add `has_cycle_edges` method to Vertex class
The `has_cycle_edges` method is added to the `Vertex` class to check if the vertex has any cycle edges. Additionally, the `instantiate_component` method is updated to use the `initialize.loading.instantiate_class` function for custom component instantiation.
* Add `apply_on_outputs` method to Vertex for applying functions to outputs
* Add utility to find vertices in cycles within a directed graph
- Implement `find_cycle_vertices` function to identify all vertices that are part of cycles in a directed graph.
- Utilize depth-first search (DFS) to detect cycles and collect vertices involved in those cycles.
* Add unit tests for `find_cycle_vertices` utility function in graph module
* Add method to set cache for vertices in cycle
- Introduced `_set_cache_to_vertices_in_cycle` method to enable caching for vertices involved in cycles.
- Added `find_cycle_vertices` import to support the new method.
- Refactored vertex instantiation into `_instantiate_components_in_vertices` method for better code organization.
* refactor: Update caching logic for vertices in cycles
Refactor the `_set_cache_to_vertices_in_cycle` method to improve caching logic for vertices involved in cycles. Instead of setting the `cache` attribute to `True`, it is now set to `False` for better clarity and consistency. This change ensures that the cache is properly handled for vertices in cycles.
* Refactor `find_cycle_vertices` to use NetworkX for cycle detection
* Refactor `find_cycle_vertices` tests to remove entry point parameter and add new test case
- Removed the `entry_point` parameter from all test cases for `find_cycle_vertices`.
- Added a new parameterized test case `test_handle_two_inputs_in_cycle` to verify handling of cycles with two inputs.
* Disable cache in cycle: Update `apply_on_outputs` to handle empty outputs in `base.py`
* Add unit test to ensure output cache is disabled in graph cycles
* Add unit test for graph cyclicity with prompt components and OpenAI integration
- Introduce `test_updated_graph_with_prompts` to validate graph cyclicity and execution.
- Integrate `PromptComponent`, `OpenAIModelComponent`, and `ConditionalRouterComponent` in the test.
- Ensure graph execution with a maximum of 20 iterations and cache disabled.
- Validate the presence of expected output vertices in the results.
* Convert `_instantiate_components_in_vertices` to async and disable cache in cycle vertices
* Add default value handling for cycle edges in vertex component
- Introduced `default_value` to handle cases where edges are cycles and target parameters are present.
- Ensured that `default_value` is returned if defined, preventing errors when the component is not built.
* Switch from os.environ to os.getenv for API key retrieval in test_cycles.py
* Add __repr__ method to Edge class to indicate cycle edges with a symbol
* Refactor test_cycles.py to streamline component initialization and update assertions
- Simplified component initialization using method chaining.
- Corrected router input and message parameters to use openai_component_1.
- Updated assertions to check for correct output IDs.
* Refactor test_cycles.py to streamline component initialization and update assertions
* Refactor test to use custom serialization method instead of pickle
* Add cycle_vertices property to optimize cycle detection in graph
- Introduced `_cycle_vertices` attribute to store vertices involved in cycles.
- Added `cycle_vertices` property to compute and cache cycle vertices.
- Updated edge creation logic to use `cycle_vertices` for cycle detection.
* Enhance error message in `types.py` to include component ID for better debugging
* Refactor test_cycles.py to update graph configuration and assertions
- Changed router operator from "equals" to "contains".
- Consolidated chat output to a single component.
- Updated graph construction to use a single chat output.
- Replaced `_snapshot` with `get_snapshot` for graph state capture.
- Adjusted assertions to reflect the updated graph structure and outputs.
* Add api_key_required marker to test_updated_graph_with_prompts test
* Add validation to require max_iterations for cyclic graphs
* run ruff
- Refactored error message handling in `base.py` for cyclic graphs.
- Optimized cycle vertex extraction in `utils.py` by using set comprehension.
* Comment out tests for loading flow from JSON in test_loading.py
* Refactor test fixture for webhook flow creation in conftest.py
* Update unit tests to reflect new webhook flow structure in vertices endpoints
* Temporarily disable tests for loading Langchain objects with and without cached sessions
* Disable caching in vector store and OpenAI model components
* Add async support and dependencies to pyproject.toml files
- Added `asgi-lifespan>=2.1.0` to dependencies.
- Configured `asyncio_mode` and `asyncio_default_fixture_loop_scope` for pytest.
- Updated `tool.uv` section with `asgi-lifespan` in dev-dependencies.
* Convert test fixtures to async and use AsyncClient for HTTP requests
* Handle 'ImportFrom' nodes in AST validation to support module attribute imports
* Convert test cases to use async HTTP client
- Updated test cases in `test_database.py`, `test_endpoints.py`, `test_user.py`, `test_variable.py`, `test_files.py`, `test_chat_endpoint.py`, `test_misc.py`, `test_messages_endpoints.py`, `test_api_key.py`, `test_webhook.py`, and `test_login.py` to use `httpx.AsyncClient` instead of `fastapi.TestClient`.
- Modified test functions to be asynchronous and use `await` for HTTP requests.
- Adjusted fixtures and helper functions to support asynchronous operations.
- Ensured consistency in endpoint paths and request methods across all test cases.
* Refactor string concatenation to f-string in test_chat_endpoint.py
* [autofix.ci] apply automated fixes
* Refactor import validation to use pattern matching for AST nodes
* Set `startup_timeout` and `shutdown_timeout` to `None` in `LifespanManager` for test files.
* Convert test functions to async in `test_messages_endpoints.py`
* Add `api_key_required` marker to assistant component tests
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* Update scripts
* update the base dep in uv deps
* update nightly scripts
* Add uv creds for publish
* skip tests for now
* fix version
* only build the wheel
* try again
* add uv to python run
* [autofix.ci] apply automated fixes
* use uv cache
* more version fixe
* fixing versions
* fix base version
* Try no frozen?
* skip everything to try docker build
* tag
* frozen
* separate script for updating uv dep
* [autofix.ci] apply automated fixes
* hardcoded versions
* hardcoded versions
* add version to editable package
* build project before docker file runs
* try again
* fix uv patht o build
* don't know why this would mkae a difference
* debug statements
* debug statements
* debug statements
* change path to whl 🤷
* manually move the wheel...
* make dir
* try no sources
* add back tests
* refactor uv to action
* add uv action
* Update nightly build workflow to include uv lock files in version update commit
* Update lint-py workflow to use specific ref for setup-uv action
* Add checkout step to style-check-py GitHub Actions workflow
* Remove redundant GitHub ref syntax in lint-py.yml workflow
* Update lint-py.yml to use specific ref for setup-uv action
* Update action.yml: standardize quotes and remove redundant checkout step
* Add checkout step to GitHub Actions workflows for specific ref handling
- Introduced `actions/checkout@v4` step to multiple workflows to ensure code is checked out at a specific ref.
- Updated `.github/workflows/docker-build.yml`, `.github/workflows/release_nightly.yml`, `.github/workflows/lint-py.yml`, and `.github/workflows/style-check-py.yml` to include the new checkout step.
- Ensured credentials are persisted during the checkout process.
* Add checkout step to Python test workflow with specific ref
---------
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 `required_inputs` field to `Output` model in `base.py`
* Refactor ComponentTool to ComponentToolkit and enhance tool creation logic
- Replaced `ComponentTool` with `ComponentToolkit` to better encapsulate component-related tools.
- Introduced `build_description` and `_build_output_function` helper functions for dynamic tool creation.
- Updated tool initialization to handle multiple outputs and required inputs using `StructuredTool`.
- Improved schema creation for tool arguments based on component inputs.
* Refactor `to_tool` method to `to_toolkit` to use `ComponentToolkit` instead of `ComponentTool`
* Refactor `ComponentTool` to `ComponentToolkit` in unit tests
- Updated import statements to reflect the new `ComponentToolkit` class.
- Modified test logic to use `ComponentToolkit` for retrieving tools.
- Adjusted assertions to match the new structure and output format.
- Ensured compatibility with `Message` schema for output validation.
* Refactor `test_component_to_tool` to validate `ComponentToolkit` and tool properties
* Refactor `build_description` to include input types in the output format
* Add method to set required inputs for outputs based on method analysis
- Introduced `_set_output_required_inputs` method to determine and set required inputs for each output by analyzing the method's source code.
- Added necessary imports (`ast` and `dedent`) to support the new functionality.
* Update test to assert full tool description in test_component_to_tool.py
* Add unit tests for verifying required inputs of various components
- Added tests to ensure that required inputs for outputs are present in the inputs of `ChatInput`, `ChatOutput`, `SequentialTaskComponent`, `ToolCallingAgentComponent`, and `OpenAIModelComponent`.
- Included helper functions to check if required inputs are in inputs and to assert that all outputs have different required inputs.
* Add RequiredInputsVisitor to identify required inputs in AST nodes
- Introduced RequiredInputsVisitor class to traverse AST nodes and collect required inputs.
- The visitor checks for 'self' attributes matching the provided inputs and adds them to the required_inputs set.
* Refactor required inputs extraction using `RequiredInputsVisitor`
* Add feature flags configuration for toolkit output in settings
* Add toolkit output handling based on feature flag in custom component utils
* Add method to append 'component_as_tool' output in custom component
* Add unit test for toolkit output feature flag in custom component
* Add utility functions for lazy loading and instantiating input types in langflow
- Introduced `get_InputTypesMap` for lazy loading of `InputTypesMap`.
- Added `instantiate_input` function to create instances of input types dynamically.
- Included type checking and error handling for invalid input types.
* Refactor input instantiation logic and update imports
- Removed `instantiate_input` function from `inputs.py` and moved it to `utils.py`.
- Updated imports in `base.py` to reflect the new location of `instantiate_input`.
- Added missing import for `Callable` in `base.py`.
* Refactor import statement to use `instantiate_input` from `langflow.inputs.utils` in test_inputs.py
* Add TOOL_OUTPUT_NAME constant to tools module
* Add type checking and TOOL_OUTPUT_NAME filter in ComponentToolkit
- Introduced `TYPE_CHECKING` for type hints to avoid circular imports.
- Added `TOOL_OUTPUT_NAME` constant to filter specific outputs in `ComponentToolkit`.
- Updated type annotations to use forward references.
* Refactor component toolkit import to avoid circular dependency and use constant for tool output name
* Refactor `ComponentToolkit` class to remove inheritance from `BaseToolkit` and add an initializer for `component`
* Add unit test for ComponentToolkit in test_component_to_tool
- Added `test_component_to_tool_has_no_component_as_tool` to verify that `ComponentToolkit` correctly initializes with a `ChatInput` component and returns the expected tools.
* Refactor toolkit output handling to `custom_component` module
* fix: mypy errors union-attr and arg-type
* Add 'OTHER' field type to schema in langflow/io/schema.py
* Add tool name formatting to ComponentToolkit to ensure valid characters
* Refactor toolkit output handling and add type hint for `to_toolkit` method
* Add `is_interface_component` attribute to vertex types and update import order
* Add tests for ToolCallingAgentComponent and ChatOutput with API key handling
- Updated `test_component_tool` to reflect new description format.
- Added `test_component_tool_with_api_key` to test `ToolCallingAgentComponent` with `ChatOutput` and OpenAI API key.
- Enabled `add_toolkit_output` feature flag for testing.
* Refactor `_find_matching_output_method` to accept `input_name` parameter for more precise input-output matching
* Replace ValueError with warning in build_description function
* use chat_output component directly in set
* [autofix.ci] apply automated fixes
* [autofix.ci] apply automated fixes
* [autofix.ci] apply automated fixes (attempt 3/3)
* Refactor: Reorder method calls in `__init__` for logical consistency
Moved `set_class_code` method call to ensure output types and required inputs are set before class code initialization.
* Update _format_tool_name to allow '.' in tool names
* Refactor `_format_tool_name` to remove non-alphanumeric characters
* Update test assertions for component tool name and output mapping
* Handle case where 'required_inputs' is empty in 'component_tool.py'
* Refactor import statements for better readability in `base.py`
* [autofix.ci] apply automated fixes
* Add noqa comment to suppress import warning and re-add Any import in base.py
---------
Co-authored-by: italojohnny <italojohnnydosanjos@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* Add endpoint to update session ID for messages in monitor API
* Add tests for updating session ID in messages endpoint
- Added test to successfully update session ID for all messages with the old session ID.
- Added test to handle case where no messages are found with the given session ID.
---------
Co-authored-by: anovazzi1 <otavio2204@gmail.com>
* 🐛 (model.py): fix issue where message.files was not being updated correctly when image_paths is empty in MessageBase class
* 🐛 (model.py): simplify condition for checking if image_paths is not empty to improve readability and maintainability
* [autofix.ci] apply automated fixes
* 🔧 (OutputParser.py): refactor error message handling for unsupported or missing parser to improve readability and maintainability
* [autofix.ci] apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* add-note
* notes
* vector-store-rag-notes
* vector-store-rag-notes
* comma
* comma
* revert
* add-notes
* another-way
* revert
* revert
* fix
* descriptions
* lightbulb
* deployed-size
* size
* size
* resizing-is-true
* targethandle
* double
* set-components
* pin
* notes
* fix
* dont-change-code
* cleanup
* update example
* fix postion on example
* fix-descriptions
* swap-link
* newline-and-lightbulb
* another-docs-link
* play-button
* remove-double
* update NODE_FORMAT_ATTRIBUTES to prevent description updates on examples
* Update AstraDB documentation link
* update documentation on code
* ✨ (chatInputOutputUser-shard-0.spec.ts): update the test to click on the last element with the text "Playground" to ensure correct element is clicked
* 🐛 (Basic Prompting.spec.ts): fix clicking on "Playground" element by selecting the last occurrence to ensure correct element is clicked
* ✨ (Blog Writer.spec.ts): update test to click on the last element with text "Playground" to ensure correct element is clicked on the page
* ✨ (Dynamic Agent.spec.ts): update test to click on the last element with text "Playground" to ensure correct element is clicked on the page
* 🐛 (decisionFlow.spec.ts): fix clicking on "Playground" button by selecting the last element with the text "Playground" to ensure correct element is clicked
* 🐛 (generalBugs-shard-3.spec.ts): fix clicking on "Playground" button by selecting the last occurrence to prevent ambiguity
* 🐛 (generalBugs-shard-0.spec.ts): fix clicking on "Playground" button by selecting the last element with the text "Playground" to ensure correct element is clicked
* 🐛 (general-bugs-shard-3836.spec.ts): fix clicking on "Playground" button by selecting the last element with the text "Playground" to ensure correct element is clicked
* ✨ (chatInputOutputUser-shard-2.spec.ts): update test to click on the last element with text "Playground" to ensure correct interaction with chat input/output feature
* ✨ (stop-button-playground.spec.ts): update test to click on the last occurrence of the text "Playground" to ensure correct element is clicked
* 🐛 (limit-file-size-upload.spec.ts): fix selector to click on the last element with text "Playground" instead of the first one
* ✨ (fileUploadComponent.spec.ts): update test to click on the last element with text "Playground" to ensure correct element is clicked on the page
* ✨ (chatInputOutput.spec.ts): update test to click on the last occurrence of the "Playground" text to ensure correct element is clicked
* 🐛 (generalBugs-shard-9.spec.ts): fix clicking on "Playground" element by selecting the last occurrence to prevent flakiness in tests
* 🐛 (Document QA.spec.ts): fix clicking on "Playground" element by selecting the last occurrence to ensure correct element is clicked
* ✨ (similarity.spec.ts): update click method to target the last occurrence of "Playground" text to ensure correct element is clicked
* 🐛 (Simple Agent.spec.ts): fix clicking on "Playground" button by selecting the last element with the text to avoid ambiguity
* ✨ (textInputOutput.spec.ts): update test script to target the last occurrence of the "Playground" text element to ensure correct interaction with the UI.
* ✨ (Travel Planning Agent.spec.ts): Update the selector for the "Playground" text to ensure the correct element is clicked on the page.
* 🐛 (Vector Store.spec.ts): fix clicking on "Playground" element by selecting the last one to avoid ambiguity
* ✨ (generalBugs-shard-9.spec.ts): add click action on the last element with test id "title-Prompt" to improve test coverage and interaction with the page
---------
Co-authored-by: anovazzi1 <otavio2204@gmail.com>
Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
* Only show error state on components w/ errors for node validation
* [autofix.ci] apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>