Commit graph

14,823 commits

Author SHA1 Message Date
Cristhian Zanforlin Lousa
c227a9b58d
refactor: update GlobalVariableModal description text (#5405)
📝 (GlobalVariableModal.tsx): update description text to remove incorrect information about encryption for better clarity
2024-12-23 18:55:43 +00:00
Lucas Oliveira
1daf915169
fix: add data field to returned object on flowheader if flow is a component (#5373)
* Fixed FlowHeader model validator, adding data and removing it if flow is not a component

* [autofix.ci] apply automated fixes

* Fixed flowheader to use fieldvalidator instead of modelvalidator

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-12-23 18:54:40 +00:00
Christophe Bornet
9fc3601df8
fix: Fix parallel execution of alembic with PostgreSQL (#5408)
Fix parallel execution of alembic with PostgreSQL
2024-12-23 18:53:07 +00:00
Christophe Bornet
b1536d3cb4
feat: Bump blockbuster version to 1.5.7 (#5406)
Bump blockbuster version to 1.5.7
2024-12-23 15:57:41 +00:00
Mendon Kissling
2c819dc0a4
Docs: refactor starter flows (#5384)
* refactor: Update documentation links and restructure starter projects to use cases

* feat: Add new redirects for use cases in Docusaurus configuration

* lint

* force-menu-collapse

* change-usecase-to-tutorial
2024-12-23 14:53:37 +00:00
Jordan Frazier
b2e7476d3b
fix: add initial setup validations (#5385)
* convert flow ids to uuids when loading from dir

* Edit a migration file to check for foreign key existence

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-12-21 00:23:21 +00:00
Mendon Kissling
a2690236ea
Docs: components updates (#5315)
* docs: enhance agent components documentation for clarity and detail

* docs: expand tools documentation to clarify agent-tool interactions and usage

* docs: clarify installation instructions in README

* tools

* custom-components

* docs: update Tool Mode documentation to include additional input types and usage examples

* docs: enhance components-data documentation with usage examples and processing details

* docs: refine components-data and components-embedding-models documentation for clarity and detail

* docs: update components-memories documentation for inputs and outputs; add new components-processing documentation

* stepping-away

* helpers

* components-io

* loaders

* docs: update components and guides for clarity and consistency; refine memory component descriptions

* models

* docs: restructure components-prompts documentation for clarity and consistency

* prompts

* docs: update components-prompts documentation for clarity and improved examples

* docs: add redirect from components-rag to components-vector-stores and remove components-rag documentation

* sidebar-remove-vectara-rag

* move-components-tab-after-workspace

* vector-store

* link

* processing

* docs: update components overview for clarity and additional features

* headings

* memory-object

* code-review

* code-review

* linter

* Apply suggestions from code review

Co-authored-by: KimberlyFields <46325568+KimberlyFields@users.noreply.github.com>

* code review

---------

Co-authored-by: KimberlyFields <46325568+KimberlyFields@users.noreply.github.com>
2024-12-20 21:39:29 +00:00
Christophe Bornet
4b0c42e520
feat: Bump blockbuster version to 1.5.5 (#5382)
Bump blockbuster version to 1.5.5
2024-12-20 13:45:06 +00:00
anovazzi1
243055e1cd
refactor: Simplify agent input text content construction (#5344)
* refactor: Simplify agent input text content construction

* Change HUMAN to Input

---------

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-12-20 13:28:54 +00:00
Raphael Valdetaro
68c36c415e
feat(component): enhance merge data with standard operations (#5125)
* feat(component): enhance merge data with standard operations

- Add standard merge operations (concatenate, append, merge, join)
- Add operation selection via dropdown
- Return DataFrame output type
- Implement separate merge strategies

* style(component): improve merge data formatting

- Add MIN_INPUTS_REQUIRED constant
- Use descriptive DataFrame variable names
- Move return statement to else block
- Use list comprehension for better performance
- Fix unused loop variable
- Improve overall code formatting

* [autofix.ci] apply automated fixes

* Update src/backend/base/langflow/components/processing/merge_data.py

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>

* refactor: adjust merge_data operations to use langflow.schema.DataFrame

* Update Merge Data component name and description

* [autofix.ci] apply automated fixes

* refactor: enhance data merging logic in DataMergerComponent

- Improved type hinting for combined data structures to enhance code clarity.
- Streamlined the concatenation and merging operations to ensure consistent handling of string and object types.
- Updated the logic to correctly append values to lists when merging data inputs, improving data integrity in the merging process.

* revert merge data changes

* add data merger component

* refactor: remove DataMergerComponent and clean up imports

- Deleted the DataMergerComponent to streamline the processing components.
- Updated the __init__.py file to reflect the removal of the DataMergerComponent from the exports.

* refactor: enhance MergeDataComponent with new merge operations

- Introduced a new enum, MergeOperation, to define various data merging strategies: CONCATENATE, APPEND, MERGE, and JOIN.
- Updated the merge_data method to return a DataFrame instead of a list of Data objects, improving data handling.
- Enhanced input validation to ensure a minimum number of data inputs are provided.
- Streamlined the merging logic to support different operations, improving flexibility and usability of the component.

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-12-20 12:17:17 +00:00
Abhishek Patil
fb9825ee65
fix: Resolve Auth field issue in Composio component and bump Composio (#5357)
* fix: replace single quotes with double quotes

* feat: update Composio component fields
2024-12-20 11:42:29 +00:00
Cristhian Zanforlin Lousa
01c1d47ff5
refactor: Enhance error handling, message editing and prompt display (#5310)
* 📝 (newChatMessage.tsx): add event listener to handle tab visibility change and update state accordingly
📝 (newChatMessage.tsx): remove event listener when component unmounts to prevent memory leaks

*  (use-tab-visibility.tsx): introduce custom hook useTabVisibility to track tab visibility changes in the browser
📝 (newChatMessage.tsx, newChatView.tsx): import and use useTabVisibility hook to handle tab visibility changes and update chat behavior accordingly

* 📝 (newChatMessage.tsx): remove duplicate import of useTabVisibility and update import path
📝 (newChatView.tsx): remove duplicate import of useTabVisibility and update import path
 (use-tab-visibility.tsx): create a new custom hook to track tab visibility changes in the browser

* reducing to smaller components

* 📝 (frontend): remove unused imports and clean up code in various files to improve code readability and maintainability

* 📝 (editMessage/index.tsx): Rename EditMessage component to MarkdownField for better clarity and consistency
📝 (newChatMessage.tsx): Replace EditMessage component with MarkdownField component for rendering chat messages with markdown support
📝 (newChatView.tsx): Add conditional rendering to display a message when no chat messages are fetched

 (chatViewWrapper/index.tsx): Add messageFetched prop to ChatView component to handle messages fetching status and improve component functionality.

* prompt viedw

* Refactor chat view component and remove unused prop

* [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>
2024-12-19 19:50:05 +00:00
Raphael Valdetaro
9a8f721515
feat: Add OpenRouter component for multi-provider model access (#5271)
* feat: add OpenRouter component for multi-provider model access

- Add OpenRouter integration with provider-based model selection
- Support dynamic model fetching from OpenRouter API
- Implement temperature and max tokens controls
- Add site URL and app name for rankings
- Include model tooltips with context length and descriptions

* fix: restore SambaNova component in models __init__.py

* refactor: simplify OpenRouter build_model method

* [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>
2024-12-19 19:29:45 +00:00
VICTOR CORREA GOMES
68deca4feb
refactor(components): Rename StoreMessage to MessageStore for Better Clarity (#5009)
* refactor: Rename store message component to message store

* [autofix.ci] apply automated fixes

* refactor: Rename store message component to message store

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes

* fix: restore StoreMessage name for backwards compatibility

* fix(core): rename store_message.py for compatibility

- Restore original filename to maintain system compatibility
- Ensure consistent file naming across codebase

* fix(ui): correct output message display name

- Update Output display_name from "Stored Messages" to "Stored Message"
- Maintain consistency in singular/plural naming conventions

* refactor: rename message_store to store_message in helpers module

- Updated import statement in __init__.py to reflect the new module name for MessageStoreComponent.
- This change improves clarity and consistency in the component naming convention.

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-12-19 19:19:02 +00:00
Cristhian Zanforlin Lousa
b07bd173b4
feat: Add Pandas kwargs support for CSV Agent (#5372)
*  (csv.py): Add support for passing Pandas kwargs to the CSV agent for more customization and flexibility.

* 📝 (csv.py): mark 'is_list' attribute as True for the 'Pandas Kwargs' parameter to indicate it can accept a list of values
2024-12-19 19:17:26 +00:00
bhatsanket
e657e9de4a
fix: fix partition error in AstraDBCQLToolComponent (#4356)
* fix: AstraDBCQLToolComponent

Tool part is working fine but the direct Data output fails cause of partition key issue

* Ruff fix

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-12-19 19:00:00 +00:00
Gabriel Luiz Freitas Almeida
0619ed7248
refactor: add model validator to FlowHeader model and fix response handling (#5355)
* refactor: streamline imports and enhance flow header response handling in flows.py

- Consolidated import statements for better readability.
- Updated the response structure in the  function to utilize  for improved data validation and consistency.

* refactor: enhance FlowHeader model with detailed field descriptions and validation

- Updated FlowHeader model to include field descriptions for better clarity and documentation.
- Introduced a model validator to ensure data integrity before processing.
- Streamlined import statements for improved readability.

---------

Co-authored-by: Lucas Oliveira <62335616+lucaseduoli@users.noreply.github.com>
2024-12-19 18:58:09 +00:00
Ayush
3de5572c45
docs: add docs to huggingface space restart script (#5051)
* Update factory_restart_space.py

just added more readability by adding more comments

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-12-19 18:42:27 +00:00
Cristhian Zanforlin Lousa
435d86067c
refactor: improve conditional rendering on panel buttons (#5365)
add render condition on modal buttons
2024-12-19 18:35:11 +00:00
VICTOR CORREA GOMES
81da524375
feat(components): add LangWatch evaluator component - New Bundle (#4722)
* feat(components): add LangWatch evaluator component

* feat(langwatch): add tracing integration and custom endpoint support

* style(langwatch): update component name and svg icon

* [autofix.ci] apply automated fixes

* Clean code with code formatting styles

* Add contexts and expected_output also as dynamic fields

* refactor(langwatch): remove redundant logging and improve type hinting

- Removed unnecessary logger exception calls in error handling sections to streamline the code.
- Added type hinting for the trace_id assignment to enhance code clarity and maintainability.

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Rogério Chaves <rogeriochaves@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-12-19 18:26:10 +00:00
Cristhian Zanforlin Lousa
fa46786f47
fix: remove redundant memoization from parameter render components to fix input cursor position (#5347)
 (parameterRenderComponent/index.tsx): Refactor ParameterRenderComponent to improve code readability and maintainability. Remove unnecessary memoization and useCallback hooks, simplify component rendering logic, and optimize component structure.
2024-12-19 18:19:18 +00:00
Dario Saltarelli
c864929bde
fix: add endpoint_name to read_flows endpoint (#5354)
* fix: add endpoint_name whem mapping results for headers_flow parameter (#5353)

* [autofix.ci] apply automated fixes

---------

Co-authored-by: Dario Saltarelli <dario.saltarelli@sscinc.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-12-19 18:10:40 +00:00
Lucas Oliveira
c0ffb86c13
fix: make search on sidebar shortcut not be triggered inside inputs (#5345)
* added search components on sidebar shortcut

* Implemented search components sidebar shortcut on flow sidebar component

---------

Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com>
2024-12-19 17:27:03 +00:00
Gabriel Luiz Freitas Almeida
dd68a97567
feat: return variable value if it is a generic variable (#5366)
* fix: update pre-commit configuration for ruff formatting args

* fix: update variable type constant from GENERIC_TYPE to CREDENTIAL_TYPE

* feat: enhance variable service to handle decryption for generic type and update default variable type to CREDENTIAL_TYPE

* feat: add abstract method to retrieve all variables for a user in VariableService

* feat: implement get_all method in KubernetesSecretService to retrieve and decrypt user variables

* refactor: update variable tests to use fixtures for generic and credential types

- Renamed and refactored test fixtures for better clarity and reusability.
- Updated tests to utilize `generic_variable` and `credential_variable` fixtures instead of hardcoded values.
- Enhanced assertions to ensure correct handling of variable types, including encryption for credential variables and decryption for generic variables.
- Improved test structure for creating, reading, updating, and deleting variables, ensuring consistency across test cases.

* refactor: update get_all method signatures in variable services to return VariableRead

- Changed return type of the get_all method in VariableService, KubernetesSecretService, and DatabaseVariableService from list[Variable | None] to list[VariableRead].
- This update enhances type consistency across variable services and aligns with the new VariableRead model for improved data handling.

* fix: update variable type assertion in test_update_variable to CREDENTIAL_TYPE

- Changed the assertion in the `test_update_variable` test to verify that the result type is now `CREDENTIAL_TYPE` instead of `GENERIC_TYPE`.
- This update aligns the test with recent changes in variable type handling, ensuring accurate validation of variable updates.

* fix: update variable type assertion in test_create_variable to CREDENTIAL_TYPE

- Changed the assertion in the `test_create_variable` test to verify that the result type is now `CREDENTIAL_TYPE` instead of `GENERIC_TYPE`.
- This update ensures consistency with recent changes in variable type handling and improves the accuracy of the test validation.
2024-12-19 17:04:00 +00:00
Gabriel Luiz Freitas Almeida
b7f5a7fe9b
fix: avoid checking variables with empty value (#5367)
fix: enhance load_from_db field checks in custom component update and parameter loading

- Updated the condition in  to ensure that  only includes fields with a defined value.
- Modified the  function to skip parameters that are either not present or have a falsy value, improving robustness in parameter handling.
2024-12-19 17:01:15 +00:00
Eric Hare
22877ae920
feat: tool mode for all vector store components (#5348)
* feat: tool mode for all vector store components

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes (attempt 2/3)

* Update elasticsearch.py

* Update test_vector_store_rag.py

* Update vector_store_rag.py

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-12-19 16:49:09 +00:00
Gabriel Luiz Freitas Almeida
be612eb6d3
test: Update test descriptions to indicate requirement for store API key (#5359)
* test: update test descriptions to indicate requirement for store API key

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-12-19 16:37:28 +00:00
Saurabh Misra
a30ccc4302
feat: Install Codeflash optimizer github action (#5350)
* Install Codeflash optimizer github action

* try

* install the right dev

* try

* try

* try

* try

* try

* Python 3.12

* temp run

* test optimizing bubble sort

* try

* try

* finalize setup
2024-12-19 16:36:57 +00:00
Rodrigo Nader
62c13adcfd
feat: add dataframe operations component (#5341)
* add dataframe operations component

* populate entire new column with value

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* [autofix.ci] apply automated fixes

* Add unit tests for DataFrame operations in `test_dataframe_operations.py`

* **Import modules**
  - Import `pytest` and `pandas` for testing DataFrame operations

* **Define test cases**
  - Define test cases for edge cases like empty DataFrames and invalid column names
  - Include tests for operations like "Head", "Tail", and "Replace Value"
  - Use `pytest.mark.parametrize` to test multiple operations with different inputs
  - Add detailed assertions to verify the correctness of DataFrame operations

* [autofix.ci] apply automated fixes

* Remove test cases for DataFrame operations from `test_dataframe_operations.py`. This deletion includes all unit tests related to various DataFrame operations such as adding, dropping, filtering, and renaming columns, as well as handling edge cases like empty DataFrames and invalid operations. The removal streamlines the test suite by eliminating outdated or redundant tests.

* Add unit tests for DataFrame operations in

- Introduced a new test file  for organizing test components.
- Updated import paths for  to reflect the new module structure.
- Refactored test cases to use  for better readability and maintainability.
- Enhanced assertions in tests for various DataFrame operations, including handling of empty DataFrames and invalid operations.
- Improved code formatting for consistency and clarity.

* Refactor DataFrameOperationsComponent for improved readability and maintainability

- Consolidated import statements for clarity.
- Renamed variable `df` to `dataframe_copy` for better understanding.
- Streamlined the `perform_operation` method by replacing `elif` with `if` statements for clearer logic flow.
- Enhanced error message for unsupported operations to improve debugging.

These changes aim to enhance the code structure and make future modifications easier.

* Update unit tests for DataFrame operations in `test_dataframe_operations.py`

- Modified expected values in parameterized tests for various DataFrame operations, including "Add Column", "Filter", "Sort", "Head", "Tail", and "Replace Value" to reflect new test scenarios.
- Adjusted assertions to ensure they correctly validate the output of operations, particularly for lists of expected values.
- Enhanced error handling in the test for invalid operations to provide clearer feedback on unsupported operation types.

These changes improve the accuracy and robustness of the unit tests for DataFrame operations.

* Refactor DataFrameOperationsComponent methods to return DataFrame instances consistently

---------

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-12-19 16:14:04 +00:00
Edwin Jose
41f83294a2
fix: code flash pr issues in Calculator and JSONCleaner Components (#5352)
* Update calculator.py

* Update json_cleaner.py

* [autofix.ci] apply automated fixes

* updated init

* updated format

format

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-12-19 15:38:59 +00:00
Gabriel Luiz Freitas Almeida
e25872b287
ci: Update pre-commit configuration to use ruff for linting and formatting (#5360)
chore: update pre-commit configuration to use ruff for linting and formatting
2024-12-19 15:24:01 +00:00
Cristhian Zanforlin Lousa
ba7380824c
test: Enhance tool mode spec with zoom controls and drag-drop functionality (#5363)
 (tool-mode.spec.ts): add zoomOut utility function to enable zooming out on the page
📝 (tool-mode.spec.ts): update test case to include zooming out functionality using the new zoomOut utility function
2024-12-19 06:19:17 -08:00
Gabriel Luiz Freitas Almeida
e6bacbf98b
ci: Update CI condition to allow workflow_dispatch trigger to bypass nightly check (#5362)
fix: update CI condition to allow workflow_dispatch to trigger CI
2024-12-19 06:05:24 -08:00
Gabriel Luiz Freitas Almeida
50b6a0b5a5
fix: Remove unnecessary directory clearing in build_langflow_base target (#5356)
fix: remove unnecessary directory clearing in build_langflow_base target
2024-12-19 04:12:06 -08:00
Edwin Jose
d5498cf3cb
fix: improve UUID handling in flow helpers (#5346)
* Update flow.py

solving error when user id is string and not uuid

* Update flow.py

* solve lint errors
2024-12-19 01:14:41 +00:00
Ítalo Johnny
2db5f93bd4
feat!: rename the type BaseChatMessageHistory to Memory (#5190)
* chore: rename the type BaseChatMessageHistory to Memory

* Added Memory type with same color as BaseChatMessageHistory

* [autofix.ci] apply automated fixes

---------

Co-authored-by: Lucas Oliveira <lucas.edu.oli@hotmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-12-18 22:10:01 +00:00
VICTOR CORREA GOMES
e79b1649a5
feat: add tool_mode parameter to MessageTextInput in ID Generator Component (#5311)
* feat: add tool_mode parameter to MessageTextInput for enhanced functionality

* fix: update tool mode test to ensure correct functionality and response handling

- Adjusted test to wait for the "Toolset" element to appear before asserting its count.
- Modified code handling to replace "tool_mode=True" with "tool_mode=False" and verified the updated code is different.
- Added response check for the custom component to ensure a successful status (200) after submission.

---------

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-12-18 21:54:13 +00:00
Saurabh Misra
214829ab45
refactor: (codeflash)️ Speed up method JSONCleaner._remove_control_characters by 1,491% (#5322)
* ️ Speed up method `JSONCleaner._remove_control_characters` by 1,491%
To optimize the function `_remove_control_characters`, we can use the `translate` method with a translation table to remove control characters. This method is generally faster than using regular expressions for character replacement/removal tasks.

Here is the optimized version of the program.



By precompiling the translation table in the `__init__` method, we're reducing the repeated overhead of creating this table every time `_remove_control_characters` is called. Using `str.translate` with this precompiled table significantly improves the performance compared to using a regular expression substitution.

* add super()

---------

Co-authored-by: codeflash-ai[bot] <148906541+codeflash-ai[bot]@users.noreply.github.com>
2024-12-18 21:53:59 +00:00
Saurabh Misra
90ba7f3ae7
refactor: (codeflash) ️ Speed up method CalculatorToolComponent._eval_expr by 103% (#5323)
* ️ Speed up method `CalculatorToolComponent._eval_expr` by 103%
Certainly! Here is an optimized version of the provided program.



### Changes Made.
1. **Caching Operators Dictionary**: 
    - Moved the operators dictionary to the `__init__` method of the class. This avoids redefining the dictionary every time `_eval_expr` is called.
    
2. **Avoid Repeated Type Checks**.
    - Used `elif` for subsequent checks to avoid unnecessary type checks if a condition is met early.

3. **Intermediate Variable Storage**.
    - Stored intermediate results (`left_val`, `right_val`, `operand_val`) to improve readability and potential slight performance gains by avoiding repeated function calls.

These changes improve speed and efficiency without significantly altering the logic or structure of the method. The returned value remains unaffected, meeting the requirement for an identical output to the original program.

* add super()

* ruff formatting

---------

Co-authored-by: codeflash-ai[bot] <148906541+codeflash-ai[bot]@users.noreply.github.com>
2024-12-18 21:53:37 +00:00
Cristhian Zanforlin Lousa
1e52711cf4
refactor: simplify input_types in LCToolsAgentComponent (remove BaseTool and StructuredTool) (#5084)
* 🔧 (agent.py): remove unnecessary input_types "BaseTool" and "StructuredTool" from the HandleInput class to simplify and clarify the code.

* 🔧 (sql.py): remove "BaseTool" from input_types in HandleInput to simplify the code and enhance clarity.

* 🔧 Refactor starter project JSON files to simplify inputTypes by removing "BaseTool" and "StructuredTool", retaining only "Tool" for clarity and consistency across multiple agent configurations.

---------

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-12-18 20:57:37 +00:00
Christophe Bornet
3f0e383135
ref: Remove unused sync session_scope, with_session and engine (#5333)
Remove unused sync session_scope, with_session and engine
2024-12-18 20:52:06 +00:00
Edwin Jose
9bf372ee3e
feat: add ToolModeMixin to existting Input Types except SecretsInputs (#5339)
* adding  ToolModeMixin to paramters

* Update inputs.py

* Update inputs.py

updated inputs that doesnt require a tool as input. Removed tool mode mixin from unwnated input types

* Create test_toolmodemixin.py

updated tests

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-12-18 20:30:37 +00:00
Lucas Oliveira
7d6d41aa87
refactor: update ReactFlow to v12 (#5317)
* Added xyflow and updated imports

* Fix changing node.width to node.measured.width

* Updated NodeType to follow new API

* Fixed note node data type

* Created AllNodeType to contain note node type

* Changed flow types to follow new type from reactflow 12

* Updated flowStore to work with new types

* Updated flowStore and reactFlowUtils to work with custom edge type

* Updated updateAllNodes to use new type

* Updated PageComponent to follow new names for node dragging and edge reconnect

* Made selected prop be optional

* Changed reactFlowInstance to have nodes and edges type

* Updated updateAllComponent to follow new types

* Updated ReactFlowUtils with new types

* Updated reactFlowUtils type

* Updated all reactFlowUtils to be generic

* Updated handleRenderComponent with Connection type

* Updated node description and name with null checks for names

* Added check if node is genericNode on nodeOutputField

* Updated note node type

* Updated nodestatus with selected null check

* Updated notenode with new node type

* Update NodeType imports to be AllNodeType

* Fix more lint issues

* Fixed react flow button css

*  (freeze.spec.ts): add zoomOut utility function to handle zooming out in tests for better code reusability and readability
📝 (decisionFlow.spec.ts): import zoomOut utility function to handle zooming out in tests for better code reusability and readability
📝 (zoom-out.ts): create zoomOut utility function to handle zooming out in tests for better code reusability and readability

* 🐛 (generalBugs-shard-10.spec.ts): fix test to wait for the element with class "border-ring-frozen" to be visible before asserting its count

* 📝 (generalBugs-shard-10.spec.ts): remove unnecessary locator click on element with id 'react-flow-id' to improve test reliability and maintainability

* 📝 (SelectionMenuComponent): add data-testid attribute to differentiate error-group-node and group-node components
📝 (similarity.spec.ts): refactor dragTo calls to use targetPosition for better accuracy, replace zoom_out clicks with zoomOut function, updateOldComponents function to handle outdated components
📝 (generalBugs-shard-5.spec.ts): replace zoom_out clicks with zoomOut function, add waitForSelector for group-node before clicking, remove unnecessary mouse interactions
📝 (intComponent.spec.ts): replace zoom_out clicks with zoomOut function, click on div-generic-node component
📝 (keyPairListComponent.spec.ts): click on div-generic-node component, adjustScreenView function call
📝 (nestedComponent.spec.ts): remove unnecessary click on react-flow-id element
📝 (generalBugs-shard-7.spec.ts): replace zoom_out clicks with zoomOut function

*  (stop-building.spec.ts): Add new utility functions to improve code modularity and readability
🔧 (stop-building.spec.ts): Refactor drag and drop operations to use utility functions for better maintainability
🔧 (stop-building.spec.ts): Refactor zoom out operations to use utility function for consistency
🔧 (stop-building.spec.ts): Refactor component positioning operations to use utility functions for clarity
🔧 (stop-building.spec.ts): Refactor outdated components and filled API keys handling to use utility functions for reusability
🔧 (stop-building.spec.ts): Refactor fit view operation to use utility function for consistency

*  (generalBugs-shard-9.spec.ts): refactor test to use initialGPTsetup function for GPT setup instead of manual steps to improve code readability and maintainability

*  (store-shard-2.spec.ts): Increase timeout for clicking "api-key-button-store" to 200000ms for better test stability
 (deleteComponents.spec.ts, deleteFlows.spec.ts, store-shard-1.spec.ts, store-shard-3.spec.ts): Increase timeout for clicking "api-key-button-store" to 200000ms for better test stability
 (store-shard-1.spec.ts, store-shard-3.spec.ts): Remove unnecessary waitForSelector and add timeout of 200000ms for clicking "api-key-button-store" for better test stability

*  (fileUploadComponent.spec.ts): update dragTo method calls with targetPosition option to specify the position of the drag action

*  (decisionFlow.spec.ts): add explicit wait for an element to be attached before interacting with it to improve test reliability
🐛 (sticky-notes.spec.ts): fix test by adding keyboard press to simulate pressing the Escape key to close a modal before checking text length

*  (sticky-notes.spec.ts): update assertion to use 'toHaveCount' matcher for improved test readability and reliability

* Added function to make controls horizontal

*  (sticky-notes.spec.ts): update selector for textMarkdown to improve test reliability and readability

---------

Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
2024-12-18 19:40:13 +00:00
Gabriel Luiz Freitas Almeida
0e1f1a48e2
feat: turn most class variables into instance variables in the Component classes (#5252)
* refactor: improve type checking and initialization in BaseComponent class

- Moved UUID import to TYPE_CHECKING for better type hinting without runtime overhead.
- Reorganized the initialization of class attributes within the __init__ method for clarity and consistency.
- Enhanced the __setattr__ method to handle potential KeyError and AttributeError when checking immutability of _user_id.

* refactor: streamline CustomComponent initialization and enhance attribute management

- Introduced ClassVar constants for better clarity and organization.
- Removed redundant class attributes and restructured instance attribute initialization for improved readability.
- Ensured that instance-specific attributes are initialized before calling the parent class's constructor.
- Enhanced the overall structure of the CustomComponent class to facilitate future maintenance and development.

* refactor: enhance Component initialization and attribute management

- Reorganized the __init__ method to initialize instance-specific attributes before calling the parent class constructor.
- Introduced new instance attributes for better management of inputs, outputs, and internal state.
- Improved clarity by processing input kwargs and ensuring unique ID assignment for components.
- Streamlined the setup process for inputs and outputs, enhancing overall structure and maintainability.

* test: Add unit tests for ChatInput component to verify attribute independence
2024-12-18 18:59:17 +00:00
Ítalo Johnny
fffc7fb73f
fix: file path handling for cross-os compatibility (#5342)
* test: add more unit tests

* fix: correct file path splitting to handle OS differences

* [autofix.ci] apply automated fixes

* fix: ruff error

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-12-18 18:51:48 +00:00
Gabriel Luiz Freitas Almeida
0c08bed713
fix: make serialization errors in component update show up in the UI (#5332)
* feat: Add SerializationError exception for improved error handling during data serialization

- Introduced a new SerializationError class to handle errors when serializing data to JSON.
- The class provides detailed error messages based on the type of serialization issue encountered, including async function handling and unsupported object types.
- Enhances the robustness of the application by providing clearer feedback for serialization-related errors.

* fix: Improve error handling in custom component update to include SerializationError
2024-12-18 18:36:55 +00:00
Dmitry
ae5860e431
docs: fix typo Update deployment-gcp.md (#5225)
Co-authored-by: Mendon Kissling <59585235+mendonk@users.noreply.github.com>
2024-12-18 17:10:31 +00:00
dhlidongming
6e162b5a73
perf: optimize vertex build query for recent records (#5301)
* Optimize query to fetch latest vertex builds.

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-12-18 16:50:13 +00:00
Ali Saleh
82080ebade
feat: ArizePhoenixTracer v2 - Enhanced Session Tracking and Flow Organization (#5336)
Updated ArizePhoenixTracer
2024-12-18 16:32:58 +00:00
Christophe Bornet
51677667ab
fix: Fix missing await in initialize_alembic_log_file (#5334)
Fix missing await in initialize_alembic_log_file
2024-12-18 16:05:56 +00:00