Commit graph

5,861 commits

Author SHA1 Message Date
anovazzi1
7fa980e5fc
fix: Update memoization logic in ChatView component to prevent scroll bug (#5764)
refactor: Update memoization logic in ChatView component

Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com>
2025-01-22 01:15:19 +00:00
Lucas Oliveira
6f04e5783c
fix: removed auto height to fix glitch on Edit Tools (#5815)
Removed auto height from table node component

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2025-01-22 01:14:57 +00:00
dependabot[bot]
14773bb391
chore(deps): bump undici from 6.21.0 to 6.21.1 in /src/frontend (#5855)
Bumps [undici](https://github.com/nodejs/undici) from 6.21.0 to 6.21.1.
- [Release notes](https://github.com/nodejs/undici/releases)
- [Commits](https://github.com/nodejs/undici/compare/v6.21.0...v6.21.1)

---
updated-dependencies:
- dependency-name: undici
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-22 01:13:31 +00:00
Lucas Oliveira
3a1a6a1066
Revert "fix: change border color on chat input when active" (#5838)
Revert "fix: change border color on chat input when active (#5814)"

This reverts commit d4b9a3f15b.

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2025-01-21 21:25:49 +00:00
anovazzi1
84cad2cbbc
fix: update YouTube icon name in sidebar bundles (#5817)
refactor: Correct capitalization of YouTube icon name in sidebar bundles

Co-authored-by: Carlos Coelho <80289056+carlosrcoelho@users.noreply.github.com>
2025-01-21 21:07:05 +00:00
dependabot[bot]
258096207b
chore(deps-dev): bump vite from 5.4.11 to 5.4.14 in /src/frontend (#5851)
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.4.11 to 5.4.14.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v5.4.14/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.4.14/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-21 21:00:18 +00:00
Cristhian Zanforlin Lousa
e34f39ac75
test: update data-testid attributes for chat memory and OpenAI model elements (#5823)
* 🐛 (generalBugs-shard-9.spec.ts): fix incorrect test selector for elementChatMemoryOutput to match updated element ID
🐛 (generalBugs-shard-3.spec.ts): fix incorrect test selector for elementsOpenAiOutput to match updated element ID

* 📝 (refreshButton.tsx): add data-testid attribute to RefreshButton component for testing purposes
🐛 (Vector Store.spec.ts): fix import statement to include 'expect' in Playwright test file
🐛 (Vector Store.spec.ts): remove unnecessary test.skip block for ASTRA_DB_API_ENDPOINT
🐛 (Vector Store.spec.ts): fix selectors and interactions for refresh buttons and dropdown options in Playwright test file

*  (freeze-path.spec.ts): refactor test cases to use a new helper function moveSlider for interacting with slider elements in a more efficient and readable way
2025-01-21 20:45:10 +00:00
dependabot[bot]
25bf7f9010
chore(deps): bump katex from 0.16.18 to 0.16.21 in /src/frontend (#5771)
Bumps [katex](https://github.com/KaTeX/KaTeX) from 0.16.18 to 0.16.21.
- [Release notes](https://github.com/KaTeX/KaTeX/releases)
- [Changelog](https://github.com/KaTeX/KaTeX/blob/main/CHANGELOG.md)
- [Commits](https://github.com/KaTeX/KaTeX/compare/v0.16.18...v0.16.21)

---
updated-dependencies:
- dependency-name: katex
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-21 20:27:36 +00:00
Raphael Valdetaro
bd8dbdfab6
feat: add arxiv component (#5634)
* feat: add arxiv component

* [autofix.ci] apply automated fixes

* test: add initial test suite for arxiv component

* fix: correct test formatting for ArXiv component

* fix: implement tests for ArXivComponent following TestBatchRunComponent pattern

* fix: ArXivComponent test formatting

* [autofix.ci] apply automated fixes

* refactor: update imports and skip version tests for new component

* fix: fix line breaks in test file

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-01-21 20:20:26 +00:00
Deon Sanchez
a06cca4a8c
feat: add dialog support to dropdown components and enhance AstraDB (#5349)
* feat: add dialog support to dropdown components and enhance AstraDB integration

- Introduced a new NodeDialog component for improved user interaction when connecting to Astra DB.
- Updated AstraDBVectorStoreComponent to include a dialog option for creating new collections.
- Enhanced dropdown components to support dialog functionality, allowing users to create new options directly from the dropdown.
- Added `hasDialog` property to relevant component types to manage dialog visibility.
- Refactored utility functions to support new naming conventions and improve code clarity.

* [autofix.ci] apply automated fixes

* Remove creation parameters, add new inputs for dialog

* Update astradb.py

* [autofix.ci] apply automated fixes

* Update the mixins for dialog_inputs

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes

* refactor: standardize JSON formatting and clean up input types in Vector Store RAG configuration

- Reformatted JSON structure for better readability, ensuring consistent indentation and line breaks.
- Updated input types across various components to use array notation for clarity.
- Removed extraneous entries in package-lock.json to streamline dependencies.
- Enhanced overall maintainability of the configuration files.

* Add new options_metadata field to dropdown mixin

* Update test_astra_component.py

* Properly set dictionary mapping

* Update astradb.py

* Fix collection loading

* [autofix.ci] apply automated fixes

* Update astradb.py

* Update astradb.py

* [autofix.ci] apply automated fixes

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

* Enhance AstraDB integration and update dropdown components

- Updated the AstraDBVectorStoreComponent to include new input fields for database and collection creation, with default options for selection.
- Refactored dropdown components to support dynamic dialog inputs, improving user interaction for creating new options and refreshing lists.
- Updated package-lock.json to reflect dependency upgrades, including Rollup and SWC packages.

This commit improves the functionality and usability of the AstraDB integration and dropdown components, ensuring a smoother user experience.

* Update astradb.py

* Fix autodetection

* Enhance dropdown components to support options metadata

- Added `optionsMetaData` prop to Dropdown and DropdownComponent for improved data handling.
- Updated rendering logic in Dropdown to display metadata alongside options, enhancing user experience.
- Modified type definitions to include `optionsMetaData` in relevant components.

These changes improve the flexibility and usability of dropdown components, allowing for richer data presentation.

* Refactor and enhance AstraDB integration and dropdown components

- Updated the `Vector Store RAG.json` configuration for improved formatting and consistency in output and input types.
- Enhanced the `NodeDialogComponent` to accept `dialogInputs` as a prop, allowing for more dynamic content rendering.
- Modified the `Dropdown` component to use `onSelect` instead of `onClick` for better accessibility and user interaction.
- Improved rendering logic in the `Dropdown` component to conditionally display icon options based on the presence of `dialogInputs`.

These changes enhance the usability and flexibility of the AstraDB integration and dropdown components, providing a more intuitive user experience.

* Don't inherit from dict input in new inputs

* [autofix.ci] apply automated fixes

* Update astradb.py

* update logic for dropdown

* Fix the number of records per collection

* Update astradb.py

* [autofix.ci] apply automated fixes

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

* feat: Enhance Dropdown and Parameter Render Components

- Updated Dropdown component to integrate post template value handling and refresh functionality.
- Refactored ParameterRenderComponent to conditionally render based on dialog inputs.
- Improved DropdownComponent to accept additional props for better flexibility.

These changes improve the overall functionality and usability of the dropdown components within the application.

* Set unknown to none to hide unavailable fields

* Update astradb.py

* Refactor Dropdown Component for Enhanced Usability

- Removed unnecessary state initialization and improved code readability.
- Updated button elements within the dropdown to enhance user interaction.
- Added loading state indication for the refresh button.
- Filtered out null values from options metadata for cleaner rendering.

These changes streamline the dropdown functionality and improve the user experience.

* Refactor NodeDialog, Dropdown, and ParameterRender Components

- Commented out debug logs in NodeDialogComponent to clean up console output.
- Enhanced Dropdown component to conditionally render icon options based on dialog inputs.
- Updated ParameterRenderComponent to check for the length of dialog inputs before rendering.

These changes improve code readability and ensure components behave correctly based on input conditions.

* [autofix.ci] apply automated fixes

* Cleanup some tests

* Fix ruff style issue

* [autofix.ci] apply automated fixes

* Fix environment specification

* [autofix.ci] apply automated fixes

* Update starter project template

* Update astradb.py

* Remove backwards compatibility features

* [autofix.ci] apply automated fixes

* Small tweak to autodetect

* [autofix.ci] apply automated fixes

* Refactor NodeDialogComponent to Dynamically Render Inputs

- Replaced static content in NodeDialogComponent with dynamic rendering based on dialogInputs.
- Introduced NodeInputField and RenderInputParameters components for better modularity.
- Enhanced footer with Cancel and Save buttons, improving user interaction.

These changes enhance the flexibility and usability of the NodeDialogComponent, allowing it to adapt to varying input configurations.

* Refactor NodeDialogComponent: Remove Unused Imports

- Commented out unused imports in NodeDialogComponent to clean up the code.
- This change enhances code readability and prepares the component for future updates.

No functional changes were made; the focus was on improving code quality.

* Refactor Dropdown and ParameterRender Components for Improved Readability and Functionality

- Renamed functions in Dropdown component for clarity: `renderOptionsList` and `renderCreateOptionDialog` to `oldRenderOptionsList` and `renderCustomOptionDialog`, respectively.
- Enhanced the rendering logic in Dropdown to streamline the display of options and metadata.
- Simplified the return structure in ParameterRenderComponent to always render the RefreshParameterComponent, improving code consistency.
- Updated RefreshParameterComponent to conditionally display the refresh button based on the presence of dialog inputs.

These changes improve code readability and maintainability while ensuring consistent behavior across components.

* [autofix.ci] apply automated fixes

* Add the new naming conventions to deletion fields

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes

* Add new cloud provider options for database creation

* [autofix.ci] apply automated fixes

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

* Make dialog inputs a dictionary of inputs

* [autofix.ci] apply automated fixes

* Update astradb.py

* Update astradb.py

* [autofix.ci] apply automated fixes

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

* Update astradb.py

* [autofix.ci] apply automated fixes

* added mock data for testing

* Clean up the reactive flow

* [autofix.ci] apply automated fixes

* Fix the dialog inputs

* Update Vector Store RAG.json

* Update Vector Store RAG.json

* Update astradb.py

* Update astradb.py

* [autofix.ci] apply automated fixes

* Update astradb.py

* Update astradb.py

* Switch dialog inputs from list to dictionary

* Update astradb.py

* Refactor NodeDialogComponent to utilize useDialogSubmit hook for handling dialog submissions and streamline input rendering. Remove unused props and mock data, enhancing clarity and maintainability. Update DropdownComponent to remove unnecessary content prop. Introduce useDialogSubmit hook for improved API interaction and loading state management.

* New structure for dialog inputs

* [autofix.ci] apply automated fixes

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

* No need for the input type on token

* Flip order of ingest and search

* [autofix.ci] apply automated fixes

* Remove id field from factory

* Remove other id field

* [autofix.ci] apply automated fixes

* Refactor directory_reader.py to simplify file filtering logic

* Refactor flowSidebarComponent to filter out bundles and custom components in CategoryGroup

* [autofix.ci] apply automated fixes

* Refactor NodeDialogComponent to utilize dialogInputs directly, removing mock data and enhancing parameter rendering. Update Dropdown and ParameterRenderComponent types to accept single dialogInputs object. Remove unused useDialogSubmit hook.

*  (NodeDialogComponent/index.tsx): Introduce handleNewValue function to handle updating node template values based on user input
🔧 (NodeDialogComponent/index.tsx): Add support for process.env.PORT environment variable to be able to run app on a configurable port
🔧 (dropdownComponent/index.tsx): Add nodeId prop to Dropdown component to pass node id for better context
🔧 (parameterRenderComponent/index.tsx): Update handleOnNewValue prop to accept key parameter for better handling of new values
🔧 (parameterRenderComponent/types.ts): Add nodeId property to BaseInputProps type for better context and consistency

* Don't load the new collection names from db

* Update astradb.py

* Temporary disabling of dialog inputs functionality

* Update directory_reader.py

* Fix problematic uv.lock line

* Update uv.lock

* Update Vector Store RAG.json

* Update Vector Store RAG.json

* refactor: enhance dropdown and refresh button logic for better user experience

- Updated the dropdown component to disable the trigger button when there are no options available or when certain conditions are met.
- Removed the old render options list to streamline the dropdown rendering process.
- Improved the loading state handling in the dropdown to provide clearer feedback to users.
- Refactored the refresh button logic to ensure it only displays when appropriate conditions are met, enhancing the component's responsiveness.

* [autofix.ci] apply automated fixes

* Allow combobox specification of api endpoint

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes

* Update Vector Store RAG.json

* Add back api_endpoint option for compatibility

* Update Vector Store RAG.json

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Eric Hare <ericrhare@gmail.com>
Co-authored-by: anovazzi1 <otavio2204@gmail.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
2025-01-21 19:43:54 +00:00
anovazzi1
c904d9caf6
chore: Upgrade langflow-embedded-chat to v1.0.7 (#5843)
chore(deps): Upgrade langflow-embedded-chat to v1.0.7

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2025-01-21 18:03:45 +00:00
Lucas Oliveira
f08c18f54a
feat: loop components handle ui and logic (#5744)
* Added backend to allow loop on output

* Added custom edge for looping components

* Added allows_loop to output type

* Added output_types to target handle if its a loop

* Fixed valid_connection to allow loops

* Added the loop handle to the outputs

* Added infinity icon

* Fixed clean edges to not delete loop edge

* Implement loop checking before build.

* Implemented looping indicator

* Fixed belzier path

* [autofix.ci] apply automated fixes

* 🔧 (reactflowUtils.ts): refactor cleanEdges and detectBrokenEdges functions to improve code readability and maintainability by extracting repeated logic into variables and reducing code duplication.

* [autofix.ci] apply automated fixes

* Add from_loop_target_handle method to TargetHandle class and update type field

* Enhance Edge class to handle loop target handles and validate loop edges

* Add output_names attribute and get_value_from_output_names method to Vertex class

* Add overlap check for input and output names in Component class

* Fix default value assignment in ComponentVertex to handle output names correctly

* Clarify error message for missing attributes in Component class

* Added backend to allow loop on output

* Added custom edge for looping components

* Added allows_loop to output type

* Added output_types to target handle if its a loop

* Fixed valid_connection to allow loops

* Added the loop handle to the outputs

* Added infinity icon

* Fixed clean edges to not delete loop edge

* Implement loop checking before build.

* Implemented looping indicator

* Fixed belzier path

* [autofix.ci] apply automated fixes

* 🔧 (reactflowUtils.ts): refactor cleanEdges and detectBrokenEdges functions to improve code readability and maintainability by extracting repeated logic into variables and reducing code duplication.

* [autofix.ci] apply automated fixes

* Add from_loop_target_handle method to TargetHandle class and update type field

* Enhance Edge class to handle loop target handles and validate loop edges

* Add output_names attribute and get_value_from_output_names method to Vertex class

* Add overlap check for input and output names in Component class

* Fix default value assignment in ComponentVertex to handle output names correctly

* Clarify error message for missing attributes in Component class

* feat: add loop component 🎁🎄 (#5429)

* add loop component 🎁🎄

* [autofix.ci] apply automated fixes

* fix: add loop component to init

* [autofix.ci] apply automated fixes

* refactor(loop): rename loop input variable and improve code quality

- Renamed 'loop' input to 'loop_input' for clarity.
- Simplified logic for checking loop input and aggregating results.
- Enhanced type hints for better code readability and maintainability.

* refactor(loop): add type hint to initialize_data method for improved clarity

* fix: mypy error incompatible return value type

* feat: adds test cases for loop component compatibility with the APIs, Loop component updates to support API (#5615)

* add loop component 🎁🎄

* [autofix.ci] apply automated fixes

* fix: add loop component to init

* [autofix.ci] apply automated fixes

* refactor(loop): rename loop input variable and improve code quality

- Renamed 'loop' input to 'loop_input' for clarity.
- Simplified logic for checking loop input and aggregating results.
- Enhanced type hints for better code readability and maintainability.

* refactor(loop): add type hint to initialize_data method for improved clarity

* adding test

* test cases added

* Update test_loop.py

* adding test

* test cases added

* Update test_loop.py

* update with the new test case method!

* Update test_loop.py

* tests  updates

* Update loop.py

* update fix

* issues loop issues

* reverting debug mode params

* solves lint errors and fix the tests

* fix: mypy error incompatible return value type

* [autofix.ci] apply automated fixes

---------

Co-authored-by: Rodrigo Nader <rodrigosilvanader@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>
Co-authored-by: italojohnny <italojohnnydosanjos@gmail.com>

* feat: improve model input fields for Cohere component (#5712)

feat: improve model input fields for cohere component

1. Make api_key field required
2. Convert temperature to SliderInput with range 0-2
3. Add info description to temperature slider

* refactor: improve naming consistency in DataCombiner component (#5471)

* refactor: improve naming consistency in DataCombiner component

- Rename MergeOperation to DataOperation
- Rename component to DataCombinerComponent
- Convert operation enum values to uppercase
- Update method names for consistency

* [autofix.ci] apply automated fixes

* fix: resolved linting errors in __init__.py

* [autofix.ci] apply automated fixes

* Changed operation names to capitalize only first letter

* refactor: rename DataCombinerComponent to MergeDataComponent for better clarity and backwards compatibility

* [autofix.ci] apply automated fixes

* fix: Translate Portuguese text to English in merge_data.py

* feat: add required to data_inputs in MergeDataComponent

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Edwin Jose <edwin.jose@datastax.com>

* refactor: Refactor Wikipedia API component (#5432)

* refactor(wikipedia): Refactor Wikipedia API component

* test: add unit tests for WikipediaAPIComponent

* [autofix.ci] apply automated fixes

* refactor: improve WikipediaAPIComponent tests and fix lint issues

* [autofix.ci] apply automated fixes

* fix: resolve lint issues in WikipediaAPIComponent tests

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Edwin Jose <edwin.jose@datastax.com>

* fix: pass slider input values correctly, add test (#5735)

*  (base.py): Update field validation to include "slider" type in addition to "float" type for better parameter handling
📝 (constants.py): Add "slider" type to the list of DIRECT_TYPES for consistency and completeness

*  (test_inputs.py): add unit test for SliderInput class to ensure it initializes with correct value

* 🐛 (base.py): fix comparison of field type with a list by changing it to a set to ensure correct condition evaluation

* [autofix.ci] apply automated fixes

* fix format

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>

* feat: make AWS credentials required in bedrock component (#5710)

1. Make aws_access_key_id field required
2. Make aws_secret_access_key field required

* chore: update test durations (#5736)

Co-authored-by: ogabrielluiz <24829397+ogabrielluiz@users.noreply.github.com>

* feat: add truncation to ResultDataResponse (#5704)

* chore: Update dependencies and improve platform markers in configuration files

- Added 'hypothesis' version 6.123.17 to dev-dependencies in pyproject.toml.
- Updated platform markers from 'sys_platform' to 'platform_system' for better compatibility in uv.lock, affecting multiple packages including 'jinxed', 'colorama', and 'appnope'.
- Ensured consistency in platform checks across various dependencies to enhance cross-platform support.

This update improves the project's dependency management and ensures better compatibility across different operating systems.

* feat: Enhance ResultDataResponse serialization with truncation support

- Introduced a new method `_serialize_and_truncate` to handle serialization and truncation of various data types, including strings, bytes, datetime, Decimal, UUID, and BaseModel instances.
- Updated the `serialize_results` method to utilize the new truncation logic for both individual results and dictionary outputs.
- Enhanced the `serialize_model` method to ensure all relevant fields are serialized and truncated according to the defined maximum text length.

This update improves the handling of large data outputs, ensuring that responses remain concise and manageable.

* fix: Reduce MAX_TEXT_LENGTH in constants.py from 99999 to 20000

This change lowers the maximum text length limit to improve data handling and ensure more manageable output sizes across the application.

* test: Add comprehensive unit tests for ResultDataResponse and VertexBuildResponse

- Introduced a new test suite in `test_api_schemas.py` to validate the serialization and truncation behavior of `ResultDataResponse` and `VertexBuildResponse`.
- Implemented tests for handling long strings, special data types, nested structures, and combined fields, ensuring proper serialization and truncation.
- Enhanced coverage for logging and output handling, verifying that all fields are correctly processed and truncated as per the defined maximum text length.
- Utilized Hypothesis for property-based testing to ensure robustness and reliability of the serialization logic.

This update significantly improves the test coverage for the API response schemas, ensuring better data handling and output management.

* feat: Add function to validate models with tool calling function and related fixes in agent component (#5720)

* Update nvidia.py

* update agent experience with improving model selection

update agent experience with improving model selection  and making only the tool calling models available.

* variable clean up

* [autofix.ci] apply automated fixes

* Update src/backend/base/langflow/base/models/model_input_constants.py

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

* Update src/backend/base/langflow/base/models/model_input_constants.py

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

* added default models

* [autofix.ci] apply automated fixes

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

* format errors solved

* [autofix.ci] apply automated fixes

* Update model.py

---------

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: assistants agent improvements (#5581)

* assistants agent improvements

* remove alembic init file

* vector store / file upload support

* use sync file object (required by sdk)

* steps

* self.tools initialization

* improvements for edwin

* add name and switch to MultilineInput

* ci fixes

* refactor: enhance flow type safety and clean up unused code (#5669)

* 📝 (use-save-flow.ts): add AllNodeType and EdgeType imports to improve type safety in useSaveFlow hook
📝 (index.tsx): remove unused setNoticeData function to clean up code and improve readability

* refactor: Remove unused code in GeneralPage component

* refactor: Remove unused code in cardComponent/index.tsx

---------

Co-authored-by: anovazzi1 <otavio2204@gmail.com>

* feat: Add `required=True` to essential inputs across Langflow components (#5739)

* fix: add required validation to input fields

Ensures mandatory fields are properly marked as required across components.

* fix: add required validation to input fields

Ensures mandatory fields are properly marked as required across components.

* fix: add required validation to input fields

field: model_name

* fix: add required validation to input fields

field: model and base_url

* fix: add required validation to input fields
input: mistral_api_key

* fix: add required validation to input fields

inputs: model, base_url, nvidia_api_key

* fix: add required validation to input fields
inputs: model, base_url

* fix: add required validation to input fields

input: openai_api_key

* fix: add required validation to input fields
inputs: message, embedding_model

* fix: add required validation to input fields
inputs: model_name, credentials

* fix: add required validation to input fields
inputs: aws_secret_access_key, aws_access_key_id

* fix: add required validation to input fields
inputs: input_text, match_text

* fix: add required validation to input fields
inputs: input_message

* fix: add required validation to input fields
inputs: input_value

* fix: add required validation to input fields
input: data_input

* fix: add required validation to input fields
inputs: input_value

* fix: add required validation to input fields
input: data_input

* fix: add required validation to input fields
input: data_input

* fix: add required validation to input fields
input: data_input

* fix: add required validation to input fields
input: data_input

* fix: add required validation to input fields

inputs: data_inputs, embeddings

* fix: add required validation to input fields
inputs: api_key, input_value

* fix: add required validation to input fields
inputs: password, username, openai_api_key, prompt

* fix: add required validation to input fields
inputs: api_key, transcription_result

* fix: add required validation to input fields
inputs: api_key, transcription_result, prompt

* fix: add required validation to input fields
input: prompt

* fix: add required validation to input fields
input: api_key

* fix: add required validation to input fields
inputs: api_key, transcript_id

* fix: add required validation to input fields
inputs: audio_file, api_key

* [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>

* feat: make YouTube Transcripts URL field required (#5686)

feat: Enhance YouTube Transcripts component by adding required field validation to URL input

This change ensures that users provide a video URL before using the YouTube Transcripts component, preventing potential runtime errors due to missing video source.

* fix: Fix memory leak when creating components (#5733)

Fix memory leak when creating components

* test: Update API key requirements and test configurations for frontend tests (#5752)

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: italojohnny <italojohnnydosanjos@gmail.com>
Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
Co-authored-by: Vinícios Batista da Silva <vinicios.batsi@gmail.com>
Co-authored-by: Raphael Valdetaro <79842132+raphaelchristi@users.noreply.github.com>
Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: ogabrielluiz <24829397+ogabrielluiz@users.noreply.github.com>
Co-authored-by: Sebastián Estévez <estevezsebastian@gmail.com>
Co-authored-by: anovazzi1 <otavio2204@gmail.com>
Co-authored-by: VICTOR CORREA GOMES <112295415+Vigtu@users.noreply.github.com>
Co-authored-by: Christophe Bornet <cbornet@hotmail.com>
Co-authored-by: Lucas Oliveira <62335616+lucaseduoli@users.noreply.github.com>

* Updated loop.py component

* [autofix.ci] apply automated fixes

* update test file

* fix: handle None values in input names and improve type hints

* [autofix.ci] apply automated fixes

* Added loop component test

* Added comments

* test: add 'allow_loop' field to Output dictionary in test_output_to_dict method

* fix: correct key name in Output dictionary from 'allow_loop' to 'allows_loop' in test_output_to_dict method

* Updated frontend loop test

* Updated examples

* 🐛 (generalBugs-shard-9.spec.ts): Fix incorrect test selector for chat memory output element
🐛 (loop-component.spec.ts): Fix incorrect test selector for chat output element
🐛 (generalBugs-shard-3.spec.ts): Fix incorrect test selector for open AI model output element

* [autofix.ci] apply automated fixes

* refactor: update return type in AgentComponent to use dotdict for build_config

This change modifies the return statement in the AgentComponent class to utilize a dotdict for the build_config, enhancing the structure and accessibility of the returned configuration data.

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: Rodrigo Nader <rodrigosilvanader@gmail.com>
Co-authored-by: italojohnny <italojohnnydosanjos@gmail.com>
Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
Co-authored-by: Vinícios Batista da Silva <vinicios.batsi@gmail.com>
Co-authored-by: Raphael Valdetaro <79842132+raphaelchristi@users.noreply.github.com>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: ogabrielluiz <24829397+ogabrielluiz@users.noreply.github.com>
Co-authored-by: Sebastián Estévez <estevezsebastian@gmail.com>
Co-authored-by: anovazzi1 <otavio2204@gmail.com>
Co-authored-by: VICTOR CORREA GOMES <112295415+Vigtu@users.noreply.github.com>
Co-authored-by: Christophe Bornet <cbornet@hotmail.com>
2025-01-21 17:52:28 +00:00
Cristhian Zanforlin Lousa
64d82d407a
test: Update test selectors in frontend regression tests (#5835) 2025-01-21 07:24:57 -08:00
anovazzi1
dbd2bd9375
fix: update LANGFLOW_COMPONENTS_PATH env variable behavior (#5700)
* Refactor directory_reader.py to simplify file filtering logic

* Refactor flowSidebarComponent to filter out bundles and custom components in CategoryGroup

* [autofix.ci] apply automated fixes

* refactor: Improve file filtering in DirectoryReader

This commit improves the file filtering logic in the DirectoryReader class. Previously, it only excluded files that started with "__" and included all files that were not in a "deactivated" directory. Now, it also considers the depth of the file relative to the safe path. Only files that are one or two levels deep are included in the file list.

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2025-01-21 01:47:19 +00:00
Lucas Oliveira
d4b9a3f15b
fix: change border color on chat input when active (#5814)
Fixed border color on chat input
2025-01-20 20:58:25 +00:00
Cristhian Zanforlin Lousa
9dc6c24180
feat: change Text to Message type with backend and frontend support (#5652)
*  (inputs.py): Update default prompt input types to include "MessageTextInput" for improved user experience
📝 (styleUtils.ts): Add color definition for "MessageTextInput" node to enhance visual representation in the frontend

* 📝 (text.py): Update input_types for "Value" to include "Message" for better clarity
📝 (memory.py): Update input_types for "Session ID" to include "Message" for consistency
📝 (message.py): Update input_types for "Session ID" to include "Message" for uniformity
📝 (self_query.py): Update input_types for "Query" to only include "Message" for consistency
📝 (create_data.py): Update input_types for fields to only include "Message" for consistency
📝 (update_data.py): Update input_types for fields to only include "Message" for consistency
📝 (inputs.py): Update DEFAULT_PROMPT_INTUT_TYPES to only include "Message" for consistency
📝 (styleUtils.ts): Remove "MessageTextInput" from nodeColors and nodeColorsName for consistency

* 📝 (model.py): update display name from "Text" to "Message" for better clarity
📝 (url.py): update display name from "Text" to "Message" for better consistency
📝 (memory.py): update display name from "Text" to "Message" for better understanding
📝 (text.py): update display name from "Text" to "Message" for better semantics
📝 (llm_math.py): update display name from "Text" to "Message" for improved readability
📝 (runnable_executor.py): update display name from "Text" to "Message" for better context
📝 (sql_generator.py): update display name from "Text" to "Message" for clearer communication
📝 (text.py): update display name from "Text" to "Message" for better consistency
📝 (parse_data.py): update display name from "Text" to "Message" for enhanced understanding
📝 (wikidata_api.py): update display name from "Text" to "Message" for improved semantics
📝 (test_cycles.py): update display name from "Text" to "Message" for better clarity

* [autofix.ci] apply automated fixes

* 🔧 (App.css): change width property value to fit-content to improve layout responsiveness

* fix: resolve merge conflicts and clean up URLComponent implementation in starter projects

- Removed conflicting sections in the JSON files for 'Custom Component Maker' and 'Graph Vector Store RAG'.
- Ensured the URLComponent class is correctly defined with methods for URL validation and content fetching.
- Updated input and output definitions for better clarity and functionality.

* 🐛 (freeze.spec.ts): fix incorrect test selectors for handle-textinput-shownode and handle-parsedata-shownode elements to match updated element IDs

* 📝 (NodeOutputfield/index.tsx): Add id prop to InspectButton component for better identification
🔧 (freeze-path.spec.ts, freeze.spec.ts, stop-building.spec.ts, decisionFlow.spec.ts, similarity.spec.ts, textInputOutput.spec.ts, generalBugs-shard-5.spec.ts, fileUploadComponent.spec.ts): Update test selectors to match changes in UI components for better test accuracy

*  (duckduckgo.spec.ts): update the test to click on a specific element with the test ID "output-inspection-data-duckduckgosearch" instead of "output-inspection-data" to match the updated frontend implementation.

*  (youtube-transcripts.spec.ts): update selector for clicking on transcript element to match changes in the frontend code, ensuring the test remains accurate

---------

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-01-20 20:36:46 +00:00
Lucas Oliveira
9104770591
fix: removed refresh table when pagination is off (#5813)
Fixed refresh appearing when pagination is off

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2025-01-20 20:05:09 +00:00
Cristhian Zanforlin Lousa
d9a52d5cb8
feat: Enhance FlowMenu name editing experience (#5729)
*  (FlowMenu/index.tsx): improve user experience by enhancing the flow name editing functionality in the appHeaderComponent's FlowMenu component

*  (FlowMenu/index.tsx): add data-testid attribute to span element for flow name in MenuBar component
🐛 (edit-flow-name.spec.ts): fix test cases to use correct data-testid value for input element in edit-flow-name feature

*  (store-shard-2.spec.ts): update selectors to match changes in the frontend code for better test accuracy and reliability
 (edit-flow-name.spec.ts): update selectors to match changes in the frontend code for better test accuracy and reliability
 (flowSettings.spec.ts): update selectors to match changes in the frontend code for better test accuracy and reliability
 (general-bugs-move-flow-from-folder.spec.ts): update selectors to match changes in the frontend code for better test accuracy and reliability

*  (FlowMenu/index.tsx): add useEffect hook to set flow name when currentFlow is present and not editing name

* fix errors

*  (youtube-transcripts.spec.ts): update timeout values for page.waitForSelector to improve test performance and reliability

*  (sliderComponent): Add cn utility function to improve classnames handling in SliderComponent
📝 (floatComponent.spec.ts): Update test descriptions and values for NVIDIA related components
♻️ (sliderComponent.spec.ts): Refactor code to replace FloatInput with SliderInput and update import statements and values for temperature slider

*  (youtube-transcripts.spec.ts): skip the test for youtube transcripts component to prevent it from running during test suite execution
2025-01-20 19:41:49 +00:00
Raphael Valdetaro
94d192ff5d
feat: Introduced YouTube bundle with essential components (#5415)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
Co-authored-by: anovazzi1 <otavio2204@gmail.com>
2025-01-20 10:49:54 -08:00
VICTOR CORREA GOMES
420cd92faa
feat(component): API Request Component Overhaul (#5007)
* style: Add icon property to WebhookComponent class

* style: Update input components in APIRequest class

* fix pr

* [autofix.ci] apply automated fixes

* remove debug print statement from api_request component

* remove debug print statement from api_request component

* feat: add dynamic cURL mode to APIRequestComponent

- Add cURL command parsing and field population
- Implement dynamic UI updates based on cURL input
- Support JSON body and headers extraction from cURL
- Add real-time refresh for cURL mode toggle

* refactor(APIRequestComponent): improve HTTP methods and cURL handling

- Add DELETE method support
- Enhance cURL parameter handling and UI visibility
- Fix JSON decode error handling with specific exception
- Update method visibility for DELETE requests

* style: Update input components in APIRequest class

* [autofix.ci] apply automated fixes

* remove debug print statement from api_request component

* remove debug print statement from api_request component

* feat: add dynamic cURL mode to APIRequestComponent

- Add cURL command parsing and field population
- Implement dynamic UI updates based on cURL input
- Support JSON body and headers extraction from cURL
- Add real-time refresh for cURL mode toggle

* refactor(APIRequestComponent): improve HTTP methods and cURL handling

- Add DELETE method support
- Enhance cURL parameter handling and UI visibility
- Fix JSON decode error handling with specific exception
- Update method visibility for DELETE requests

* [autofix.ci] apply automated fixes

* git commit -m "ui(api-request): adjust field visibility and requirements

- Move query_params to advanced section
- Make URL field required"

* feat(api): enhance curl parsing and update unit tests

- Improve MultilineInput handling in APIRequestComponent for curl commands
- Update parse_curl unit test to match expected data structure
- Ensure consistent format for headers and body in test assertions

* [autofix.ci] apply automated fixes

* fix(api-request): improve UI/UX and fix initial field visibility

- Fix body field flickering on component load
- Enhance URL/cURL field toggle behavior

*  (filterSidebar.spec.ts): add tests for clicking on edit button modal, show headers button, and closing the modal to ensure correct behavior and visibility of elements

* 📝 (dictComponent/index.tsx): update data-testid attribute to dynamically set based on editNode value for better testability
📝 (nestedComponent.spec.ts): update test data and selectors to match changes in dictComponent/index.tsx for accurate testing

* refactor(api_request): improve component UX and field handling

- Update tool_mode placement to align with main branch changes
- Remove temporary required field validation to prevent UI conflicts
- Add field clearing logic when switching between cURL and URL modes
- Update component description to be more concise

* git commit -m "fix: resolve merge conflicts with upstream in api request component

* fix: resolve merge conflicts with upstream in api request component

* Delete src/backend/tests/unit/test_data_components.py

BREAKING CHANGE: Removed test_data_components.py as it has been replaced by test_api_request_component.py

* git commit -m "test(api-request): update test_parse_curl to match TableInput format

* style(test_api-request): apply ruff formatting rules

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com>
Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
2025-01-20 16:23:59 +00:00
Cristhian Zanforlin Lousa
00deb49c67
fix: Add optional chaining for getSelectedRows in TableComponent (#5805)
🐛 (tableComponent/index.tsx): fix potential null pointer exception when getting selected rows length
2025-01-20 16:14:45 +00:00
Raphael Valdetaro
a9559515e5
refactor: Search API component ensuring standard output pattern (#5435)
* refactor: Update Search API component to standard output pattern

* fix: rename component class to avoid conflict with legacy version

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes

* fix: address performance regression

---------

Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com>
2025-01-20 15:43:22 +00:00
Cristhian Zanforlin Lousa
5c3c680c41
refactor: Enhance InputList Component UI/UX (#5726)
* [LFOSS-74]: input list UI improvements

*  (frontend): Add new component 'DeleteButtonInputList' to improve user experience by providing a button to delete items in a list
📝 (frontend): Comment out unused code related to duplicating input items for now, to be revisited in a future release
📝 (frontend): Add a comment to indicate that the 'DropdownMenuInputList' feature will be added back in a future release
📝 (frontend): Update CSS styling for 'hit-area-icon' class to adjust size to h-7 and w-7 for consistency
📝 (frontend): Adjust color values in CSS to improve visual appearance, changing smooth-red to a new shade

*  (keypairListComponent/index.tsx): simplify conditional styling logic for list items to improve readability and maintainability

* 📝 (delete-button-input-list.tsx): Remove unused imports and update function parameter type for removeInput to specify React.MouseEvent
📝 (delete-button-input-list.tsx): Update button className and IconComponent className for better styling and readability
📝 (delete-button-input-list.tsx): Update ICON_STROKE_WIDTH constant value from 1.25 to 1.5 for better icon appearance
📝 (index.tsx): Update InputListComponent to render DeleteButtonInputList component conditionally based on value length
📝 (constants.ts): Update ICON_STROKE_WIDTH constant value from 1.25 to 1.5 for better icon appearance
📝 (inputListComponent.spec.ts): Update test cases to use updated test IDs for delete buttons and adjust expected input values to match changes in component behavior

* [autofix.ci] apply automated fixes

* 🔧 (applies.css): adjust positioning of input-slider-text to fix alignment issue and improve user experience

* 🐛 (button-input-list.tsx): fix button position by adjusting translate-x value to align properly on the page

*  (index.tsx): add visual indicator for focused input element in the list to improve user experience

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2025-01-20 13:25:55 +00:00
Jason
84c6ed2217
feat: add new model provider Novita AI (#5380)
* feat: add new model provider Novita AI

* [autofix.ci] apply automated fixes

* fix: code format fix

* fix: code format fix

* fix: fix default Novita AI models

* [autofix.ci] apply automated fixes

* feat: Add real-time refresh for Novita API key and include it in VARIABLES_TO_GET_FROM_ENVIRONMENT

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2025-01-20 12:53:28 +00:00
dhlidongming
6b02ef0a70
fix: initial hidden state for shadow-box component (#5639)
* Ensure shadow-box starts hidden on initial render.

* add comment to explain not obvious style fix

---------

Co-authored-by: anovazzi1 <otavio2204@gmail.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2025-01-20 12:52:30 +00:00
anovazzi1
8b7cbba206
fix: Adjust size of LMStudioIcon component (#5763)
refactor: Adjust size of LMStudioIcon component

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2025-01-20 12:31:39 +00:00
Ítalo Johnny
c8eb408b5e
feat: preserve manual component data if code unchanged (#5482)
* chore: preserve manual component data if code unchanged

* Fixed tool mode switch not changing with code

* Removed console.log

* Made tool mode not be lost when mutating template

* use setNode instead of setNodes on component code

* refactor: tool_mode return

* Fix tool mode being reverted on toggle

* fix: tool_mode outputs return

* change: logic for setting `tool_mode`

---------

Co-authored-by: Lucas Oliveira <62335616+lucaseduoli@users.noreply.github.com>
Co-authored-by: Lucas Oliveira <lucas.edu.oli@hotmail.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2025-01-20 11:34:52 +00:00
Gabriel Luiz Freitas Almeida
f5d9d53264
fix: update Tavily component in Instagram Copywriter and Market Research projects and tests (#5789) 2025-01-18 17:07:23 -08:00
VICTOR CORREA GOMES
d650b21f17
refactor(google_serper_api): migrate to new tool mode implementation (#5446)
* # refactor(google_serper_api): migrate to new tool mode implementation

BREAKING CHANGE: Replace legacy LCToolComponent implementation with new Component base class

- Migrate from LCToolComponent to Component base class
- Add tool_mode flag to MultilineInput
- Update output configuration to use DataFrame type
- Implement structured error handling with DataFrame responses
- Remove legacy tool mode implementation

* test(google-serper): add unit tests for GoogleSerperAPIComponent

- Add comprehensive test suite for GoogleSerperAPIComponent
- Mock HTTP requests to test search functionality
- Test component initialization and configuration
- Add error handling test cases
- Test text search and wrapper building methods
- Ensure proper DataFrame output structure

This change improves test coverage for the Google Serper API integration,
following existing test patterns in the project.

* [autofix.ci] apply automated fixes

* style(tests): remove unused fixture argument in google-serper test

- Remove unused mock_search_results fixture from test_text_search_serper
- Fix linting error ARG001 (unused function argument)

* revert(tools): restore Google Search API component to original implementation

Due to backward compatibility concerns, reverting the Google Search API component
to its initial implementation state to maintain stability and prevent breaking changes.

* refactor(components): mark GoogleSerperAPI component as deprecated & Legacy

* feat(components): add GoogleSerperAPICore component

* refactor(google-serper): fix filename typo from 'gloogle' to 'google'

* test(google-serper): add unit tests following component test guide

* feat(icons): improve Serper icon quality and add to icon list

* [autofix.ci] apply automated fixes

* Update test_google_serper_api_core.py

test update

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
2025-01-18 01:25:34 +00:00
Edwin Jose
aa5a4a505c
refactor: Deprecate Subflow and Flow as Tool component in favor of RunFlow (#5678)
* depreciated subflow and flow as tool

* 🐛 (filterSidebar.spec.ts): update test cases to reflect changes in sidebar item names by adding [Deprecated] suffix

---------

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
2025-01-17 23:36:41 +00:00
Cristhian Zanforlin Lousa
07b26340c0
fix: adjust GenericNode width to fit component wrapper (#5768)
*  (GenericNode/index.tsx): add useEffect hook to dynamically adjust width of ReactFlow node element to fit component wrapper

* 📝 (App.css): Update width property in .react-flow__node class to improve layout responsiveness
♻️ (GenericNode/index.tsx): Remove redundant code that manually sets width of ReactFlow node element, as it is now handled by CSS styling.
2025-01-17 20:27:39 +00:00
Raphael Valdetaro
656f9f30db
feat: Add DeepSeek Model component (#5443)
* feat: Add DeepSeek component

* Adiciona DeepseekModelComponent ao __init__.py

* [autofix.ci] apply automated fixes

* Add DeepSeek icon and update component files

* Add DeepSeek icon and update all related files

* [autofix.ci] apply automated fixes

* Change DeepSeek icon color to blue (#080c34)

* [autofix.ci] apply automated fixes

* Revert DeepSeek icon color to black

* [autofix.ci] apply automated fixes

* remove: name parameter from DeepSeekModel to avoid backwards compatibility issues

* test: add unit tests for DeepSeek model component with mocks

* fix: correct formatting issues in DeepSeek model tests

* feat: update DeepSeek icon color to #4c6cfc

* fix: make DeepSeek API key field required

* fix: format SecretStrInput to comply with line length limit in DeepSeekModelComponent

* feat: add dark mode support for component icon

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
2025-01-17 17:45:39 +00:00
Cristhian Zanforlin Lousa
36b3289da2
test: Update API key requirements and test configurations for frontend tests (#5752) 2025-01-17 06:17:26 -08:00
Cristhian Zanforlin Lousa
e1b5c70fa3
refactor: enhance flow type safety and clean up unused code (#5669)
* 📝 (use-save-flow.ts): add AllNodeType and EdgeType imports to improve type safety in useSaveFlow hook
📝 (index.tsx): remove unused setNoticeData function to clean up code and improve readability

* refactor: Remove unused code in GeneralPage component

* refactor: Remove unused code in cardComponent/index.tsx

---------

Co-authored-by: anovazzi1 <otavio2204@gmail.com>
2025-01-16 21:11:07 +00:00
Cristhian Zanforlin Lousa
d428fb6cb5
feat: Add data-testid and id attributes to app header components for testing (#5724)
* 📝 (AccountMenu/index.tsx): Add span elements with data-testid and id attributes for menu buttons for better testing and accessibility
📝 (FlowMenu/index.tsx): Add data-testid and id attributes to div elements for menu buttons for better testing and accessibility
📝 (HeaderMenu/index.tsx): Add data-testid and id attributes to DropdownMenuTrigger for user menu button for better testing and accessibility
📝 (ThemeButtons/index.tsx): Add data-testid and id attributes to Button elements for theme change buttons for better testing and accessibility
📝 (flowToolbarComponent/index.tsx): Add data-testid and id attributes to div element for API button modal for better testing and accessibility

*  (FlowMenu/index.tsx): add data-testid attributes to elements for easier testing and debugging
 (AppHeaderComponent/index.tsx): add data-testid attributes to header sections for easier testing and debugging
2025-01-16 16:05:04 +00:00
Cristhian Zanforlin Lousa
a56cccd91f
refactor: add tooltips to UI global variables components (#5648)
* 📝 (GlobalVariableModal.tsx): adjust popover width from "520px" to "29rem" for better UI responsiveness
📝 (index.tsx): import ShadTooltip component and update CommandItemContent to use it for better user experience
📝 (index.tsx): update popover width from "315px" to "17.5rem" for consistency and improved design aesthetics

* 🔧 (index.tsx): add side prop to ShadTooltip component to position the tooltip on the left side of the content.

*  (index.tsx): Add support for custom node styles in CommandItemContent component to allow for more flexible styling options
🔧 (index.tsx): Pass nodeStyle prop to CommandItemContent component to customize node styles based on the provided value
2025-01-16 13:18:43 +00:00
anovazzi1
1f63ebeaef
fix: Update useState default values in exportModal and flowSettingsModal (#5698)
* fix: Update useState default values in exportModal and flowSettingsModal

- Update the default values for the useState hooks in exportModal and flowSettingsModal to handle null values for currentFlow.
- Use the nullish coalescing operator (??) to set empty strings as default values for name and description.
- This ensures that the components do not throw errors when currentFlow is null or undefined.

Refs: #5670, #5672

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-01-15 19:44:31 +00:00
Cristhian Zanforlin Lousa
2f9a7858e2
refactor: Improve createFileUpload reliability and performance (#5697)
*  (create-file-upload.ts): Refactor createFileUpload function to improve readability and maintainability. Move input element creation and event listeners to separate functions for better separation of concerns. Use module-level variables for input element and promise resolver to handle cleanup and resolution more effectively.

*  (create-file-upload.ts): refactor createFileUpload function to improve code readability and maintainability. Remove unnecessary module-level variables and simplify the logic for handling file uploads.

* 📝 (create-file-upload.ts): refactor createFileUpload function to improve code readability and maintainability
🐛 (create-file-upload.ts): fix issue with resolving promise multiple times and improve file input handling

* 🔧 (create-file-upload.ts): refactor createFileUpload function to improve file upload process and cleanup event listeners for better performance and code readability

* 📝 (index.tsx): Remove unused useRef import and fileInputRef variable
♻️ (index.tsx): Refactor checkFileType function to use a for loop for better readability and performance
 (index.tsx): Introduce createFileUpload helper function to handle file selection and validation
📝 (index.tsx): Update handleButtonClick function to use createFileUpload helper function and improve file handling logic
📝 (index.tsx): Update handleButtonClick function to handle file upload and error messages more efficiently
📝 (index.tsx): Update input element to display file name and handle file selection more effectively

* add error handling in case document.body.removeChild Fails

---------

Co-authored-by: anovazzi1 <otavio2204@gmail.com>
2025-01-15 18:03:39 +00:00
Cristhian Zanforlin Lousa
65530e210f
fix: simplify InputFileComponent to use native file picker (#5692)
*  (index.tsx): Add useRef hook to manage file input element reference for better control over file selection process
🐛 (index.tsx): Fix handleButtonClick function to handle file selection asynchronously and provide fallback option if file selection fails
🐛 (index.tsx): Fix handleNativeInputChange function to correctly handle file selection from native file input element and reset its value after selection

* 📝 (index.tsx): Remove unused createFileUpload function and simplify handleButtonClick function to trigger file input click directly
♻️ (index.tsx): Refactor input element to use Button component for better styling and consistency

* 📝 (inputFileComponent/index.tsx): remove unnecessary comment in handleButtonClick function
2025-01-15 16:27:12 +00:00
Cristhian Zanforlin Lousa
b2a98163b3
fix: default flow locked property to false instead of null (#5670) 2025-01-14 06:33:11 -08:00
Cristhian Zanforlin Lousa
e7a2005188
fix: Improve update_flow data consistency, refine error handling, and add folder-moving tests (#5516)
* 🐛 (flows.py): Fix issue where flow data was not being properly updated in the database during flow update
📝 (flows.py): Improve error handling and rollback database session in case of exceptions during flow update
📝 (flows.py): Refactor code to handle unique constraint errors and provide more informative error messages
📝 (utils.py): Refactor get_webhook_component_in_flow function to handle cases where flow_data may not have 'nodes' attribute

*  (sideBarFolderButtons/index.tsx): add unique id attribute to sidebar folder buttons for improved accessibility and testing
 (general-bugs-move-flow-from-folder.spec.ts): add test to ensure user can move flow from one folder to another in the frontend application

* 🐛 (flows.py): remove unnecessary session rollback to prevent potential data inconsistency
♻️ (service.py): refactor with_session method to handle session commit and rollback more effectively

* style: adjust line breaks for readability

* style: reorder imports

* fix: ruff error try300

* [autofix.ci] apply automated fixes

* fix: mypy error module has no attribute "timeout"

* 🐛 (flows.py): remove unnecessary error handling code and improve exception handling for better error propagation and clarity

* [autofix.ci] apply automated fixes

* Update src/backend/base/langflow/services/database/service.py

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

* use model dump besides overwrite value

* [autofix.ci] apply automated fixes

* 📝 (chat.py): improve code readability by refactoring session handling and adding comments for clarity
🔧 (chat.py): refactor code to create a fresh session for database operations and improve session management in build_flow function

* [autofix.ci] apply automated fixes

* refactor: remove unused session parameter from build_flow function in chat.py

---------

Co-authored-by: italojohnny <italojohnnydosanjos@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>
2025-01-13 22:42:53 +00:00
Cristhian Zanforlin Lousa
88fa784291
fix: Improve hide-output button alignment in GenericNode component (#5645)
🔧 (GenericNode/index.tsx): Update CSS class for HiddenOutputsButton to improve styling and alignment
🔧 (GenericNode/index.tsx): Update CSS class for GenericNode component to improve alignment of elements
2025-01-13 22:19:27 +00:00
anovazzi1
41d5eab261
refactor: Comment out deprecated playground page (#5616)
refactor: comment out deprecated playground page
2025-01-13 18:58:53 +00:00
Cristhian Zanforlin Lousa
40925e89a5
feat: add UI/UX improvements on InputListComponent (#5644)
* [LFOSS-74]: input list UI improvements

* [autofix.ci] apply automated fixes

* Refactor dropdown menu icon size class

* Refactor button input list component to improve code structure and remove unnecessary div element ensuring the plus icon has the same size as ... icon

* [autofix.ci] apply automated fixes

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

* revert changes to keep the plus icon bigger than ... but with right positioning

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: anovazzi1 <otavio2204@gmail.com>
2025-01-13 16:11:59 +00:00
Cristhian Zanforlin Lousa
5122d56ed3
test: improve element interactions in generalBugs shard 7 tests (nightly fix) (#5646) 2025-01-13 11:48:21 -03:00
Cristhian Zanforlin Lousa
e2ff7b314b
feat: enhance URL component with improved description and render parameters (#5623)
* [LFOSS-74]: new input list UI

* [LFOSS-93]: node colors

* 📝 (Graph Vector Store RAG.json): Update description of ChatInput class to improve clarity and consistency
📝 (Graph Vector Store RAG.json): Update description of URLComponent class to improve clarity and consistency
📝 (select-items.tsx): Change noteDataType import to NoteDataType for consistency and clarity
📝 (dropdown-menu.tsx): Add RenderIcons component to display keyboard shortcuts for actions
📝 (index.tsx): Change parameter type from React.MouseEvent to KeyboardEvent for removeInput and handleDuplicateInput functions
📝 (use-overlap-shortcuts.tsx): Create custom hook to handle keyboard shortcuts with support for multiple key variations and modifiers

* 📝 (backend): Remove unnecessary metadata for URLComponent in multiple files
📝 (frontend): Refactor input components to use listAddLabel instead of metadata in multiple files

* ♻️ (NodeInputField/index.tsx): Remove unused 'metadata' variable to clean up the code and improve readability

* [autofix.ci] apply automated fixes

* merge fix

* [autofix.ci] apply automated fixes

* fix tests

* 🐛 (generalBugs-shard-5.spec.ts): fix incorrect comments numbering connections
💡 (generalBugs-shard-5.spec.ts): add clarifying comments for connection steps in the test case

* 🐛 (generalBugs-shard-5.spec.ts): fix filling delimiter in popover-anchor-input to resolve UI bug
📝 (generalBugs-shard-5.spec.ts): update test cases to improve test coverage and accuracy

*  (NodeOutputfield/index.tsx): Add top margin to improve spacing of NodeOutputField component
🔧 (generalBugs-shard-5.spec.ts): Remove commented out code related to input filling and waiting for visibility to clean up the test file and improve readability

* 🔧 (index.tsx): increase padding-right from 6 to 10 in input-edit-node class to improve spacing for better user experience

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-01-10 20:35:13 +00:00
Cristhian Zanforlin Lousa
febae4b589
feat: standardize node output icons with TextSearch and Chevrons (#5600)
*  (NodeInputField): Update styling to include padding-bottom when lastInput is true for better UI appearance
📝 (NodeOutputfield): Import TextSearch component from lucide-react library for future use
🔧 (RenderInputParameters): Simplify logic for determining lastInput in NodeInputField component
🔧 (GenericNode): Change icon displayed on HiddenOutputsButton based on showHiddenOutputs state
🔧 (GenericNode): Update tooltip content to include the number of hiddenOutputs when toggling visibility
🔧 (sliderComponent): Remove unnecessary padding-bottom from SliderComponent for better layout
📝 (constants.ts): Update tooltip text for better clarity and consistency with action names

*  (NodeOutputfield/index.tsx): Update import statement for IconComponent to include ForwardedIconComponent for better organization and clarity
🐛 (chatInputOutputUser-shard-0.spec.ts, chatInputOutputUser-shard-1.spec.ts): Fix references to 'ScanEye' icon to 'TextSearchIcon' for consistency and accuracy in tests
2025-01-10 18:29:00 +00:00
Lucas Oliveira
3e482dbc29
feat: allow flow name to be edited from the main page or by clicking header (#5525)
* Added flowData to allow changing flow name without being on the flow

* Added being able to edit the flow name just by clicking the name

* Added handleEdit and edit details option on flow dropdown

* Added flow settings modal to grid and list

* Added flowData type and select option

* Update src/frontend/src/components/core/appHeaderComponent/components/FlowMenu/index.tsx

Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com>

* Update src/frontend/src/components/core/appHeaderComponent/components/FlowMenu/index.tsx

Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com>

* Update src/frontend/src/components/core/appHeaderComponent/components/FlowMenu/index.tsx

Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com>

* Fixed useCallback import

* Implemented details boolean to not show endpoint, changed title of flow settings modal

* Changed Flow Settings to Edit Details

* Changed Flow Settings modal description

* Fixed empty name not appearing, fixed naming conditions not considered

* 📝 (editFlowSettingsComponent/index.tsx): add data-testid attribute to input element for flow name for testing purposes
 (edit-flow-name.spec.ts): create test to ensure user can edit flow name by clicking on the header or main page, with various random names generated for testing purposes

* Fixed tests that used Flow Settings

* Fixed tests that rely on flow name to open edit details

* Fixed tests

---------

Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com>
Co-authored-by: anovazzi1 <otavio2204@gmail.com>
2025-01-10 18:14:00 +00:00
Cristhian Zanforlin Lousa
a87bd8b57b
refactor: update DataFrame color to pink (#5613)
📝 (index.css): update color variables in index.css for better consistency and readability
♻️ (styleUtils.ts): refactor nodeColorsName object in styleUtils.ts to use more descriptive color names for better clarity and maintainability
2025-01-10 15:53:14 +00:00
anovazzi1
18acd304a7
feature: add command feature column to toolset table and other minor table improvements (#5343)
* refactor: Update toolset configuration display name and description

This commit updates the display name and description of the toolset configuration in the custom component. The display name is changed to "Edit tools" and the description is modified to "Modify tool names and descriptions to help agents understand when to use each tool." This improves the clarity and usability of the toolset configuration.

* refactor: Update table modal header description handling

* refactor: Add EditMode.POPOVER option to table schema

* refactor: Add EditMode.POPOVER option to table schema

* refactor: Add table icon to table schema and components

* add style for not editable cells

* Add "commands" field to tool table schema

* refactor: Add "no_blank" and "valid_csv" field parsers

- Added "no_blank" field parser to remove leading and trailing whitespace from strings and throw an error if the string is blank.
- Added "valid_csv" field parser to replace whitespace with commas in strings.

* refactor: Add commands to tool description in ComponentToolkit

* refactor: Improve parsing of commands in validCommands function

* Update src/frontend/src/utils/stringManipulation.ts

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

* [autofix.ci] apply automated fixes

* add support for hints on table header

* update descriptions on tool table

* [autofix.ci] apply automated fixes

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-01-10 12:15:37 +00:00