* fixed patch update flow
* fixed update flow patch to receive id by payload
* created save flow hook with auto save and manual save functions
* fix poetry lock
* added auto save check with environment variable
* removed unused user
* separated autosave and put the flow as a creation with nodes and edges
* removed set nodes that skipped saving
* implemented auto save hook
* removed autosave from setNodes and setEdges
* added auto save hook and saved on viewport move and added useEffect to save on nodes and edges changed
* changed type of setNodes
* removed unused var
* removed deletion of empty flow
* Added saving of flow on button when autoSave is disabled
* disable saving when the nodes are empty
* removed save loading as false when the access token is renewed
* implemented useDebounce
* added save loading to save flow hook
* removed setting nodes and edges on fetching, since they are set when the current flow is updated
* removed unused var
* use debounce hook to save flow
* set nodes and edges on current flow id change
* removed useplaygroundeffect
* removed unused import
* put set save loading before the If
* removed flow cleaning and inputs setting, since the inputs and outputs are set on the ResetFlow function
* updated to use ResetFlow function to update everything regarding flow
* removed flow pool get on resetFlow, for it to be fetched only if the user is inside the flow
* updated packagelock
* Changed router to outlet on app.tsx to use createRouter
* Created authSettingsGuard to guard the general settings
* Fixed routes to use createBrowserRouter to allow the use of useBlocker
* Changed index.tsx to use RouterProvider and the router just created
* Changed flowStore to have a local flow state
* Implemented setting the current flow state when saving the flow
* Added the update of current flow when auto saving
* changed current flow to use the current flow from Flow Store instead of Flows Manager Store
* Changed codeTabsComponent Tweaks check to show if its checked
* Removed unused variables
* Removed browser router from context wrapper
* Removed unused console.log
* Changed initialSetup to just run when opening the modal
* changed confirmationModal to have destructiveCancel and to only call onCancel if the other buttons were not pressed
* Created a SaveChangesModal that confirms if the user wants to save their changes
* Get folder by id when folder id changes too
* Changed reset flow calls to store whole flow
* Added check if user is exiting page to prevent him when there are unsaved changes
* Added new types on ConfirmationModalType
* Implement save on clicking the save button on the header
* added save component shortcut to use save shortcut as save flow
* added save component shortcut on shortcutsStore type
* changed save shortcut to save component on node toolbar
* added save shortcut to header menubar
* changed shortcuts name to be compatible with existing ones
* changed shortcuts to be backwards compatible
* changed save to changes to maintain retrocompatibility
* changed save_component to save to maintain retrocompatibility
* Changed time difference to unsaved changes
* changed the toolbar select item to get the right save shortcut
* Changed save flow to use current flow from useFlowStore instead of the previous saved flow
* changed changesNotSaved to include flow name and metadata
* Added way of saving the flow settings just locally instead of directly to database
* Changed shareModal to save flow with hook
* removed old auto saving on connect
* Removed save functions from flowsManagerStore
* refactor: Remove unused imports and state variables in EditFlowSettings component
* use current flow not saved one and refactored page to not receive flow
* added check of isFlowPage to display the menubar
* Added checks to render playground if API key is valid and if Flows exists
* Added check to not display X on chat on playground page
* Updated flows variable to be undefined by start to prevent things from loading before flows initialize
* Implemented log builds parameter to not allow the builds to be logged if user not on flowPage
* feat: Gmail Loader component created
* [autofix.ci] apply automated fixes
* Updated Gmail.py
ran make format and ran make lint
* [autofix.ci] apply automated fixes
* Update Gmail.py
Errors Resolved.
Suggestion from @ogabrielluiz added.
Note this is a ChatLoader, since GmailLoader uses the BaseChatloader as base class.
But this would be a highly useful feature. if required i could rewrite the component as document loader. but either way this would be an amazing feature.
Planning to publish gmails tools also in next steps mostly.
* solved lint issues in Gmail.py
Key Changes:
1. Added Optional to the import statement.
2. Updated the type hint of label_ids to Optional[List[str]] to allow it to be None or a list of strings.
* remove commented
* remove commented
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Jordan Frazier <jordan.frazier@datastax.com>
* fix: update value type in DefaultPromptField from str to Any for increased flexibility in input handling
* fix: replace _instantiate_input with instantiate_input for consistency in input instantiation across the codebase
* chore: update test durations
* update memory chatbot
* enhancement: Update PythonCodeStructuredTool to create inputs automatically and accept global variables
* [autofix.ci] apply automated fixes
* feat: Create a tool to search using SearXNG
* [autofix.ci] apply automated fixes
* refactor: reorganize imports and type annotations in PythonCodeStructuredTool.py for clarity and consistency
* refactor: clean up imports and enhance type annotations in SearXNGTool.py for improved readability and type safety
* refactor: Improved PythonCodeStructuredTool to allow arguments to have any types
* refactor: Formatted and refactored SearXNGTool
* refactor: Allowed RunnableExecutor to stream output and changed its build method to asynchronous.
---------
Co-authored-by: Haseong Kim <dynaferkim@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
* feat: add error handling for Flow build
The code changes in `buildUtils.ts` add error handling for the Flow build process. It includes a new case for handling errors in the switch statement, which displays the error message and triggers the `onBuildError` function. This change ensures that errors during the Flow build are properly handled and the build process is stopped.
* feat: enhance error handling in build_flow to capture and report HTTP exceptions in the flow building process
* refactor: reorganize logger module and add setup.py for logging configuration
* refactor: update logger import path to align with recent module restructuring
* refactor: add logging configuration parameter to Graph initialization for improved logging setup flexibility
* feat: create logging init module for improved logger configuration and management
* refactor: update Settings class to include development mode flag and associated validator for enhanced configuration management
* refactor: enhance logger.py with DEV mode handling and TypedDict for log configuration settings
* feat: add settings module with DEV mode flag and helper functions for setting development state
* refactor: update flow assertions in tests to check for Data object type instead of Flow object type
* feat: add deepcopy method to Graph class to copy start and end components, ensuring proper graph cloning functionality
* feat: implement deepcopy method in Component class for proper cloning of inputs and configuration attributes
* feat: enhance attribute access in Component class to support backwards-compatible private attributes retrieval
* feat: improve test assertion for list_flows in custom component to display types of returned objects for better debugging
* feat: refactor imports in constants.py and remove redundant Data class definition for cleaner code structure
* feat: refactor imports in logger.py to include NotRequired from typing_extensions for better type hinting support
* feat: add diskcache package version 5.6.3 to poetry.lock and pyproject.toml for improved caching functionality
* refactor: simplify CacheMiss import in cache service files for better clarity and maintainability
* feat: Add AsyncDiskCache class for disk-based caching
* feat: Add disk caching option in CacheServiceFactory with AsyncDiskCache
* feat: Restrict cache_type to specific literals: async, redis, memory, disk for enhanced type safety and clarity
* feat: Change get_requester_result to async await for proper async handling in Vertex class
* fix: Update outputs dictionary in ResultData class to use key-value pairs for better readability and maintainability
* fix: Improve caching logic in Graph class by ensuring vertex builds properly handle exceptions and cache updates more reliably
* feat: Add teardown method to AsyncDiskCache for clearing cache directory during cleanup process
* fix: Correct variable name in Graph class to ensure proper handling of vertex results in caching logic
* feat: Clear AsyncDiskCache on initialization to align behavior with in-memory cache until frontend handling is implemented
feat: refactor sync_get_file_content_dicts to use get_file_content_dicts
Refactor the `sync_get_file_content_dicts` method in the `Message` class to use the `get_file_content_dicts` method instead. This change improves the code by using a more descriptive and accurate method name.
* fix: add task to end all traces on asyncio.CancelledError in build_flow function for better cleanup handling
* fix: replace ValueError with warnings in Graph class when vertices exist without edges for better logging and handling
* chore: add type annotations to test_vector_store_rag_add function
* feat: Fix assertion in test_create_flows to check for substring in name field
The assertion in the test_create_flows function was modified to check if the name field contains the substring "Flow 1" instead of an exact match. This change allows for more flexibility in the test and ensures that the test passes even if there are additional characters in the name field.
* feat: create google drive ingest component
It adds the basic implementation of the Google Drive Loader.
* feat: create google drive ingest component
Created a basic Google Drive loader component
* Updated the Icon
* updated the formatting
ran make format to update the formatting
* Addressed comments
* Updates and changes to the Makefile:
1. Added removal of `frontend` directory inside `src/backend/base/langflow/` and `build` directory inside `src/frontend/` to the `clean_npm_cache` target.
2. Added descriptive comments for the `build_and_install`, `build_and_run`, `fix_codespell`, `setup_poetry`, `unit_tests`, `integration_tests`, and `tests_frontend` targets.
Looking forward to your feedback.
* Improvements: Structure and Functionality Improvements
- Reorganized commands to facilitate understanding of the structure
- Enhanced check_tools to detect the Python version
- Added a multi-environment script to support check_tools
- make init now builds the frontend and runs the application
- Aesthetic improvements in output messages
TO-DO:
- Reorganize container-related commands
- Reorganize other miscellaneous utilities
- Document usage in the application docs
- Prepare the dev environment following the maintainers' recommended practices
* Removed pre-commit as it is no longer used.
* Restored 'patch' command in Makefile, it updates the 'pyproject.toml' with the new project version.
* fix: update PYTHON_REQUIRED extraction to correctly capture Python version
Changed the method of extracting the required Python version from `pyproject.toml`:
- Old method:
`PYTHON_REQUIRED=$(shell grep "^python" pyproject.toml | sed -n 's/.*"\(.*\)"$$/\1/p')`
- New method:
`PYTHON_REQUIRED=$(shell grep '^python[[:space:]]*=' pyproject.toml | sed -n 's/.*"\([^"]*\)".*/\1/p')`
The old method of capturing the Python version was too broad and could inadvertently match other dependencies starting with "python" (e.g., `python-socketio`, `python-dotenv`). This could lead to incorrect extraction of the required Python version, potentially causing version mismatches and failures in environment setup.
* fix: update PYTHON_REQUIRED extraction to correctly capture Python version
Changed the method of extracting the required Python version from `pyproject.toml`:
- Old method:
`PYTHON_REQUIRED=$(shell grep "^python" pyproject.toml | sed -n 's/.*"\(.*\)"$$/\1/p')`
- New method:
`PYTHON_REQUIRED=$(shell grep '^python[[:space:]]*=' pyproject.toml | sed -n 's/.*"\([^"]*\)".*/\1/p')`
The old method of capturing the Python version was too broad and could inadvertently match other dependencies starting with "python" (e.g., `python-socketio`, `python-dotenv`). This could lead to incorrect extraction of the required Python version, potentially causing version mismatches and failures in environment setup.
---------
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
* feat: update docker-build.yml to conditionally retrieve version and adjust tagging logic for Docker images in workflows
* Refactor release workflow to separate base and main package handling
- Split `release_package` input into `release_package_base` and `release_package_main`
- Add new inputs for building Docker images: `build_docker_base` and `build_docker_main`
- Update conditional checks and job dependencies to reflect new inputs
- Separate Docker build workflows for base and main packages
* Refactor release.yml to introduce separate inputs for base and main packages, enhancing workflow flexibility and clarity
* chore: update release.yml to set default pre-release option to false, reflecting new workflow strategy
* chore: add pre-release check to release.yml to validate version format before proceeding with the workflow
* chore: remove deprecated pre-release workflows, consolidating configuration for cleaner CI/CD process
* chore: modify pre-release check in release.yml to use poetry version for validation, enhancing version format accuracy
* chore: refine pre-release version check in release.yml for improved regex validation, ensuring accurate version detection
* fix: add LLM output for the AI ML component, using ChatOpenAI base model from langchain
* [autofix.ci] apply automated fixes
* fix: docs
* fix: unused variables
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* feat: Export needsLayout function for layout handling in reactflowUtils, enhancing node position verification
* feat(layoutUtils): Enhance ELK layout options for improved graph rendering and add debug logs for layout verification
* feat: Update PageComponent to fit view when viewport is at (0,0)
The PageComponent in the FlowPage now fits the view when the viewport is at (0,0). This improves the initial display of the page and enhances the user experience.
* feat(uploadFlow): Integrate processDataFromFlow to handle flows during upload, improving data processing efficiency
* feat(constants): Update NODE_WIDTH from 384 to 400 for improved component layout and consistency in the user interface
* refactor(layoutUtils): Remove debug console logs from getLayoutedNodes
* chore: Update dependencies in poetry files, adding grandalf 0.8.0 and upgrading several other packages to latest versions
* refactor: Add ASCII graph drawing functionality using grandalf library
* refactor: Improve Graph representation format and add ASCII visualization method to enhance readability and usability
* fix: add 'nowheel' class to Textarea component for enhanced user experience in textarea interactions
* refactor: replace Input with Textarea in TextAreaComponent for improved user experience and aesthetics
* refactor: Update TextAreaComponent to dynamically adjust the number of rows based on the content length for improved user experience
* [autofix.ci] apply automated fixes
---------
Co-authored-by: anovazzi1 <otavio2204@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* feat(utils.py): add escape_json_dump function to escape JSON strings for Edge dictionaries
* refactor(Output): streamline add_types method to prevent duplicate entries in types list for improved type management
* feat(data.py): add classmethod decorator to validate_data for enhanced validation logic when checking data types
* feat(setup.py): implement retry logic for loading starter projects to enhance robustness against JSON decode errors
* fix(input_mixin.py): improve model_config formatting and update field_type alias for clarity and consistency in field definitions
* feat(types.py): refactor vertex constructors to use NodeData and add input/output methods for better component interaction
* feat(schema.py): add NodeData and Position TypedDicts for improved type safety and structure in vertex data handling
* feat(base.py): update Vertex to use NodeData type and add to_data method for better data management and access
* refactor(schema.py): update TargetHandle and SourceHandle models to include model_config attribute
* Add TypedDict classes for graph schema serialization in `schema.py`
* Refactor `Edge` class to improve handle validation and data handling
- Consolidated imports and removed redundant `BaseModel` definitions for `SourceHandle` and `TargetHandle`.
- Added `valid_handles`, `target_param`, and `_target_handle` attributes to `Edge` class.
- Enhanced handle validation logic to distinguish between dictionary and string types.
- Introduced `to_data` method to return edge data.
- Updated attribute names to follow consistent naming conventions (`base_classes`, `input_types`, `field_name`).
* Refactor `Edge` class to improve handle validation and data handling
* Refactor: Standardize attribute naming and add `to_data` method in Edge class
- Renamed attributes to use snake_case consistently (`baseClasses` to `base_classes`, `inputTypes` to `input_types`, `fieldName` to `field_name`).
- Added `to_data` method to return `_data` attribute.
- Updated validation methods to use new attribute names.
* Refactor: Update Edge class to consistently use snake_case for attributes and improve validation logic for handles
* Refactor: Change node argument type in add_node and _create_vertex methods to NodeData for better type safety and clarity
* Refactor: Implement JSON serialization for graph data with `dumps` and `dump` methods, enhancing data export capabilities
* Refactor: Add pytest fixtures for ingestion and RAG graphs, enhance test structure for better clarity and organization
* Refactor: Add pytest fixtures for memory_chatbot_graph tests and improve test structure
* Refactor: Remove unused methods in ComponentVertex class to streamline code and improve readability
* Refactor: Remove unnecessary line in ComponentVertex class to enhance code clarity and maintainability
* refactor: Add utility functions for getting handle IDs in CustomNodes
- Added `getRightHandleId` function to generate the right handle ID for source handles.
- Added `getLeftHandleId` function to generate the left handle ID for target handles.
- These functions improve code readability and maintainability by encapsulating the logic for generating handle IDs.
* refactor: Add type for escaped handle IDs in edges to improve type safety in reactflowUtils
* feat: Add function to escape handle IDs in edges, enhancing edge management in reactflowUtils
* feat: Add function to check edges without escaped handle IDs, improving edge validation in reactflowUtils
* feat: Enhance edge processing in reactflowUtils to handle edges without escaped handle IDs more effectively
* feat: Add layoutUtils module for handling node layout using elkjs
* feat: update processDataFromFlow to add layout to nodes if needed
* feat: Update flowsManagerStore to parse flow data from file before processing
- Replace usages of `fileData` with `parsedFlowData` for improved clarity
- Ensure compatibility with newProject and isComponent parameters
- Improve error handling for uploading components as flows or vice versa
- Refactor code for better readability and maintainability
* Refactor import paths to use 'initialize' module in 'base.py'
* feat: Add method to set class source code and integrate it with frontend node input field
* refactor: Update sourceHandle dataType to use custom component class name
* fix: Raise error for unknown vertex types instead of returning default Vertex class
* refactor: Remove redundant call to _import_vertex_types() in VertexTypesDict initialization
* refactor: Simplify add_code_field by removing unnecessary field_config parameter from function signature
* feat: Add elkjs dependency to package.json and package-lock.json for enhanced functionality in the frontend
* refactor: Update fields type in Template class to use InputTypes for improved type safety
* refactor: Update import path for DefaultPromptField to improve code organization and maintain compatibility
* refactor: Reorganize imports in __init__.py for better structure and consistency across the inputs module
* refactor: Clean up imports in types.py for better organization and consistency in the graph vertex module
* refactor: Change vertex type annotations to strings for better compatibility and consistency in the graph module methods
* refactor: Update component instantiation to include _code parameter and fix input type annotations for improved type handling
* refactor: Remove unused CustomComponent import from __init__.py for cleaner module structure and improved organization
* refactor: Modify custom_component instantiation to include _code argument for enhanced functionality and clarity in CodeParser class
* refactor: Update CustomComponent import in __init__.py for improved module structure and organization
* refactor: Update launch.json to include correct path for backend source files
* refactor: Update dependencies in poetry.lock to latest versions and resolve merge conflicts in backend files
* [autofix.ci] apply automated fixes
* refactor: Remove unnecessary line in test_memory_chatbot.py
* refactor: Update dataType assignment in Component class to use component name if available, or fallback to class name
* refactor: Correct flow_id reference in MemoryComponent to improve clarity and consistency in memory handling
* refactor: Update import path for DefaultPromptField to improve code organization and maintainability in api_utils.py
* refactor: Add loading module to __init__.py for improved organization of interface package
* refactor: Clean up imports in base.py and enforce edge validation in Graph class for improved maintainability and error handling
* refactor: Remove edge component additions in test_base.py to streamline graph tests and emphasize error handling for unprepared graphs
* refactor: Mark @clack/prompts is-unicode-supported as extraneous in package-lock.json for better dependency management
* refactor: Update dataType assignment in Component class to use component name if available, or fallback to class name
* refactor: Fix edge existence check in Graph class to use correct variable, ensuring accurate validation of graph structure
* refactor: Add test for graph with edge and improve graph preparation logic
* refactor: Set default node type to "genericNode" in getLayoutedNodes for consistent layout structure
* create consts for node widht and height
* refactor: Catch and log errors when processing flow data in flowsManagerStore and reactflowUtils
* [autofix.ci] apply automated fixes
* fix: Validate custom components for source and target vertices in Graph edges
* test: Add fixture for client and raise TypeError for invalid class parsing in CodeParser tests
* test: Add unit test for listing flows as Flow objects in custom component with client
* test: Update assertions for memory chatbot component types in unit tests
* test: Refactor assertions to use updated component names in vector store RAG unit tests
* fix: Change error handling to return default Vertex for unknown node types in graph class
* [autofix.ci] apply automated fixes
* test: Add pytest fixture for CustomComponent in unit tests to enhance test structure and readability
* chore: Update component names in vector store RAG unit tests
* test: Refactor imports and make flow name generation unique in database unit tests
* chore: Add new attributes to Edge class for improved state management and validation in edge processing logic
* chore: Implement addition methods for Graph class to combine vertices and edges from other graph instances safely
* chore: Extend serialization in Graph class to include additional internal attributes for improved state handling
* chore: Call initialize method in prepare for proper setup before validating component IDs in Graph class
* chore: Add test to validate graph combination in vector store RAG, ensuring correct vertices and edges in merged graph structure
* refactor: Add utility functions for getting handle IDs in CustomNodes
- Added `getRightHandleId` function to generate the right handle ID for source handles.
- Added `getLeftHandleId` function to generate the left handle ID for target handles.
- These functions improve code readability and maintainability by encapsulating the logic for generating handle IDs.
* refactor: Add type for escaped handle IDs in edges to improve type safety in reactflowUtils
* feat: Add function to escape handle IDs in edges, enhancing edge management in reactflowUtils
* feat: Add function to check edges without escaped handle IDs, improving edge validation in reactflowUtils
* feat: Enhance edge processing in reactflowUtils to handle edges without escaped handle IDs more effectively
* feat: Add layoutUtils module for handling node layout using elkjs
* feat: update processDataFromFlow to add layout to nodes if needed
* Refactor import paths to use 'initialize' module in 'base.py'
* feat: Add method to set class source code and integrate it with frontend node input field
* refactor: Update sourceHandle dataType to use custom component class name
* fix: Raise error for unknown vertex types instead of returning default Vertex class
* refactor: Remove redundant call to _import_vertex_types() in VertexTypesDict initialization
* refactor: Simplify add_code_field by removing unnecessary field_config parameter from function signature
* feat: Add elkjs dependency to package.json and package-lock.json for enhanced functionality in the frontend
* refactor: Update fields type in Template class to use InputTypes for improved type safety
* refactor: Reorganize imports in __init__.py for better structure and consistency across the inputs module
* refactor: Clean up imports in types.py for better organization and consistency in the graph vertex module
* refactor: Change vertex type annotations to strings for better compatibility and consistency in the graph module methods
* refactor: Update component instantiation to include _code parameter and fix input type annotations for improved type handling
* refactor: Remove unused CustomComponent import from __init__.py for cleaner module structure and improved organization
* refactor: Modify custom_component instantiation to include _code argument for enhanced functionality and clarity in CodeParser class
* refactor: Update CustomComponent import in __init__.py for improved module structure and organization
* refactor: Update launch.json to include correct path for backend source files
* refactor: Update dependencies in poetry.lock to latest versions and resolve merge conflicts in backend files
* refactor: Update dataType assignment in Component class to use component name if available, or fallback to class name
* refactor: Correct flow_id reference in MemoryComponent to improve clarity and consistency in memory handling
* refactor: Update import path for DefaultPromptField to improve code organization and maintainability in api_utils.py
* refactor: Add loading module to __init__.py for improved organization of interface package
* refactor: Clean up imports in base.py and enforce edge validation in Graph class for improved maintainability and error handling
* refactor: Remove edge component additions in test_base.py to streamline graph tests and emphasize error handling for unprepared graphs
* refactor: Mark @clack/prompts is-unicode-supported as extraneous in package-lock.json for better dependency management
* refactor: Update dataType assignment in Component class to use component name if available, or fallback to class name
* refactor: Fix edge existence check in Graph class to use correct variable, ensuring accurate validation of graph structure
* refactor: Add test for graph with edge and improve graph preparation logic
* refactor: Set default node type to "genericNode" in getLayoutedNodes for consistent layout structure
* create consts for node widht and height
* refactor: Catch and log errors when processing flow data in flowsManagerStore and reactflowUtils
* [autofix.ci] apply automated fixes
* fix: Validate custom components for source and target vertices in Graph edges
* test: Add fixture for client and raise TypeError for invalid class parsing in CodeParser tests
* test: Add unit test for listing flows as Flow objects in custom component with client
* test: Update assertions for memory chatbot component types in unit tests
* test: Refactor assertions to use updated component names in vector store RAG unit tests
* fix: Change error handling to return default Vertex for unknown node types in graph class
* [autofix.ci] apply automated fixes
* test: Add pytest fixture for CustomComponent in unit tests to enhance test structure and readability
* chore: Update component names in vector store RAG unit tests
* test: Refactor imports and make flow name generation unique in database unit tests
* chore: Remove unused upload and flow management functions from flowsManagerStore for cleaner codebase
* chore: Await processDataFromFlow in useAddFlow hook
* chore: Correct NODE_HEIGHT calculation to use NODE_WIDTH constant for consistency in constants file
* chore: Remove extraneous flag for is-unicode-supported in package-lock.json for cleaner dependency management
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: anovazzi1 <otavio2204@gmail.com>
* refactor: create NodeOutputField component in GenericNode
* feat: update isUserChange parameter in setNode function
The `isUserChange` parameter in the `setNode` function of the `FlowStoreType` interface has been updated to be optional. This change improves the flexibility and usability of the function.
* feat: Add NodeInputField component to GenericNode
The NodeInputField component has been added to the GenericNode component. This component is responsible for rendering input fields for nodes in the UI. It improves the functionality and user experience of the GenericNode component.
* delete parameter component
* [autofix.ci] apply automated fixes
* feat: Refactor NodeOutputField component in GenericNode
The NodeOutputField component in the GenericNode component has been refactored to improve code organization and maintainability. This refactor enhances the functionality and user experience of the GenericNode component.
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* feat: suggest updating outdated components in API exception handling
Suggest updating the outdated components in the API exception handling. This commit adds a suggestion message to the API exception response when there are outdated components in the flow. The suggestion message provides the number of outdated components and recommends updating them. The suggestion is generated based on the list of outdated components obtained from the flow data.
* feat: refactor code
* [autofix.ci] apply automated fixes
* Update src/backend/base/langflow/exceptions/api.py
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
* Update src/backend/base/langflow/api/utils.py
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
* Update src/backend/base/langflow/exceptions/api.py
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
* update function name
* [autofix.ci] apply automated fixes
* refactor: fix import casing in langflow.api.utils and langflow.exceptions.api
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
* refactor: remove unused code and update exception handling in langflow.api.utils and langflow.exceptions.api
* [autofix.ci] apply automated fixes
* refactor: update exception handling and class in langflow.api.utils and langflow.exceptions.api
* [autofix.ci] apply automated fixes
* update function name and refactor none flow logic
* [autofix.ci] apply automated fixes
* refactor: fix typo in get_suggestion_message function name
* refactor: improve get_suggestion_message function in langflow.api.utils
* refactor: add unit tests for get_suggestion_message and get_outdated_components functions
* refactor: add unit tests for APIException in langflow.exceptions.api
* refactor: improve test coverage for APIException and related functions
* [autofix.ci] apply automated fixes
* update file name
* refactor: update build_exception_body method in APIException to handle Exception type
* refactor: handle None flow data in get_components_versions
* [autofix.ci] apply automated fixes
* refactor: update useDeleteBuilds function signature in _builds API query
* fix: Fix test changing screen before request ended
---------
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: Add utility functions for getting handle IDs in CustomNodes
- Added `getRightHandleId` function to generate the right handle ID for source handles.
- Added `getLeftHandleId` function to generate the left handle ID for target handles.
- These functions improve code readability and maintainability by encapsulating the logic for generating handle IDs.
* refactor: Add type for escaped handle IDs in edges to improve type safety in reactflowUtils
* feat: Add function to escape handle IDs in edges, enhancing edge management in reactflowUtils
* feat: Add function to check edges without escaped handle IDs, improving edge validation in reactflowUtils
* feat: Enhance edge processing in reactflowUtils to handle edges without escaped handle IDs more effectively
* feat: Add layoutUtils module for handling node layout using elkjs
* feat: update processDataFromFlow to add layout to nodes if needed
* Refactor import paths to use 'initialize' module in 'base.py'
* feat: Add method to set class source code and integrate it with frontend node input field
* refactor: Update sourceHandle dataType to use custom component class name
* fix: Raise error for unknown vertex types instead of returning default Vertex class
* refactor: Remove redundant call to _import_vertex_types() in VertexTypesDict initialization
* refactor: Simplify add_code_field by removing unnecessary field_config parameter from function signature
* feat: Add elkjs dependency to package.json and package-lock.json for enhanced functionality in the frontend
* refactor: Update fields type in Template class to use InputTypes for improved type safety
* refactor: Reorganize imports in __init__.py for better structure and consistency across the inputs module
* refactor: Clean up imports in types.py for better organization and consistency in the graph vertex module
* refactor: Change vertex type annotations to strings for better compatibility and consistency in the graph module methods
* refactor: Update component instantiation to include _code parameter and fix input type annotations for improved type handling
* refactor: Remove unused CustomComponent import from __init__.py for cleaner module structure and improved organization
* refactor: Modify custom_component instantiation to include _code argument for enhanced functionality and clarity in CodeParser class
* refactor: Update CustomComponent import in __init__.py for improved module structure and organization
* refactor: Update launch.json to include correct path for backend source files
* refactor: Update dependencies in poetry.lock to latest versions and resolve merge conflicts in backend files
* refactor: Update dataType assignment in Component class to use component name if available, or fallback to class name
* refactor: Correct flow_id reference in MemoryComponent to improve clarity and consistency in memory handling
* refactor: Update import path for DefaultPromptField to improve code organization and maintainability in api_utils.py
* refactor: Add loading module to __init__.py for improved organization of interface package
* refactor: Clean up imports in base.py and enforce edge validation in Graph class for improved maintainability and error handling
* refactor: Remove edge component additions in test_base.py to streamline graph tests and emphasize error handling for unprepared graphs
* refactor: Mark @clack/prompts is-unicode-supported as extraneous in package-lock.json for better dependency management
* refactor: Update dataType assignment in Component class to use component name if available, or fallback to class name
* refactor: Fix edge existence check in Graph class to use correct variable, ensuring accurate validation of graph structure
* refactor: Add test for graph with edge and improve graph preparation logic
* refactor: Set default node type to "genericNode" in getLayoutedNodes for consistent layout structure
* create consts for node widht and height
* refactor: Catch and log errors when processing flow data in flowsManagerStore and reactflowUtils
* [autofix.ci] apply automated fixes
* fix: Validate custom components for source and target vertices in Graph edges
* test: Add fixture for client and raise TypeError for invalid class parsing in CodeParser tests
* test: Add unit test for listing flows as Flow objects in custom component with client
* test: Update assertions for memory chatbot component types in unit tests
* test: Refactor assertions to use updated component names in vector store RAG unit tests
* fix: Change error handling to return default Vertex for unknown node types in graph class
* [autofix.ci] apply automated fixes
* test: Add pytest fixture for CustomComponent in unit tests to enhance test structure and readability
* chore: Update component names in vector store RAG unit tests
* test: Refactor imports and make flow name generation unique in database unit tests
* chore: Remove unused upload and flow management functions from flowsManagerStore for cleaner codebase
* chore: Await processDataFromFlow in useAddFlow hook
* chore: Correct NODE_HEIGHT calculation to use NODE_WIDTH constant for consistency in constants file
* chore: Remove extraneous flag for is-unicode-supported in package-lock.json for cleaner dependency management
---------
Co-authored-by: anovazzi1 <otavio2204@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* refactor: handle Data type in Vertex class
The code changes in `base.py` modify the `Vertex` class to handle the `Data` type. Specifically, it adds a condition to check if the value is an instance of `Data` and then unescapes the string using `val.get_text()`. This change improves the functionality and data management in the `Vertex` class.
* fix: skip artifacts without text in ComponentVertex processing
Added a check to continue if the message_dict does not have a "text" field in the ComponentVertex class
* fix: retrieve flow_name from attributes in SubFlowComponent
Updated SubFlowComponent to ensure flow_name is fetched correctly from attributes before execution
* fix: validate flow_name presence in RunFlowComponent before execution
Added a conditional check to ensure flow_name is provided in attributes
* fix: validate flow_name presence in FlowToolComponent before retrieving flow data
Added check to ensure flow_name is provided in attributes
* Removed unused function and fixed tags initial value
* Added post save flow
* Added update flow patch
* removed unused import
* created useAddFlow hook to substitute AddFlow function on flowsManager store
* fixed post save flow to handle endpoint name as undefined
* Fixed add flow hook to use post save flow mutation
* removed unused line
* changed addFlow to use hook in all components that use addFlow
* Removed unused code
* removed addFlow of useDuplicateFlows call
* made newProject default as true
* removed unused variables from addFlow
* fixed url of requests of flows
* passed functions directly
* fix app to display loading on top of the router
* fixed promise of addFlow
* Added upload flow hook with a lot of modularity
* Fixed addFlow naming
* Added helper functions for file uploading
* Changed upload flow to use helper functions
* removed refresh on post
* changed paste function to handle when chatinput node exists on paste
* Used helper function to create input on FileInput
* Used helper function to create input on InputFileComponent
* Used helper function to create input on folder upload, and used uploadFlow hook
* used uploadFlow hook on dropdown options
* used addFlow instead of addComponent on node toolbar
* changed upload flow on headerComponent to use hook
* Changed pageComponent to use uploadFlow hook
* removed useFileDrop dependency
* Fixed onFileDrop to use uploadFlow
* removed useDropdown dependency
* removed unused add and upload functions from flowsManagerStore
* Clean flows and refetch when flow change, added loader when is fetching
* change name of delete flows api
* created useDeleteFlow hook
* used delete flow on useAddFlow
* Used useDeleteFlow hook in places that used removeFlow and deleteComponent
* deleted useDeleteMultiple hook
* removed removeFlows and deleteComponent functions of flowsManagerStore
* Deleted API flows delete call from API file
* Removed unused function and fixed tags initial value
* Added post save flow
* Added update flow patch
* removed unused import
* created useAddFlow hook to substitute AddFlow function on flowsManager store
* fixed post save flow to handle endpoint name as undefined
* Fixed add flow hook to use post save flow mutation
* removed unused line
* changed addFlow to use hook in all components that use addFlow
* Removed unused code
* removed addFlow of useDuplicateFlows call
* made newProject default as true
* removed unused variables from addFlow
* fixed url of requests of flows
* passed functions directly
* fix app to display loading on top of the router
* fixed promise of addFlow
* Added upload flow hook with a lot of modularity
* Fixed addFlow naming
* Added helper functions for file uploading
* Changed upload flow to use helper functions
* removed refresh on post
* changed paste function to handle when chatinput node exists on paste
* Used helper function to create input on FileInput
* Used helper function to create input on InputFileComponent
* Used helper function to create input on folder upload, and used uploadFlow hook
* used uploadFlow hook on dropdown options
* used addFlow instead of addComponent on node toolbar
* changed upload flow on headerComponent to use hook
* Changed pageComponent to use uploadFlow hook
* removed useFileDrop dependency
* Fixed onFileDrop to use uploadFlow
* removed useDropdown dependency
* removed unused add and upload functions from flowsManagerStore
* Clean flows and refetch when flow change, added loader when is fetching
* Changed loading to the useQuery isPending
* changed post to add flow
* fixed error when uploading other thing that is not a JSON not appearing
* changed useAddFlow to handle empty params too
* Fixed loading every time we switch tabs
* Fixed unnecessary list and !
* Fixed reference bug
* Inserted cloneDeep to prevent reference bugs
* Fixed tests of drag and drop
* Fixed flows not being refreshed when uploading
* [autofix.ci] apply automated fixes
* fixed folders test
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>