* Add cycle detection and handling in graph edge building process
- Introduced `cycles` property to detect cycles in the graph.
- Modified `_build_edges` and `build_edge` methods to differentiate between `CycleEdge` and `Edge`.
- Updated imports and type hints to support new functionality.
* Add cycle detection and handling in graph processing
- Introduced `is_cyclic` property to check for cycles in the graph.
- Added `_snapshot` method for capturing the current state of the graph.
- Modified `layered_topological_sort` to handle cyclic graphs by starting from a specified start component.
- Updated imports and type hints for better code clarity and functionality.
* Refactor tests and components for improved caching and data handling
- Updated `test_vector_store_rag.py` to use `set_on_output` with `cache=True` and simplified assertions.
- Enhanced `test_memory_chatbot.py` with additional assertions for graph structure and caching.
- Simplified `to_data` method in `base.py` to directly return `_data` without JSON serialization.
* Add unit tests for detecting cycles in graph
- Introduce `test_cycle_in_graph` to verify cyclic behavior in the graph.
- Add `test_cycle_in_graph_max_iterations` to ensure max iterations limit is respected.
- Implement `Concatenate` component for testing purposes.
* Disable output cache in graph tests to allow loops to work
* Refactor: Update VertexStates enum values to uppercase and optimize imports in base.py
* Refactor type hints and improve error handling in `Vertex` class
- Replace `ValueError` with `NoComponentInstance` exception for missing component instances.
- Add `target_handle_name` parameter to `_get_result` method for better result retrieval.
- Refactor type hints to use `collections.abc` for `AsyncIterator`, `Generator`, and `Iterator`.
- Update type hints for `extract_messages_from_artifacts` and `successors_ids` methods to use generic `dict` and `list`.
* Add initial setup for "Simple Agent" starter project
- Introduced a new JSON configuration for the "Simple Agent" starter project.
- The flow includes nodes for Chat Input, Chat Output, OpenAI Model, Tool Calling Agent, Calculator Tool, and Python REPL Tool.
- Configured edges to connect these nodes, enabling interaction between different components.
- Added detailed descriptions and configurations for each node to facilitate easy setup and usage.
* Add Travel Planning Agents starter project JSON file
- Introduced a new JSON file for Travel Planning Agents in the starter projects directory.
- The JSON file includes configurations for various nodes such as ChatInput, ChatOutput, OpenAIModel, ToolCallingAgent, SearchAPI, URL Content Fetcher, and CalculatorTool.
- Defined connections between nodes to create a multi-agent system for planning trips.
- Added detailed prompts and configurations for each node to facilitate travel itinerary creation and information retrieval.
* Update example names in newFlowModal to match updated project terminology
* Update agent names in undrawCards component for consistency
* Rename "Complex Agent" to "Dynamic Agent" across frontend and backend components
* format project
* ✨ (Dynamic Agent.spec.ts): Add end-to-end test for Dynamic Agent functionality
✨ (Simple Agent.spec.ts): Add end-to-end test for Simple Agent functionality
✨ (Travel Planning Agent.spec.ts): Add end-to-end test for Travel Planning Agent functionality
* ✨ (Travel Planning Agent.spec.ts): Update end-to-end test for Travel Planning Agent to include new interactions and connections for improved test coverage and functionality.
---------
Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
* fix: Problem in the description field when using the MariaDB or MySQL database.
* fix: Problem in the description field when using the MariaDB or MySQL database.
* fix: Add the migration script to update description columns type.
* [autofix.ci] apply automated fixes
* Update src/backend/base/langflow/alembic/versions/1d90f8a0efe1_update_description_columns_type.py
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
---------
Co-authored-by: Marcelo Nunes <marcelo.nunes@nava.com.br>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
* refactor(log_router.py): change variable type annotation from List to list for better consistency
refactor(utils.py): change variable type annotation from Dict to dict for better consistency
refactor(base.py): change variable type annotation from Optional to Union for better clarity
refactor(callback.py): change variable type annotation from Dict to dict for better consistency
refactor(chat.py): change variable type annotation from Optional to Union for better clarity
refactor(endpoints.py): change variable type annotation from Optional to Union for better clarity
refactor(flows.py): change variable type annotation from List to list for better consistency
refactor(api): update response_model annotations to use lowercase list for consistency and improve readability
refactor(store.py): update type annotations for query parameters in get_components endpoint to improve code readability and maintainability
feat(store.py): add support for type hinting Union and list types in query parameters for better data validation and documentation
* run make format
* refactor(input_mixin.py): update typing annotations for variables to use union types for better clarity and compatibility with Python 3.10
refactor(inputs.py): update typing annotations for variables to use union types and import necessary modules for compatibility with Python 3.10
* refactor(base.py): remove unnecessary imports and update typing for fields in Input and Output classes
feat(base.py): add support for specifying field types more explicitly in Input and Output classes
feat(frontend_node/base.py): enhance typing and field definitions in FrontendNode class
feat(frontend_node/custom_components.py): improve typing and field definitions in CustomComponentFrontendNode and ComponentFrontendNode classes
feat(template/base.py): update typing for fields in Template class and remove unnecessary imports
* refactor(inputs): remove unnecessary Optional import from typing in input_mixin.py and inputs.py files to improve code readability and maintainability
* refactor(schema.py): change 'Type' to 'type' for consistency in type annotations
refactor(schema.py): change 'list' to 'List' and 'Literal' to 'literal' for correct type hinting in create_input_schema function
* refactor(utils.py): change typing annotations from List and Union to list and type to follow PEP 585 standards
refactor(test_schema.py): change typing annotations from List and List to list and list to follow PEP 585 standards
refactor(test_graph.py): change typing annotations from Type and Union to type and Vertex | None to follow PEP 585 standards
refactor(test_io_schema.py): change typing annotations from List and List to list and list to follow PEP 585 standards
refactor(test_custom_component.py): update file reading method to remove unnecessary "r" mode
refactor(test_helper_components.py): update file reading method to remove unnecessary "r" mode
refactor(test_kubernetes_secrets.py): update b64encode method argument to bytes type
refactor(test_template.py): change typing annotations from Optional, List, and Dict to list, dict, and None to follow PEP 585 standards
* [autofix.ci] apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* refactor(input_mixin.py): update typing annotations for variables to use union types for better clarity and compatibility with Python 3.10
refactor(inputs.py): update typing annotations for variables to use union types and import necessary modules for compatibility with Python 3.10
* refactor(base.py): remove unnecessary imports and update typing for fields in Input and Output classes
feat(base.py): add support for specifying field types more explicitly in Input and Output classes
feat(frontend_node/base.py): enhance typing and field definitions in FrontendNode class
feat(frontend_node/custom_components.py): improve typing and field definitions in CustomComponentFrontendNode and ComponentFrontendNode classes
feat(template/base.py): update typing for fields in Template class and remove unnecessary imports
* refactor(inputs): remove unnecessary Optional import from typing in input_mixin.py and inputs.py files to improve code readability and maintainability
* refactor(schema.py): change 'Type' to 'type' for consistency in type annotations
refactor(schema.py): change 'list' to 'List' and 'Literal' to 'literal' for correct type hinting in create_input_schema function
* test: fix tests
---------
Co-authored-by: italojohnny <italojohnnydosanjos@gmail.com>
* refactor: Add _find_matching_output_method to Component class
* feat: allow components to be passed in set method
* fix: Add test for graph set method with valid component
* set value variable to the output callable
* refactor: Update test_component.py to use set_component method
This commit refactors the test_component.py file in the custom_component directory. The test_set_invalid_input() function has been renamed to test_set_component() to better reflect its purpose. Additionally, the test_set_component() function now sets the agent parameter using the set_component() method instead of raising a ValueError. This change improves the readability and maintainability of the code.
* refactor: Fix formatting issue in _build_error_string_from_matching_pairs
The _build_error_string_from_matching_pairs method in the Component class had a formatting issue when input types were empty. This commit fixes the issue by adding a check for empty input types and providing an empty list as a fallback. This improves the accuracy and readability of the error string generated by the method.
* fix(component.py): add validation to ensure output method is a string to prevent potential runtime errors
* refactor(log_router.py): change variable type annotation from List to list for better consistency
refactor(utils.py): change variable type annotation from Dict to dict for better consistency
refactor(base.py): change variable type annotation from Optional to Union for better clarity
refactor(callback.py): change variable type annotation from Dict to dict for better consistency
refactor(chat.py): change variable type annotation from Optional to Union for better clarity
refactor(endpoints.py): change variable type annotation from Optional to Union for better clarity
refactor(flows.py): change variable type annotation from List to list for better consistency
refactor(api): update response_model annotations to use lowercase list for consistency and improve readability
refactor(store.py): update type annotations for query parameters in get_components endpoint to improve code readability and maintainability
feat(store.py): add support for type hinting Union and list types in query parameters for better data validation and documentation
* run make format
* ✨ (RetrieverTool.py): add "input_types" field to the configuration of the RetrieverToolComponent class
* ✅ (generalBugs-shard-12.spec.ts): add end-to-end test for connecting RetrieverTool to other components in the application.
* refactor(tests): update import statements in conftest.py to use collections.abc module for better compatibility and maintainability
* run pyupgrade on graph module
* [autofix.ci] apply automated fixes
* refactor(attributes.py): change import statement from 'typing.Callable' to 'collections.abc.Callable' for better compatibility
refactor(code_parser.py): update type annotations to use '|' for Union types for better readability
refactor(base_component.py): update type annotations to use '|' for Union types for better readability
refactor(component.py): change import statement from 'typing.Callable' to 'collections.abc.Callable' for better compatibility
refactor(component.py): update type annotations to use '|' for Union types for better readability
refactor(component.py): update type annotations to use 'list' instead of 'List' for consistency
refactor(custom_component.py): update typing imports and annotations for better readability and consistency
refactor(utils.py): change type hint 'List' to 'list' for consistency and compatibility with Python 3.9
* run make format
* [autofix.ci] apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* Commit to solve Model not loading issue
The issue was that the url of the models: api/tags was not parsed correctly.
It was having a // hence used urlencode to parse it properly.
Th e correct apporach works only if the base_url is correct,i.e a valid ollama URL:
for DS LF this must be a public ollama Server URL.
* updated the component Ollama Component
changed the get model to take in base url and the function will make the expected url for the model names. This makes the function better, than providing the model url as paramter.
Added Pytest, 7 tests, 1 test excluded for future implememtstion: test_build_model_failure
Make lint and Make format had touched multiple files
* removed unwanted print statements
removed unwanted print statements.
make format, formatted a lot of .tsx files also
* removed skipped tests
* [autofix.ci] apply automated fixes
* [autofix.ci] apply automated fixes (attempt 2/3)
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* fix: connection_string_parser.py
In version 1.0.14, a connection string that includes a port, like the following example, works without any issues:
`test_connection_string = 'postgresql://postgres:password!!@pgdatabase.hosts:5432'`
However, in version 1.0.15, using this connection string causes an error.
"Error building Component PGVector: invalid literal for int() with base 10"
This is because 5432, which is the result of parsing the password_url, is being used as the last element in the password_url list.
* [autofix.ci] apply automated fixes
* Update connection_string_parser.py
fix
transformed_connection_string = f'{protocol_user}:{encoded_password}@{db_url_name}'
* [autofix.ci] apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* refactor(tracing/service.py): change asyncio.create_task to self.logs_queue.put_nowait for better performance and readability
* fix(chat.py): remove unnecessary logging of exception in build_flow function to improve code readability and maintainability
* refactor(tracing/service.py): refactor _end_and_reset method to use asyncio.create_task for better performance and readability
* ✨ (frontend): Add TimeoutErrorComponent to handle timeout errors in API requests
🔧 (frontend): Add healthCheckTimeout state and setHealthCheckTimeout function to utilityStore for managing timeout errors in API requests
* 📝 (constants.ts): add constants for server health check intervals to improve code readability and maintainability
🐛 (use-get-health.ts): fix refetch interval value to use the newly added constant REFETCH_SERVER_HEALTH_INTERVAL for consistency and easier maintenance
* 📝 (api.tsx): Add utilityStore import to improve code organization
📝 (api.tsx): Add createNewError503 function to handle custom 503 errors
📝 (api.tsx): Add AxiosError import for type checking
📝 (api.tsx): Refactor error handling logic for authentication errors
📝 (use-get-health.ts): Add createNewError503 import for custom 503 errors
📝 (use-get-health.ts): Add AxiosError import for type checking
📝 (use-get-health.ts): Refactor error handling logic for server busy status
📝 (index.tsx): Add AxiosError import for type checking
📝 (index.tsx): Add useEffect and useState imports for state management
📝 (index.tsx): Refactor error handling logic for server status and retries
📝 (utilityStore.ts): Add retriesApiRequest state and setRetriesApiRequest function
📝 (axios-error-503.ts): Create function to generate custom 503 error responses
📝 (index.ts): Add retriesApiRequest state and setRetriesApiRequest function to UtilityStoreType
* 🔧 (utilityStore.ts): remove unused retriesApiRequest and setRetriesApiRequest functions to clean up code and improve maintainability
🔧 (index.ts): remove unused retriesApiRequest and setRetriesApiRequest types to keep type definitions consistent and up to date
* ✨ (nginx.conf): add new health endpoint to proxy_pass requests to the backend server for health checks
* ✨ (langflow): Add support for configuring the number of retries for the health check feature. This change introduces a new option `health_check_max_retries` that can be set via environment variable or command line argument to control the maximum number of retries for the health check process.
* check if value is none
* fix: improve file name generation in upload_file function to prevent files with the same name
* [autofix.ci] apply automated fixes
* fix: improve file name generation in upload_file function
* [autofix.ci] apply automated fixes
* fix: improve file name generation in upload_file function
* fix: improve file path generation in test_upload_file function
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* feat(utils): add support for V1BaseModel in serialize_field
Add support for V1BaseModel instances in the serialize_field function by
checking for a "to_json" method. If the method is not present, return the
attribute values as a dictionary.
* refactor: Update field serializer function and error handling in build_flow function
* feat: Add logging and session imports to endpoints.py
Import logging and session modules for better error handling and database interaction in endpoints.py.
* refactor: Improve custom component parameter handling in update endpoint
* feat: Add parse_value function to parse values based on input type
Add a new function `parse_value` to `utils.py` that parses values based on the input type provided. The function handles different input types such as 'IntInput' and 'FloatInput' to ensure proper parsing.
* feat: Refactor custom_component_update() to use parse_value utility function
Use parse_value utility function to handle different input types and empty values in custom_component_update() for better readability and maintainability.
* fix: Add exception handling for missing langchain_anthropic package
* refactor: Move import statement for get_starter_projects_dump in get_starter_projects
* chore: Modify logger to use error level for exception in directory_reader
* refactor: Simplify log configuration logic in Graph class
* feat(tracing): Refactor _end_traces method to be async and use asyncio.to_thread.
This is an attempt to avoid blocking the build loop
Update OpenAIModel.py- Fix can not set temperature to 0 bug.
As when the input temperature is 0, the condition would become False , so this expressing set it to 0.1, it become impossible to set it to 0.
* 📝 (langflow): Add support for configuring auto saving interval for Langflow
📝 (langflow): Update ConfigResponse and Settings to include auto_saving_interval
📝 (frontend): Update useGetConfigQuery and useSaveConfig to handle auto_saving_interval
📝 (frontend): Update useAutoSaveFlow and flowsManagerStore to handle auto saving interval
* 📝 (util.py): add support for setting auto_saving_interval in update_settings function to allow customization of auto-saving interval
* 🐛 (users.py): Fix issue where user password was not being updated correctly
📝 (constants.ts, authContext.tsx, index.tsx): Add LANGFLOW_REFRESH_TOKEN constant and update related code to support refresh token functionality
📝 (userManagementModal/index.tsx): Update form reset logic and handle input values correctly
📝 (LoginPage/index.tsx, LoginAdminPage/index.tsx): Update login function to include refresh token parameter
📝 (components/index.ts, auth.ts): Update inputHandlerEventType to support boolean values
✨ (auto-login-off.spec.ts): Add end-to-end test for user login functionality with auto_login set to false, CRUD operations for users, and verification of user flows visibility based on permissions.
* ✨ (auto-login-off.spec.ts): improve test description for better clarity and understanding
📝 (auto-login-off.spec.ts): add comments to clarify the purpose of intercepting requests and performing CRUD operations
* 🐛 (users.py): fix comparison of password to check for None using 'is not None' instead of '!= None' for better accuracy