* ✨ (tests): update tag value from "@starter-project" to "@starter-projects" for consistency across test files.
* 📝 (changes-filter.yaml): add new path "src/backend/base/langflow/custom/**" to starter-projects section
♻️ (changes-filter.yaml): remove path "src/backend/base/langflow/components/**" from components section and add it to starter-projects section
♻️ (changes-filter.yaml): add new path "src/backend/base/langflow/custom/**" to components section
* 🐛 (component.py): fix a bug where the status was not being returned when there is only one output in the component
* 🔧 (ci.yml): Expand path filter outputs for more comprehensive CI testing
* fix docstring placement
* ✨ (group.spec.ts): update click event modifiers to use "ControlOrMeta" for better cross-platform compatibility
* ✨ (changes-filter.yaml): add new directory "src/backend/base/langflow/graph/" to starter-projects for processing in the build pipeline.
* 🔄 Refactor graph data structures from sets to lists for performance and compatibility
* 🔧 Optimize RunnableVerticesManager predecessor checks and type hints
---------
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
* feat: add is_loop property to Vertex class for detecting looping outputs
* feat: improve vertex runnability logic for graph traversal
- Update `is_vertex_runnable` to handle loop vertices more robustly
- Modify `are_all_predecessors_fulfilled` to better manage cycle dependencies
- Change adjacency maps to use sets for more efficient predecessor/successor tracking
* ⚡️ Speed up method `Graph.find_runnable_predecessors_for_successor` by 129% in PR #6309 (`fix-order-loop`)
Here's the optimized version of the program.
### Changes and Optimizations.
* fix(serialization.py): update isinstance check for list and tuple to use union operator for better type checking
---------
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: codeflash-ai[bot] <148906541+codeflash-ai[bot]@users.noreply.github.com>
* chore: Update Pillow and Pandas dependencies to latest patch versions
* chore: Update NVIDIA AI Endpoints and Pillow dependencies
* feat: Add smolagents dependency to project requirements
* feat: Add HuggingFace model bridge for LangChain integration
Implement a model bridge that allows seamless conversion between LangChain and HuggingFace model interfaces, supporting message and tool call translations
* docs: Update usage example in LangChainHFModel to improve clarity
* fix: update smolagents dependency version to 1.8.0
---------
Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
* feat: add is_loop property to Vertex class for detecting looping outputs
* feat: improve vertex runnability logic for graph traversal
- Update `is_vertex_runnable` to handle loop vertices more robustly
- Modify `are_all_predecessors_fulfilled` to better manage cycle dependencies
- Change adjacency maps to use sets for more efficient predecessor/successor tracking
* refactor: change graph adjacency maps from lists to sets for improved performance
- Update graph data structures to use sets instead of lists for predecessor, successor, and parent-child maps
- Modify type hints and method signatures to reflect the change from list to set
- Improve graph traversal and vertex tracking efficiency by using set operations
⚡️ Speed up function `_truncate_value` by 45% in PR #6323 (`test-smol`)
To optimize the Python program for faster performance, we should make a few adjustments. Specifically, the use of multiple `isinstance` checks and logical conditioning can be streamlined to reduce the runtime overhead. Here's the optimized version of the program.
### Explanation.
1. **Order and Conditions**: We adjusted the order to check the limit first. This way, we only perform the `isinstance` check if the limit is set, thereby potentially reducing the number of checks needed.
2. **Combined Types**: Instead of using `isinstance(value, list | tuple)`, which uses the `|` operator for a union type, we use the more traditional tuple form `isinstance(value, (list, tuple))`. This makes it explicit that we’re checking against multiple types and can be a bit faster.
These changes should result in slight performance improvements by reducing the number of checks and short-circuiting earlier.
Co-authored-by: codeflash-ai[bot] <148906541+codeflash-ai[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
* 📝 (faiss.py): import Path and List modules for better type hinting and file path handling
🐛 (faiss.py): fix issue with building vector store when persist_directory is not provided
🐛 (faiss.py): fix issue with loading FAISS index when index file does not exist
📝 (faiss.py): add type hints for search_documents method parameters and return value
📝 (faiss.py): remove unnecessary logging statements from search_documents method
* [autofix.ci] apply automated fixes
* 📝 (faiss.py): add 'required' flag to the 'Persist Directory' input field to ensure it is mandatory for the user to provide a value
* 🔧 (faiss.py): refactor build_vector_store method to handle persist_directory more efficiently
🔧 (faiss.py): refactor search_documents method to handle persist_directory more efficiently
* [autofix.ci] apply automated fixes
* 🔧 (faiss.py): refactor get_persist_directory method to return resolved persist directory path or current directory if not set
♻️ (faiss.py): refactor build_vector_store and search_documents methods to use get_persist_directory method for path resolution
* ♻️ (faiss.py): refactor resolve_path method to be static and return a string instead of Path object for consistency and clarity
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* 📝 (youtube_transcripts.py): update description of YouTubeTranscriptsComponent to be more concise and accurate
✨ (youtube_transcripts.py): add new output option 'data_output' to provide transcript along with the source video URL
🔧 (youtube_transcripts.py): add method 'get_data_output' to handle the new 'data_output' output option and return a Data object with transcript, video URL, and error message
* [autofix.ci] apply automated fixes
* 📝 (youtube_transcripts.py): improve documentation for get_data_output method to provide a clear description of the returned data object and its contents
🐛 (youtube_transcripts.py): handle specific exceptions from the youtube_transcript_api library to provide more informative error messages and improve error handling in the get_data_output method
* [autofix.ci] apply automated fixes
* 🐛 (youtube_transcripts.py): handle case where no transcripts are found by updating the error message and returning a default data object
🔧 (youtube_transcripts.py): refactor get_data_output method to use a default data object and combine all transcript parts into a single continuous text
* [autofix.ci] apply automated fixes
* ✨ (test_youtube_transcript_component.py): Add unit tests for YouTubeTranscriptsComponent to test various functionalities such as component initialization, output generation, error handling, and setting translation languages.
* [autofix.ci] apply automated fixes
* ✅ (test_youtube_transcript_component.py): update file_names_mapping fixture to return a non-empty list to properly test different versions of file names mapping in the YouTube transcripts component
* [autofix.ci] apply automated fixes
* 📝 (test_youtube_transcript_component.py): Add docstrings and improve variable names for better readability and maintainability
🔧 (test_youtube_transcript_component.py): Refactor error handling in test methods to use descriptive error messages and improve code readability
* [autofix.ci] apply automated fixes
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* ✨ (mistral.py): Add new input parameters to MistralAIModelComponent for better customization and control over the Mistral model configuration
♻️ (mistral.py): Refactor build_model method to improve readability and maintainability by using try-except block for error handling and updating parameter names for better clarity
* [autofix.ci] apply automated fixes
* ♻️ (mistral.py): refactor MistralAIModelComponent class to improve code readability by formatting the IntInput and BoolInput sections for better organization and clarity.
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
🔧 (switchOutputView/index.tsx): Fix issue with accessing nested properties in flowPoolNode data object
🔧 (switchOutputView/index.tsx): Fix issue with accessing nested properties in resultMessage object
🔧 (chat-message.tsx): add isBuilding variable to track if the chat message is being built to improve user experience
Co-authored-by: anovazzi1 <otavio2204@gmail.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
* 🔧 (frontend): remove unused lockChat and setLockChat props from ChatViewWrapper and ChatView components
♻️ (frontend): refactor ChatMessage component to use useFlowStore for lockChat state management instead of passing it as a prop
* 🔧 (chat-message.tsx): Remove unused variables setLockChat and lockChat
♻️ (chat-message.tsx): Refactor code to use isBuilding state instead of setLockChat and lockChat variables
♻️ (new-modal.tsx): Refactor code to remove setLockChat function and references
♻️ (flowStore.ts): Refactor code to remove setLockChat function and lockChat variable
♻️ (components/index.ts): Refactor code to remove setLockChat function and lockChat variable
♻️ (flow/index.ts): Refactor code to remove setLockChat function and lockChat variable
♻️ (buildUtils.ts): Refactor code to remove setLockChat function and references
* ♻️ (chat-view.tsx): refactor variable name 'lockChat' to 'isBuilding' for better clarity and semantics in the code.
* 🔧 (chat-view.tsx, chat-input.tsx, button-send-wrapper.tsx, text-area-wrapper.tsx, upload-file-button.tsx, use-focus-unlock.ts, use-upload.ts, chat-message.tsx, index.ts): Remove lockChat variable and replace it with isBuilding variable to improve code readability and consistency.
* ♻️ (button-send-wrapper.tsx): remove unnecessary disabled prop from Button component to improve code readability and maintainability
fix: Case-insensitive file extension validation in BaseFileComponent
Modify file extension validation to use lowercase comparison, ensuring consistent handling of file extensions across different input cases
⚡️ Speed up function `find_all_cycle_edges` by 17%
Here is the optimized version of the given program. The major optimization here is to avoid unnecessary list concatenations in the DFS recursion by using a more efficient approach for aggregating cycle edges.
Co-authored-by: codeflash-ai[bot] <148906541+codeflash-ai[bot]@users.noreply.github.com>
* ⚡️ Speed up function `update_target_handle` by 27%
Sure, here are the optimized versions of the given functions. The key optimizations include avoiding redundant dictionary lookups, removing unnecessary condition checks, and simplifying the logic where possible.
* lint fix
* Apply suggestions from code review
Co-authored-by: Christophe Bornet <cbornet@hotmail.com>
---------
Co-authored-by: codeflash-ai[bot] <148906541+codeflash-ai[bot]@users.noreply.github.com>
Co-authored-by: Christophe Bornet <cbornet@hotmail.com>
* fix: Improve variable decryption error handling in DatabaseVariableService
Add robust error handling for variable decryption, logging decryption failures and falling back to the original value for generic type variables
* chore: Bump version to 1.1.4.post1 for langflow and 0.1.4.post1 for langflow-base
* feat: Add CustomLoader component and integrate with loading states in Admin, Flow, and Main pages
* refactor: simplify CustomLoader component and remove conditional loading logic
* feat: add configurable size to CustomLoader component
* ✨ (processing): Rename MergeDataComponent to CombineDataComponent for better clarity and consistency in naming conventions. Add CombineDataComponent to handle different data combination operations like concatenation, appending, merging, and joining.
* [autofix.ci] apply automated fixes
* ♻️ (combine_data.py): refactor class name from CombineDataComponent to MergeDataComponent for better clarity and consistency with the operation performed
* ✨ (processing): Rename CombineDataComponent to MergeDataComponent for better clarity and consistency
📝 (processing): Add new MergeDataComponent to combine data using different operations like Concatenate, Append, Merge, and Join
* ♻️ (processing/__init__.py): refactor CombineDataComponent to MergeDataComponent for better naming consistency and clarity
* ✨ (processing/__init__.py): rename merge_data module to combine_text for better clarity and consistency
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
* 📝 (firecrawl_crawl_api.py): update StrInput to MultilineInput for better handling of URL input
📝 (firecrawl_scrape_api.py): update StrInput to MultilineInput for better handling of URL input
* [autofix.ci] apply automated fixes
* ✨ (firecrawl_crawl_api.py): introduce StrInput class to langflow.io module for handling string inputs in the API
* [autofix.ci] apply automated fixes
* ✨ (changes-filter.yaml): add new directories to components list for langflow schema and utils to be included in changes filtering
* ✨ (changes-filter.yaml): add new directory "src/backend/base/langflow/graph/" to components list for changes filtering in the workspace.
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
* ✨ (reactflowUtils.ts): add new function filterHiddenFieldsEdges to filter out edges based on hidden fields in node templates
* ♻️ (reactflowUtils.ts): refactor filterHiddenFieldsEdges function to accept targetNode directly instead of nodes array to improve code readability and maintainability
* 🐛 (reactflowUtils.ts): fix a bug where nodeInputType is accessed without null check, causing potential runtime error
---------
Co-authored-by: anovazzi1 <otavio2204@gmail.com>
* 📝 (vertex_types.py): improve default value assignment logic based on edge type for ComponentVertex class
* [autofix.ci] apply automated fixes
* 📝 (schema.py): remove TextInput from INPUT_COMPONENTS list as it is no longer used
♻️ (vertex_types.py): refactor default_value assignment logic for ComponentVertex class to improve readability and maintainability
* ✨ (schema.py): introduce new TextInput component to the list of INPUT_COMPONENTS for the graph schema
* 📝 (vertex_types.py): improve default value assignment logic based on edge type for ComponentVertex class
* [autofix.ci] apply automated fixes
* 🐛 (utils.py): fix layered topological sort to prevent TextInput from being incorrectly placed at the start
* ♻️ (vertex_types.py): Remove unnecessary comment about getting default value based on edge type to improve code readability and maintainability.
* 🐛 (vertex_types.py): simplify default value assignment logic for cycle edges
---------
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: FIrst pass at file management API
* [autofix.ci] apply automated fixes
* Add delete and edit endpoints
* [autofix.ci] apply automated fixes
* Add file size and duplicate name handling
* Ensure the File model has a unique name
* Ensure count is before extension
* [autofix.ci] apply automated fixes
* Add the correct path to the return
* Added function to handle list of paths in File component
* [autofix.ci] apply automated fixes
* Update input_mixin.py
* Refactor to a v2 endpoint
* Add unit tests
* Update test_files.py
* Update frontend.ts
* [autofix.ci] apply automated fixes
* Remove extension from name
* Cast the string type for like
* Update files.py
* Update base.py
* Update base.py
---------
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Lucas Oliveira <lucas.edu.oli@hotmail.com>