* simple ai agent
new component:
simple ai agent
py tests for tool calling agent as well as for simple ai agent
* Update simple_agent.py
update _config Changes and code oprimised
* Update simple_agent.py
Error or inputType as None Solved
* [autofix.ci] apply automated fixes
* fix: INP001 ruff error
* Update test_tool_calling_agent.py
added pytest mark as api required
* Update simple_agent.py
added system prompt
* [autofix.ci] apply automated fixes
* updates in the input field orders
* [autofix.ci] apply automated fixes
* Update simple_agent.py
chat memory added
* [autofix.ci] apply automated fixes
* lint Errors Solved
* Squashed commit of the following:
commit e965fd3b7f
Author: Sebastián Estévez <estevezsebastian@gmail.com>
Date: Thu Oct 31 17:16:08 2024 -0400
fix: broken docker test (#4337)
* Fix broken docker test
Fixes#4336
Update the Docker test workflow to use the `get_version` function from `langflow.utils.version`.
* Modify the `Test image` step in `.github/workflows/docker_test.yml` to use the `get_version` function instead of directly importing `__version__`.
* Modify the `Test backend image` step in `.github/workflows/docker_test.yml` to use the `get_version` function instead of directly importing `__version__`.
---
For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/langflow-ai/langflow/issues/4336?shareId=XXXX-XXXX-XXXX-XXXX).
* version.version not util.version
commit 3279b8a1e8
Author: Lucas Oliveira <62335616+lucaseduoli@users.noreply.github.com>
Date: Thu Oct 31 16:39:58 2024 -0300
fix: add collapsible function to templates and fix design bugs (#4305)
* Updated colors
* Fixed design for small screens
* Change border radius
* Changed size of text on templates description
* Fix shine effect on small screens
* Fixed icons on starter templates
* Updated mono font to JetBrains
* Updated icon hit area for X
* Added gradient wrapper and x-gradient
* Changed colors and font weights for nav component
* Added zoom on hover of gradient
* Fixed input size
* Fixed all templates to show everything
* Hide scrollbar
* Change text size of card
* Removed title of the categories
* Removed unused currentTab from templatecategory
* Updated position of search icon
* Updated style of inputs
* Updated search clear button
* Fixed bug on small screens
* Added no results query
* Fixed background on get started cards
* Added focus ring on nav component
* Added tab index to search and sidebar buttons
* Added keyboard navigation to templates
* Updated templatesModal to use ShadCN Sidebar
* Implemented collapsible sidebar
* Fix collapsible to work on mobile but be overlaying content
* Added noise to styleUtils
* Updated padding and sizes for mobile
* Updated text size
* Updated font family to inter
* Made get started components fetch title and description from the flow
* Updated description on get started component
* Updated naming of sidebar
* Updated description of start from scratch
* Updated color of selected sidebar item
* Changed text color for sidebar not active items
* changed description sizes
* changed to line clamp
* Reduced gap between icon and category text
* Fixed no results state
* Fixed X icon only appearing on hover
* Fix auto focus issue
* fixed hover color of primary button
* Fixed gradients to use stops if it exists and stop using random gradient
* removed random gradient
* Fixed design of cards in templates
* Updated nav to go through tests
* Fixed focus on input
* [autofix.ci] apply automated fixes
* New color
* fix testes
* Fixed starter projects test
* ✨ (starter-projects.spec.ts): add Page import to test function parameters for better code readability and maintainability
📝 (starter-projects.spec.ts): refactor test to include a function for waiting for template visibility, improving code readability and reducing duplication
---------
Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
commit a03da10750
Author: Sebastián Estévez <estevezsebastian@gmail.com>
Date: Thu Oct 31 14:57:07 2024 -0400
fix: langfuse upgrade and crew result usage (#4342)
* lanfuse upgrade and crew result usage
* ✅ (Dynamic Agent.spec.ts): Enable tests for checking the presence of required environment variables before running the test suite.
✨ (Hierarchical Agent.spec.ts): Add integration test for Hierarchical Tasks Agent to ensure proper functionality and behavior
✨ (Sequential Task Agent.spec.ts): Add integration test for Sequential Tasks Agent to ensure proper functionality and behavior
---------
Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
* [autofix.ci] apply automated fixes
* Update worker.py
adding # noqa: to solve CI Error
* [autofix.ci] apply automated fixes
* Update worker.py
removed unused params that were causing the issue
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: italojohnny <italojohnnydosanjos@gmail.com>
feat: Add model_utils and model_constants
- Enhanced the initialization logic in model_constants to handle delayed imports and circular dependencies.
- Improved type hinting for better code clarity and maintainability.
Details:
- `get_model_info`: Retrieves comprehensive information about all available models, which is used to populate the `MODEL_INFO` dictionary.
- `MODEL_INFO`: A dictionary where each key is a model identifier, and the value is a dictionary containing details about the model, such as its `display_name` and configuration options.
- `PROVIDER_NAMES`: A list derived from `MODEL_INFO` that holds the names of model providers, providing a quick reference to all available model providers.
* Added required ShadCN Components
* Added required colors
* Added required icons
* Changed backend to not return beta tag
* Added sidebar categories api call
* Added required use-mobile hook
* Refactored icons to allow sizing
* Added type for sidebar category
* Allowed no name on shortcut display
* Added flow sidebar component that uses ShadCN sidebar
* Added SidebarDraggableComponent with the new style
* Replaced sidebar with current one on FlowPage
* Added sidebar fixed footer with options to go to store and add custom component
* Updated sidebar categories
* Updated background color for sidebar
* Changed size of Components title
* Added color to PageComponent
* Added required icons
* added CustomComponent category and removed custom component from helpers
* create hook useAddComponent
* Use hook to add components both in PageComponent and flowSidebarComponent
* Implement search
* Implement searching and filtering by clicking on edge
* Added check to see if store is present
* Updated colors to match new color schema
* Changed styling of filter component
* Added Beta and Legacy badges
* Implement Show Beta Components and Show Legacy Components
* Fixed styling for sidebar config when collapsed
* Refactored search to filter for tags
* Refactor useeffect
* Updated config button styling
* Implemented keyboard navigation
* Fixed filtering
* Updated color of canvas
* Implemented disclosure on sidebar settings and fetched bundles
* Added temp sidebar bundles
* Fixed badge styling
* Added bundles to categories response in frontend
* Added legacy to components
* Added link to store instead of langflow.store
* Added required data-testids
* Fixed tests to use new data-testids and new sidebar disposition
* Fix github star bug
* Fixed tests that used the custom component
* Changed test to test beta and legacy checkers
* added a test for keyboard navigation on sidebar
* Added a test to check component add by hover the plus button
* [autofix.ci] apply automated fixes
* updated sidebar switch change
* Removed changes on Backend and used only Frontend constants for categories
* merge fix
* [autofix.ci] apply automated fixes
* [autofix.ci] apply automated fixes (attempt 2/3)
* 📝 (custom_component): Add CustomComponent class with input and output definitions
📝 (custom_component): Create CustomComponent class with display name, description, and documentation link
📝 (custom_component): Define input and output properties for CustomComponent class
📝 (custom_component): Implement build_output method in CustomComponent class
📝 (Ollama): Remove unnecessary whitespace in SvgOllama component
* formatting
* ♻️ (custom_component/__init__.py): refactor import statement to match the correct case of the file name for better consistency and readability
* 🔧 (FlowPage/index.tsx): remove FlowToolbar component when view prop is false to improve UI consistency
* 📝 (integration-side-bar.spec.ts): Comment out unnecessary code blocks related to API requests and modals to improve test readability and focus on the main test scenarios.
* [autofix.ci] apply automated fixes
* ✨ (flowSidebarComponent/index.tsx): add data-testid attribute to Sidebar component for testing purposes
🔧 (integration-side-bar.spec.ts): update test to use new data-testid attribute 'shad-sidebar' for Sidebar component to match changes in the codebase
* ✨ (stop-building.spec.ts): refactor test case to use a more descriptive test element for clicking on the sidebar custom component button
* format
* 🐛 (AstraDB): Fix variable naming inconsistency for isDark to isdark in AstraDB component
🐛 (HCD): Fix variable naming inconsistency for isDark to isdark in HCD component
🐛 (index.tsx): Fix variable naming inconsistency for isDark to isdark in index.tsx files
📝 (flowSidebarComponent): Refactor search functionality to normalize search terms and improve metadata search
📝 (filterEdge-shard-1.spec.ts): Update test to check visibility of specific model specs in the sidebar
* [autofix.ci] apply automated fixes
* ✅ (decisionFlow.spec.ts): add a delay of 500ms to ensure proper timing in the test case execution
* ✨ (decisionFlow.spec.ts): Update the X positions of elements in the flow to improve the visual representation and alignment of the elements.
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
* feat: Allow variables to be defined outside a Component
Fixes#4315
Modify `prepare_global_scope` function in `src/backend/base/langflow/utils/validate.py` to evaluate classes, functions, and variables defined outside the Component's class.
* **Function Changes:**
- Add evaluation of external classes using `ast.ClassDef`.
- Add evaluation of external functions using `ast.FunctionDef`.
- Add evaluation of external variables using `ast.Assign`.
* **Unit Tests:**
- Add tests in `src/backend/tests/unit/test_validate_code.py` to verify the evaluation of external classes, functions, and variables.
- Include tests for multiple external classes and external variables and functions.
---
For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/langflow-ai/langflow/issues/4315?shareId=XXXX-XXXX-XXXX-XXXX).
* [autofix.ci] apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* Remove unnecessary use of 'client' fixture in test_superuser
* Remove unnecessary use of 'usefixtures' decorator in test files
* Update test fixtures to improve test duration tracking
* Remove unnecessary 'client' fixture from test cases
* fix: Add missing inputs for HuggingFace model component and include pytest
- Added missing inputs to the HuggingFace model component.
- Implemented pytest to ensure the inputs are correctly handled.
* remove print statement
* Refine subflow field filtering to include '|' character check
* Add resource cleanup in test_components_path to ensure proper closure
* Remove unnecessary try-finally block in test_cli.py
* Remove unused pytest fixture decorator from test_components_path function
* Update test duration tracking in backend tests
* Enhance Component Input Handling and Add Unit Tests
Enhance component input handling and add unit tests for mixed input scenarios.
* [autofix.ci] apply automated fixes
* fix: handle JSON serialization for lists and dicts in _process_connection_or_parameters
- Updated the _process_connection_or_parameters function to handle lists and dictionaries properly.
- Ensured that each element in a list is checked for serializability and converted to a string if necessary.
- Added logic to convert dictionaries to JSON strings, handling non-serializable contents by converting them to strings.
- This change prevents JSON serialization errors when processing component parameters.
* reverting the changes
* [autofix.ci] apply automated fixes
* Update component.py
updates _process_connection_or_parameters to handles situations where the list is not all component.
Also handles any serialisation isseus caused by _process_connection_or_parameters
* [autofix.ci] apply automated fixes
* Update component.py
update make sure it is not a list str | int | float | bool | type(None)
Serialisation removed
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Implement conditional tool output handling
- Updated `component.py` to check for `FEATURE_FLAGS.add_toolkit_output` and call `_append_tool_output` if the component has the `add_tool_output` attribute set to True.
- Ensured that the tool output behavior is correctly managed based on feature flags and component attributes in `custom_component.py`.
* 📝 (utils.py): Add Query import and custom_params function to handle custom pagination parameters
📝 (flows.py): Update read_flows function to handle get_all flag and add error handling for missing folders
📝 (folders.py): Add custom_params dependency to read_folder endpoint for custom pagination handling
📝 (model.py): Remove PaginatedFlowResponse class as it is no longer used, add FlowHeader class to represent flow headers without data
✨ (test_database.py): Add pagination support for reading flows with different parameters to improve testing coverage and flexibility.
✅ (test_database.py): add unit tests for reading folders with different scenarios such as pagination, flows, search, and component filter to ensure proper functionality and data retrieval.
* 📝 (utils.py): Add constants MAX_PAGE_SIZE and MIN_PAGE_SIZE for better readability and maintainability
📝 (flows.py): Update get_all parameter default value to True for backward compatibility with frontend
📝 (flows.py): Update error message formatting for clarity
📝 (model.py): Update comments for folder_id, is_component, endpoint_name, and description fields for clarity
* ✨ (test_database.py): Simplify test functions by removing unnecessary parameters and code duplication to improve readability and maintainability.
* formatter
* [autofix.ci] apply automated fixes
* ruff fix
* [autofix.ci] apply automated fixes
---------
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* Add utility functions to build Pydantic models from schema definitions
* Add unit tests for build_model_from_schema function in test_base_model.py
- Implement various test cases to validate the functionality of build_model_from_schema.
- Test cases cover scenarios such as handling valid and empty schemas, managing unknown field types, and processing schemas with missing optional keys.
- Ensure proper handling of nested list and dict types, and verify the function's efficiency with large schemas.
- Confirm that the function raises exceptions for invalid input and handles duplicate field names correctly.
* Refactor tests in `test_base_model.py` to improve type handling and error checking
* Refactor output schema handling to use TableInput and build_model_from_schema
* Update OpenAI model components and hierarchical crew setup
- Refactor `OpenAIModelComponent` to use `TableInput` for `output_schema` and integrate `build_model_from_schema`.
- Modify `HierarchicalCrewComponent` to use unpacking for base inputs.
- Ensure consistent import statements across JSON files.
- Improve error handling and logging for vector store operations.
* Add chat result model with message building and execution logic
- Implement `build_messages_and_runnable` to construct message lists and configure runnable models.
- Add `get_chat_result` to execute language models with input messages, supporting streaming and custom configurations.
- Handle exceptions with optional custom error messages.
* Add "table" to DIRECT_TYPES in constants.py
* Add support for DataFrame input validation in TableInput class
* Add StructuredOutputComponent for generating structured outputs from language models
* Enhance structured output component with improved input descriptions and schema naming
* Convert DataFrame to list of dictionaries in TableInput validation
* Remove pandas dependency and refactor schema handling in structured_output.py
* Remove 'default' field from structured output schema and update field initialization
* Add 'number' and 'text' types to type mapping and remove default value from field creation
* Enhance error handling in structured output building process
* Improve error message for non-BaseModel output in structured_output.py
* Add unit tests for StructuredOutputComponent in helpers module
- Implement various test cases to ensure correct functionality of StructuredOutputComponent.
- Test successful structured output generation, handling of unsupported language models, and correct output model building.
- Validate handling of multiple outputs, empty and invalid output schemas, and nested schemas.
- Include tests for large input values and invalid language model configurations.
* Update description for StructuredOutputComponent to clarify functionality
* Add default values and error handling for structured output in helpers
* Remove unused 'method' parameter from 'with_structured_output' in MockLanguageModel
* refactor: rename test_base_model.py to test_base_model_from_schema.py
Rename the test_base_model.py file to test_base_model_from_schema.py to better reflect its purpose of testing the build_model_from_schema function. This change improves code clarity and maintainability.
* Add type ignore comments to suppress type checking errors
* Add Generic typing to StructuredOutputComponent and fix method call
* Revert "Refactor output schema handling to use TableInput and build_model_from_schema"
This reverts commit 2e84a8608689bcfb519dc589d3eeef852784f3e4.
* Deprecate JSON mode in OpenAIModel output schema documentation
* Remove unused Generic import and add type ignore comment in StructuredOutputComponent
* Refactor OpenAI model components and deprecate output schema
- Refactored `OpenAIModelComponent` to use `operator.ior` and `functools.reduce` for converting `output_schema` to a dictionary.
- Deprecated the `output_schema` field, updating its info to reflect the deprecation.
- Simplified the `_docs_to_data` method in `SplitTextComponent` for better readability.
- Updated import statements and removed unused imports across multiple JSON files.
* Add specific type ignore comments and update exception types in backend code
* 🐛 (type_extraction.py): fix condition to correctly handle UnionType objects in type extraction process
* ✨ (test_schema.py): add support for additional data types and nested structures in post_process_type function to improve type handling and flexibility
* ✅ (test_schema.py): add additional test cases for post_process_type function to cover various Union types and combinations for better test coverage and accuracy
* 📝 (utils.py): add format_directory_path function to properly escape and format directory paths for consistency and validity
* ✨ (test_format_directory_path.py): add unit tests for the format_directory_path function to ensure correct formatting of directory paths
📝 (test_format_directory_path.py): add documentation and examples for different types of directory paths in the unit tests to improve code readability and maintainability
* 🐛 (utils.py): fix the incorrect replacement of backslashes with newline characters in the format_directory_path function
📝 (test_rewrite_file_path.py): update test cases and function names to reflect the changes made in the format_directory_path function in utils.py
* 🐛 (test_format_directory_path.py): update parameter name from 'path' to 'input_path' for clarity and consistency
📝 (test_format_directory_path.py): improve test case descriptions and handle newline characters in paths correctly
* Update starter flows
* Update button with new menu variants
* Updated AstraDB icon
* Made header be optional on baseModal and added classname to content
* Removed old newFlowModal
* added a Nav component to show the sidebar categories
* Created new templates modal
* Updated components and modals to use new Templates modal
* Added used icons
* added template card
* changed templates modal to use modular components
* Add template content
* Add get started content
* added other size for templates
* Added size in base modal
* Changed menu ring-0 to be important
* Added all of the images of get started
* Fix hover effect on spirals
* Implement clicking get started templates
* Fix shiny design
* update package lock
* update examples
* updated card design
* Added grid of examples to templates
* Implemented card click
* Changed hover effect
* Added arrows
* delete unused
* implemented fuse search
* Added create blank project
* Made tags be read
* Added tags to basic prompting
* Added types
* Added tags to the tabs
* remove important from tailwind config
* updated setup and model to include icon
* added random-gradient npm package
* updated colors to remove white
* added icons
* inserted metadata of icons and etc into starter flows
* Removed integrations and added blank project creation
* Added gradient to cards
* Reset query when changing tab, reset scroll when typing
* added mix blend overlay to text
* Added id and gradient to templatecard type
* made icons for components still work
* added important on stroke
* formatting
* Fixed infinite render
* added test id to create blank project
* added data test id for templates title
* ✨ (navComponent/index.tsx): add data-testid attribute with converted test name for side navigation options to improve testability and accessibility
* ✨ (starter-projects.spec.ts): add test to ensure user can interact with starter projects in the frontend application
* ✨ (TemplateCardComponent/index.tsx): add data-testid attribute with converted test name for better testability and accessibility
* ✨ (TemplateCategoryComponent/index.tsx): import convertTestName function to convert test names for data-testid attributes in TemplateCategoryComponent
* fixed currentTab not changing results
* Fixed various tests
* ✨ (similarity.spec.ts): improve user experience by adding functionality to fit view and scroll using mouse wheel in the test suite
* Fix other tests relying on multiple
* fix two edges test
* Fix hover on test 3 of generalBugs
---------
Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
* ⬆️ (uv.lock): Update authlib version from 1.3.2 to 1.3.1
⬆️ (uv.lock): Update httpx version from 0.27.2 to 0.27.0
⬆️ (uv.lock): Add new package grpcio-health-checking version 1.62.3
⬆️ (uv.lock): upgrade weaviate-client package from version 3.26.7 to 4.8.1 and add new dependencies grpcio, grpcio-health-checking, grpcio-tools, httpx, and pydantic. Update package source and distribution URLs accordingly.
* ✨ (flows.py): Add pagination support for retrieving a list of flows to improve performance and user experience
📝 (flows.py): Update documentation to reflect changes made for pagination and additional query parameters
📝 (folders.py): Add a new endpoint to retrieve a folder with paginated flows for better organization and readability
* ✨ (model.py): add PaginatedFlowResponse class to handle paginated flow responses in API calls
* ✨ (test_database.py): add support for fetching all flows by adding "get_all" parameter to the request
🐛 (test_database.py): fix endpoint for fetching read-only starter projects to use correct URL path
* packages changes
* packages changes
* 📝 (paginatorComponent/index.tsx): refactor PaginatorComponent to use constants for default values and improve code readability
🐛 (paginatorComponent/index.tsx): fix issue with setting maxPageIndex when pages prop is provided to PaginatorComponent
* 🐛 (storeCardComponent): fix height of store card component to prevent overflow and improve layout aesthetics
* ✨ (constants.ts): introduce new constants for search tabs, pagination settings, and store pagination settings to enhance user experience and improve functionality
* ✨ (use-post-login-user.ts): add queryClient to UseRequestProcessor to enable refetching queries on mutation settled state
📝 (use-post-login-user.ts): update useLoginUser function to include onSettled callback in options to refetch queries after mutation settles
* ✨ (use-get-basic-examples.ts): introduce a new query function to fetch basic examples of flows from the API and update the state with the fetched data.
* ✨ (use-get-refresh-flows.ts): introduce new functionality to fetch and process flows with query parameters for components_only, get_all, folder_id, remove_example_flows, page, and size. This allows for more flexible and specific retrieval of flow data.
* ✨ (use-get-folder.ts): Add support for pagination and filtering options in the useGetFolderQuery function to enhance flexibility and customization for fetching folder data.
* 🔧 (use-get-folders.ts): Remove unused code related to refreshFlows and setStarterProjectId to improve code readability and maintainability
✨ (use-get-folders.ts): Update useGetFoldersQuery to setFolders with the fetched data instead of filtering out starter projects to simplify the logic and improve performance
* ✨ (use-upload-flow.ts): update refreshFlows function call to include an object with get_all property set to true to fetch all flows when refreshing
* 🔧 (codeAreaModal/index.tsx): remove unused import postCustomComponent to clean up code and improve readability
* 📝 (AdminPage/index.tsx): Update initial page size and index values to use constants for better maintainability
📝 (AdminPage/index.tsx): Update resetFilter function to set page size and index using constants for consistency
📝 (AdminPage/index.tsx): Update logic to handle loading state and empty user list based on isIdle state for better user experience
📝 (AdminPage/index.tsx): Update PaginatorComponent props to use constant for rows count and simplify paginate function assignment
* ✨ (AppInitPage/index.tsx): introduce new queries to fetch basic examples and folders data for improved functionality and user experience
* ✨ (FlowPage/index.tsx): update refreshFlows function call to include a parameter to get all flows at once for better performance.
* ✨ (frontend): introduce flowsPagination and setFlowsPagination functions to manage pagination for flows in the UtilityStoreType
* ✨ (frontend): introduce new 'folders' and 'setFolders' properties to FoldersStoreType to manage folder data efficiently
* ✨ (types.ts): introduce Pagination type to define structure for pagination data in frontend application
* ✨ (frontend): introduce PaginatedFlowsType to represent paginated flow data structure in the application.
* ✨ (frontend): add optional 'pages' property to PaginatorComponentType to allow customization of the number of pages displayed in the paginator
* ✨ (utilityStore.ts): introduce flowsPagination object with default values for page and size to manage pagination in the utility store
* ✨ (foldersStore.tsx): introduce new state 'folders' and setter function 'setFolders' to manage folder data in the store
* ✨ (ViewPage/index.tsx): update refreshFlows function call to include a parameter to get all flows at once, improving efficiency and reducing unnecessary calls to the backend.
* 📝 (StorePage/index.tsx): update constants import to include new pagination constants for better organization
♻️ (StorePage/index.tsx): refactor pagination logic to use new pagination constants for clarity and consistency throughout the file
* ✨ (componentsComponent/index.tsx): Add support for pagination feature in ComponentsComponent to improve user experience and performance.
* ✨ (myCollectionComponent/index.tsx): introduce pagination and search functionality to improve user experience and data handling in the MyCollectionComponent component
* ✨ (Playground/index.tsx): Update refreshFlows function call to include a parameter to get all flows at once for better performance.
* ✨ (entities/index.tsx): introduce PaginatedFolderType to represent a folder with pagination information for better organization and handling of paginated data.
* ✨ (headerTabsSearchComponent/index.tsx): add support for changing tabs and searching functionality in headerTabsSearchComponent
📝 (headerTabsSearchComponent/index.tsx): update tabsOptions to use constant SEARCH_TABS for consistency and reusability
* 📝 (folders.py): Remove redundant import and unused code related to FolderWithPaginatedFlows class
🔧 (folders.py): Update query conditions to use explicit boolean values instead of implicit truthiness for better clarity and readability
* 📝 (folders.py): reorganize imports to improve readability and maintain consistency
* 📝 (flows.py): import FlowSummary model to support new functionality in the API
📝 (flows.py): add header_flows parameter to read_flows function to return a simplified list of flows if set to true
* 📝 (folders.py): remove unnecessary empty line to improve code readability
* ✨ (model.py): introduce new FlowSummary class to represent a summary of flow data for better organization and readability
* ✨ (pagination_model.py): introduce a new model 'FolderWithPaginatedFlows' to represent a folder with paginated flows for better organization and readability.
* 📝 (cardComponent/index.tsx): add missing semicolon to improve code consistency
♻️ (cardComponent/index.tsx): refactor logic to use data parameter directly instead of fetching flow by id to simplify code and improve readability
* ✨ (use-get-refresh-flows.ts): introduce new query parameter 'header_flows' to support fetching header flows in API requests.
* ✨ (use-get-folders.ts): add functionality to refresh flows when fetching folders to ensure data consistency and up-to-date information.
* ✨ (use-upload-flow.ts): add support for fetching header flows along with all flows when refreshing flows in useUploadFlow hook
* ✨ (use-redirect-flow-card-click.tsx): introduce a new custom hook 'useFlowCardClick' to handle flow card click events in the newFlowModal component. This hook utilizes react-router-dom for navigation, custom analytics tracking, and various utility functions to manage flow data and update the UI.
* ✨ (NewFlowCardComponent/index.tsx): refactor onClick event handler into a separate function handleClick for better readability and maintainability
* 📝 (undrawCards/index.tsx): Remove unused imports and variables to clean up the code
♻️ (undrawCards/index.tsx): Refactor onClick event handler to use a separate function for handling flow card click events
* ✨ (flowsManager/index.ts): introduce new state and setter for flowToCanvas to manage the flow displayed on canvas
* ✨ (flowsManagerStore.ts): introduce new feature to set and update the flow to be displayed on the canvas asynchronously
* ✨ (ViewPage/index.tsx): add support for fetching header flows along with all flows when refreshing data to improve data retrieval efficiency
* ✨ (collectionCard/index.tsx): introduce useFlowsManagerStore to manage flows in the application
📝 (collectionCard/index.tsx): update handleClick function to set flow to canvas before navigating to editFlowLink
* ✨ (Playground/index.tsx): add support for fetching header flows along with all flows when refreshing data in the Playground page.
* 🐛 (FlowPage/index.tsx): Fix setCurrentFlow logic to correctly set the current flow based on flowToCanvas value. Add flowToCanvas dependency to useEffect to ensure proper rendering.
* ✨ (use-get-flow.ts): introduce a new file to handle API queries for fetching flow data in the frontend application. This file defines a custom hook 'useGetFlow' that makes a GET request to the API endpoint to retrieve flow data based on the provided flow ID.
* 📝 (flows.py): update import statement to use FlowHeader instead of FlowSummary for better clarity
📝 (flows.py): update response_model in read_flows endpoint to use FlowHeader for consistency and clarity
* ✨ (model.py): rename FlowSummary class to FlowHeader for better clarity and consistency in naming conventions
📝 (model.py): add is_component field to FlowHeader class to indicate if the flow is a component or not
* ✨ (use-get-folder.ts): introduce processFlows function to process flows data
📝 (use-get-folder.ts): add cloneDeep function to safely clone data before processing
* 🔧 (use-get-refresh-flows.ts): refactor useGetRefreshFlows function to simplify processing of dbDataFlows and update state accordingly
* ✨ (FlowPage/index.tsx): Add useGetFlow hook to fetch flow data and update current flow on canvas. Add getFlowToAddToCanvas function to handle fetching and setting flow data on canvas.
* ✨ (nodeToolbarComponent/index.tsx): improve user experience by automatically closing the override modal after successful flow override
* ✨ (use-post-login-user.ts): add queryClient.refetchQueries for "useGetTags" after successful login to update tags data in the frontend.
* ✨ (use-get-flow.ts): add processFlows function to process flow data before returning it to improve code readability and maintainability
* 🐛 (use-get-refresh-flows.ts): fix asynchronous flow to correctly handle data retrieval and processing before setting state and returning flows
* ✨ (use-get-tags.ts): add functionality to set tags in utility store after fetching them from the API
* 📝 (shareModal/index.tsx): Update import statement for useUtilityStore to improve code organization and readability
🔧 (shareModal/index.tsx): Replace useGetTagsQuery with useUtilityStore to manage tags state and remove unnecessary API call for tags data
🔧 (shareModal/index.tsx): Replace references to data with tags variable to ensure consistency and avoid potential bugs
🔧 (shareModal/index.tsx): Update TagsSelector component to use tags variable instead of data for better data management
* ✨ (AppInitPage/index.tsx): introduce useGetTagsQuery to fetch tags data from the store API for AppInitPage.
* ✨ (StorePage/index.tsx): refactor to use useUtilityStore for tags state management instead of useGetTagsQuery for better separation of concerns and code organization. Update TagsSelector component to use tags from useUtilityStore hook.
* ✨ (frontend): introduce Tag type to UtilityStoreType and add tags and setTags functions to manage tags in the store.
* ✨ (types.ts): introduce new Tag type to represent a tag with id and name properties
* ✨ (utilityStore.ts): introduce new 'tags' array and 'setTags' function to manage tags in the utility store
* 📝 (App.css): add a blank line for better readability and consistency in the CSS file
* ✨ (test_database.py): add pagination support for reading flows and folders to improve data retrieval efficiency and user experience
* ✨ (tabsComponent/index.tsx): refactor changeLocation function to use useCallback hook for better performance and stability
✨ (tabsComponent/index.tsx): update onClick event handler to directly call changeLocation function for cleaner code and improved readability
* ✨ (headerTabsSearchComponent/index.tsx): refactor handleChangeTab, handleSearch, handleInputChange, and handleKeyDown functions to use useCallback for better performance and memoization
📝 (headerTabsSearchComponent/index.tsx): update tabActive prop to use the activeTab prop passed from parent component for consistency and clarity
* ✨ (myCollectionComponent/index.tsx): refactor filter state initialization to dynamically set based on current location pathname
♻️ (myCollectionComponent/index.tsx): refactor onSearch and onChangeTab functions to use useCallback for better performance and memoization
* ✨ (create-query-param-string.ts): introduce a new utility function to build query parameter strings for URLs in the frontend controllers.
* ✨ (use-get-folder.ts): introduce buildQueryStringUrl function to create query parameter strings for API requests
📝 (use-get-folder.ts): add comments to explain the purpose of the code and improve code readability
🔧 (use-get-folder.ts): update useGetFolderQuery function to include additional configuration options for the query, such as refetchOnWindowFocus: false
* ✨ (use-delete-folders.ts): add functionality to update local store after deleting a folder to keep it in sync with the server data
* 📝 (use-post-add-flow.ts): import useFolderStore to access myCollectionId state for refetching queries with the correct folder_id
🐛 (use-post-add-flow.ts): fix queryClient.refetchQueries to include the correct queryKey with folder_id or myCollectionId if response.folder_id is null
* ✨ (use-get-refresh-flows.ts): refactor addQueryParams function to use buildQueryStringUrl utility function for better code readability and maintainability
* ♻️ (flows.py): remove unnecessary commented out code and add pagination functionality to the router for better code organization and readability
* 🔧 (NodeDescription/index.tsx): remove console.log statement for better code cleanliness and readability
* ✨ (index.tsx): Add DialogClose component from @radix-ui/react-dialog to handle cancel action in ConfirmationModal. Refactor handleCancel function to improve code readability and maintainability.
* ♻️ (use-redirect-flow-card-click.tsx): remove unused setFlowToCanvas function to clean up code and improve maintainability
* 📝 (use-patch-update-flow.ts): update onSettled callback to refetch useGetFolders query with the updated folder_id after patching a flow
* 🔧 (use-delete-folders.ts): update onSettled function to correctly refetch queries with the specific folder id when deleting folders
* ✨ (use-get-folder.ts): update useGetFolderQuery to include additional query parameters for pagination and filtering options
* 🔧 (use-post-upload-to-folder.ts): update onSettled callback to refetch useGetFolders query with the correct queryKey and folder_id parameter
* ✨ (use-add-flow.ts): add functionality to refresh flows after adding a new flow to ensure the UI is up to date with the latest data.
* ✨ (AppInitPage/index.tsx): enable fetching basic examples and tags only when isFetched is true to improve performance and reduce unnecessary API calls
* ✨ (myCollectionComponent/index.tsx): refactor onPaginate function to handlePageChange callback for better code organization and readability. Update key prop in ComponentsComponent to include filter and search variables for proper re-rendering.
* ✨ (use-get-folder.ts): add placeholderData option to useGetFolderQuery to provide initial data while fetching folder information
* [autofix.ci] apply automated fixes
* 🐛 (use-post-upload-to-folder.ts): fix queryKey values to correctly refetch queries after uploading a file to a folder
* ⬆️ (folders.spec.ts): increase timeout for waiting in test to improve reliability and prevent flakiness
* ✨ (folders.spec.ts): update selectors to target specific elements by using the first() method to improve test reliability
* ✅ (auto-save-off.spec.ts): update test to match changes in UI for auto-save feature and improve test coverage for hover functionality.
* 📝 (model.py): update model fields to set default values for folder_id, is_component, endpoint_name, and description to None for consistency and clarity
* ♻️ (index.tsx): refactor isUpdatingFolder logic to include isFetchingFolder variable for better accuracy and readability
* 🐛 (index.tsx): fix variable name typo in isLoadingFolder assignment to correctly reference isFetchingFolder
* 🐛 (use-patch-update-flow.ts): fix issue with missing closing parenthesis in queryClient.refetchQueries() method
📝 (use-patch-update-flow.ts): update queryKey in queryClient.refetchQueries() to ["useGetFolder"] to correctly refetch the folder data after updating a flow
* ✨ (use-save-flow.ts): add support for fetching flow data before saving if not already present to ensure data consistency and accuracy
* ✅ (folders.spec.ts): update selectors to target specific elements correctly for testing purposes
* ✨ (use-on-file-drop.tsx): add support for checking flow names in a specific collection to prevent duplicates
♻️ (use-add-flow.ts): refactor to use the same logic for checking flow names in a specific collection to prevent duplicates
* ✨ (index.tsx): Add useIsMutating hook to check if a folder is being deleted to update UI accordingly
♻️ (index.tsx): Refactor logic to determine if a folder is being updated to include check for folder deletion
🔧 (index.tsx): Refactor Select component to use a separate function for handling value change
🔧 (index.tsx): Refactor Button components to disable based on separate variables for first and last page
🔧 (index.ts): Remove unused import and refactor code to use useRef hook for storing the latest folder id in useGetFolderQuery
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* ✨ (model.py): add new method `serialize_params` to serialize parameters data in VertexBuildBase class
* 🐛 (util_strings.py): fix truncation logic to correctly handle long strings by truncating them with ellipsis if they exceed the maximum length
* ✅ (test_truncate_long_strings.py): add unit tests for the truncate_long_strings function to ensure it works correctly with various input scenarios
* ✅ (test_truncate_long_strings_on_objects.py): update test assertion message to reflect the expected behavior of the function
* Refactor Alembic environment script to simplify database connection logic and remove unused imports
* Refactor test client fixture to use TemporaryDirectory and UUID for database path
* Add `reload_engine` method to reinitialize the database engine
* Add cleanup steps to test fixtures to ensure proper resource management
- Added cleanup steps to various pytest fixtures to ensure temporary directories, database entries, and other resources are properly cleaned up after tests.
- Modified fixtures to use `yield` for better resource management.
- Ensured database connections are closed and tables are dropped after tests.
- Improved temporary directory handling with context managers.
* Add unit test to verify return type of list_flows method in custom component
* Refactor tests in `test_custom_component.py` to remove unused imports and fixtures, and update existing fixtures for consistency.
* Add debug checks for user existence in `test_user_waiting_for_approval` test
* Fix import order and add flow_id validation in transaction handling
- Corrected the import order in `utils.py`.
- Added validation for `flow_id` in the transaction handling logic to ensure it is set correctly.
* Add function to delete transactions by flow ID in CRUD module
* Add cleanup for transactions and vertex builds in test teardown
- Introduced `_delete_transactions_and_vertex_builds` function to remove transactions and vertex builds associated with a user.
- Updated `user` fixture to call the new cleanup function before deleting the user.
* Refactor flow_id assignment logic in `utils.py` to improve readability and correctness
* [autofix.ci] apply automated fixes
* Refactor test to use pytest's tmp_path fixture for temporary directory creation
* Convert `test_user_waiting_for_approval` to an async test function
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* Add 'type', 'description', and 'default' fields to Table schema and enhance formatter validation
* Add type-based mapping to formatter validator in table schema
* Add default value support for new table rows in TableNodeComponent
* Add optional 'description' and 'default' fields to ColumnField interface
* Add default value inference for table columns in utils.ts
- Initialize 'default' property for table columns to null.
- Infer default value from the first row of data if available.
- Adjust column formatter determination based on sample value.
* Add default table input validation and update formatter logic in Column model
* Add unit tests for Column class in table schema module
---------
Co-authored-by: github-actions[bot] <41898282+github-actions[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>
* 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>
* 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>
* Add fixture for creating flow component in tests
* Add test for reading flows with components only in test_database.py
* Add `components_only` parameter to filter flows by components in API endpoint