Commit graph

5,451 commits

Author SHA1 Message Date
anovazzi1
d0bfac3e7e
feature: Hide integrations (#4074)
* hide integrations

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-10-09 13:04:06 +00:00
anovazzi1
12a381a3fa
refactor: improve parameter render component (#3995)
* refactor: update dynamic parameter in ParameterRenderComponent to false

* refactor: update CodeAreaComponent to use CodeAreaModal for node toolbar

* feat: Add EmptyParameterComponent to render empty parameters

* refactor: Add types for parameter render component

Add typescript types for the parameter render component to improve code readability and maintainability.

* feat: Add EmptyParameterComponent to render empty parameters

* refactor: Update RefreshParameterComponent to use InputProps

Update the RefreshParameterComponent to use the InputProps interface for better code readability and maintainability.

* refactor: Update InputProps in parameterRenderComponent/types.ts

Update the InputProps interface in parameterRenderComponent/types.ts to remove the Partial<OptionalInputProps> and simplify the composition of input props. This improves code readability and maintainability.

* refactor: Update InputProps in parameterRenderComponent/types.ts

* refactor: Update parameterRenderComponent/types.ts to use handleOnNewValue instead of onChange

Update the parameterRenderComponent/types.ts file to import the handleOnNewValueType from "@/CustomNodes/hooks/use-handle-new-value" and replace the onChange function with handleOnNewValue in the BaseInputProps interface. This change improves code readability and maintainability.

* update folder structure

* refactor: Update TableModal to support disabled state

Update the TableModal component to include a disabled prop, allowing the modal to be disabled when necessary. This improves the flexibility and usability of the component.

* refactor: Update parameterRenderComponent/types.ts to include TableComponentType

Update the parameterRenderComponent/types.ts file to include the TableComponentType interface, which defines the structure for a table component. This change improves code organization and maintainability.

* refactor: Update parameterRenderComponent to use TableNodeComponent from the correct folder

* refactor: Update codeAreaComponent imports and props in parameterRenderComponent

Update the imports and props in the parameterRenderComponent file to reflect the changes made in the codeAreaComponent file. This refactor improves code organization and maintainability.

* refactor: Update parameterRenderComponent/types.ts to include CodeAreaComponentType

Update the parameterRenderComponent/types.ts file to include the CodeAreaComponentType interface, which defines the structure for a code area component. This change improves code organization and maintainability.

* refactor: Remove unused import of CodeAreaComponent in nodeToolbarComponent

Remove the unused import of CodeAreaComponent in the nodeToolbarComponent file to improve code cleanliness and maintainability.

* refactor: Remove unused import of CodeAreaComponent in nodeToolbarComponent

* refactor: Remove unused import of CodeAreaComponent in nodeToolbarComponent

* refactor: Remove unused import of CodeAreaComponent in codeAreaComponent/index.tsx

* refactor: Remove unused import of CodeAreaComponent in parameterRenderComponent/index.tsx

* refactor: Update floatComponent imports and props in parameterRenderComponent

Update the imports and props in the parameterRenderComponent file to reflect the changes made in the floatComponent file. This refactor improves code organization and maintainability.

* refactor: Update floatComponent imports and props in parameterRenderComponent

* update int component path

* update int component type

* update toogle location

* refactor: Update ToggleComponentType in components/index.ts

Remove the ToggleComponentType interface from the components/index.ts file. This change is part of a refactoring effort to remove unused code and improve code organization.

* refactor: Update ToggleComponentType in components/index.ts

Remove unused ToggleComponentType interface from components/index.ts

* refactor: Update ToggleShadComponent to handle new value changes

Refactor the ToggleShadComponent to handle new value changes by passing the updated value to the handleOnNewValue function. This improves the functionality and maintainability of the component.

* refactor: Move InputFileComponent to parameterRenderComponent/components folder

Move the InputFileComponent file from the src/frontend/src/components folder to the src/frontend/src/components/parameterRenderComponent/components folder. This change improves code organization and maintainability.

* refactor: Add FileComponentType interface to parameterRenderComponent/types.ts

Add the FileComponentType interface to the parameterRenderComponent/types.ts file. This interface defines the fileTypes property for the FileComponentType, allowing for better type checking and documentation. This change improves code organization and maintainability.

* refactor: Update InputFileComponent props in parameterRenderComponent

Update the props of the InputFileComponent in the parameterRenderComponent file to match the changes made in the index.tsx file. This refactor improves code organization and maintainability.

* refactor: Move PromptAreaComponent to parameterRenderComponent/components folder

* update types prompt field

* refactor: Update PromptAreaComponent to handle new value changes

Refactor the PromptAreaComponent to handle new value changes by passing the updated value to the handleOnNewValue function. This improves the functionality and maintainability of the component.

* refactor: Move LinkComponent to parameterRenderComponent/components folder

* refactor: Add LinkComponentType interface to parameterRenderComponent/types.ts

Add the LinkComponentType interface to the parameterRenderComponent/types.ts file. This interface defines the icon and text properties for the LinkComponentType, allowing for better type checking and documentation. This change improves code organization and maintainability.

* refactor: Update LinkComponent to use InputProps in parameterRenderComponent

Update the LinkComponent in parameterRenderComponent to use the InputProps interface for better type checking and consistency. This refactor improves code organization and maintainability.

* refactor: Move KeypairListComponent to parameterRenderComponent/components folder

* refactor: Add KeyPairListComponentType interface to parameterRenderComponent/types.ts

* refactor: Update KeypairListComponent to use InputProps in parameterRenderComponent

Refactor the KeypairListComponent in parameterRenderComponent to use the InputProps interface for better type checking and consistency. This refactor improves code organization and maintainability.

* refactor: Move DictComponent to parameterRenderComponent/components folder

* refactor: Update KeyPairListComponentType interface in parameterRenderComponent/types.ts

* refactor: Update KeypairListComponent to use InputProps in parameterRenderComponent

* refactor: Move InputListComponent to parameterRenderComponent/components folder

Move the InputListComponent to the parameterRenderComponent/components folder for better code organization and maintainability.

* refactor: Add StrRenderComponentType interface to parameterRenderComponent/types.ts

* refactor: Move InputListComponent to parameterRenderComponent/components folder

* refactor: Move InputListComponent to parameterRenderComponent/components folder

* refactor: Move InputListComponent to parameterRenderComponent/components folder

Move the InputListComponent to the parameterRenderComponent/components folder for better code organization and maintainability.

* refactor: Update InputListComponent to use InputProps in parameterRenderComponent

Refactor the InputListComponent in parameterRenderComponent to use the InputProps interface for better type checking and consistency. This refactor improves code organization and maintainability.

* refactor: Move IOFieldView to IOModal/components folder

Move the IOFieldView component to the IOModal/components folder for better code organization and maintainability.

* refactor: Move DropdownComponent to parameterRenderComponent/components folder

* refactor: Add DropDownComponentType interface to parameterRenderComponent/types.ts

* refactor: Update DropdownComponent import in StrRenderComponent

Update the import statement for DropdownComponent in StrRenderComponent to reflect its new location in the parameterRenderComponent/components folder. This refactor improves code organization and maintainability.

* refactor: Update StrRenderComponent to use baseInputProps

Refactor the StrRenderComponent in parameterRenderComponent to use the baseInputProps object instead of individual props for better code organization and maintainability.

* refactor: Update StrRenderComponent to use TextAreaComponent from correct location

Update the import statement for TextAreaComponent in StrRenderComponent to reflect its new location in the parameterRenderComponent/components folder. This refactor improves code organization and maintainability.

* remove unused imports

* refactor: Add TextAreaComponentType interface to parameterRenderComponent/types.ts

* refactor: Update TextAreaComponent to use handleOnNewValue instead of onChange

Refactor the TextAreaComponent in parameterRenderComponent to use the handleOnNewValue function instead of the onChange function for better code consistency. This change aligns with the recent updates to the component's props and improves maintainability.

* refactor: Update StrRenderComponent to use baseInputProps

Refactor the StrRenderComponent in parameterRenderComponent to use the baseInputProps object instead of individual props for better code organization and maintainability.

* refactor: Move inputGlobalComponent to parameterRenderComponent/components folder

Move the inputGlobalComponent to the parameterRenderComponent/components folder to improve code organization and maintainability.

* refactor: Move inputGlobalComponent to parameterRenderComponent/components folder

* refactor: Update InputGlobalComponent to use handleOnNewValue instead of onChange

Refactor the InputGlobalComponent in parameterRenderComponent to use the handleOnNewValue function instead of the onChange function for better code consistency. This change aligns with the recent updates to the component's props and improves maintainability.

* refactor: Update StrRenderComponent to use baseInputProps

Refactor the StrRenderComponent in parameterRenderComponent to use the baseInputProps object instead of individual props for better code organization and maintainability.

* refactor: Move multiselectComponent to parameterRenderComponent/components folder

Move the multiselectComponent to the parameterRenderComponent/components folder to improve code organization and maintainability.

* refactor: Move MultiselectComponent to parameterRenderComponent/components folder

Move the MultiselectComponent to the parameterRenderComponent/components folder to improve code organization and maintainability.

* refactor: Move MultiselectComponent to parameterRenderComponent/components folder

* refactor: Move MultiselectComponent to parameterRenderComponent/components folder

* refactor: Remove unused code in StrRenderComponent

* refactor: Remove unused code in StrRenderComponent

* refactor: Remove unused code in StrRenderComponent

* [autofix.ci] apply automated fixes

*  (tableInputComponent.spec.ts): add ua-parser-js library to parse user agent information for better control handling based on OS
🔧 (tableInputComponent.spec.ts): update key press event to use the correct control key based on the user's operating system for textarea selection.

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com>
2024-10-08 18:29:23 +00:00
anovazzi1
94a647f60d
feat: Add target="_blank" to Markdown links in NodeDescription and ChatMessage components (#4060)
* feat: Add target="_blank" to Markdown links in NodeDescription and ChatMessage components

* added gfm back
2024-10-08 16:58:23 +00:00
anovazzi1
dce5523f5e
fix: Add useUpdateNodeInternals hook to handle node class changes (#4058)
* fix: Add useUpdateNodeInternals hook to handle node class changes

* [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>
2024-10-07 18:04:07 -03:00
Gabriel Luiz Freitas Almeida
54dd81a681
chore: removes Poetry references from pyproject.toml and updates the project metadata (#4019)
* Remove Poetry references from pyproject.toml and update project metadata

* Remove '--no-update' flag from 'uv lock' commands in Makefile

* Add script metadata with Python version and dependencies

* Remove Poetry references and integrate UV setup in CI workflow

* Remove Poetry setup and installation from integration tests workflow

* Remove Poetry references and update workflow to use custom setup action

* Remove references to Poetry from configuration files
2024-10-04 17:24:55 +00:00
anovazzi1
99cdaaf073
feature: Add cursor highlight feature in canvas page (#4007)
* added a color change in cursor to help user find the cursor in the canvas page

* [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>
2024-10-04 13:59:56 +00:00
namastex888
350189c88d
feat(tools): add TavilyAI search tool for enhanced LLM search results (#3774)
* add tavily new icon

* feat(tools): add TavilyAI search tool for enhanced LLM search results

* [autofix.ci] apply automated fixes

* add tavily icon

* [autofix.ci] apply automated fixes

---------

Co-authored-by: cristhianzl <cristhian.lousa@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>
2024-10-03 17:38:44 +00:00
Edwin Jose
461238aa0e
fix: Add session_id Parameter to run_flow_from_json Function (#3989)
This pull request fixes the `run_flow_from_json` function by adding  `session_id` parameter. This update ensures that session management is properly handled during flow execution.

Changes include:
- Added `session_id` as an optional input parameter.
- Updated function documentation to reflect the inclusion of the new parameter.
- Added unit test for run_flow_from_json input parameters

This fix enhances the function's usability by allowing for better tracking of individual sessions.
2024-10-03 15:43:31 +00:00
Yuqi Tang
91e5ae797d
fix: make streaming work in JS code example (#3891)
* fix js code

* fix js code

* fix js code

* fix js code

* update js code

* update js code
2024-10-02 23:34:05 +00:00
anovazzi1
0d796db02c
feat: add integrations category in the sidebar (#3843)
* feat: Add skipFallback parameter to ForwardedIconComponent

This commit adds a new skipFallback parameter to the ForwardedIconComponent in the genericIconComponent module. The skipFallback parameter allows developers to skip rendering the fallback component when using Suspense. This can be useful in cases where the fallback component is not needed or should be handled differently.

* feat: Add skipFallback parameter to IconComponentProps

* feat: Add skipFallback parameter to IconComponentProps and ForwardedIconComponent

This commit adds the skipFallback parameter to the IconComponentProps and ForwardedIconComponent. This parameter allows skipping the fallback icon rendering when the specified icon is not found. The skipFallback parameter is used in the ParentDisclosureComponent to conditionally render the chevron-down or chevron-right icon based on the component's state.

The commit also updates the defaultOpen value in the ParentDisclosureComponent in the ExtraSidebarComponent. The defaultOpen value is set to true, ensuring that the "Integrations" section is always expanded when the component is rendered.

* refactor: Update ExtraSidebarComponent layout and styling

* [autofix.ci] apply automated fixes

* move file

* move file

* move file

* move file

* move file

* Update NotionLogo size

* Update size of AssemblyAI logo

* Update colors and names for AssemblyAI in styleUtils.ts

* Update BUNDLES_SIDEBAR_FOLDER_NAMES in constants.ts

* [autofix.ci] apply automated fixes

* add changes from pr #3934

* chore: add cache.db to .gitignore

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-10-02 12:07:57 -07:00
Yuqi Tang
06239ea63a
Fix: change note node horizontal padding (#3991)
* fix notes style

* fix notes style

* adding ghost node

* [autofix.ci] apply automated fixes

* change cursor position

* update notes related test

* [autofix.ci] apply automated fixes

* adjust shadow block width

* move cursor to middle:

* [autofix.ci] apply automated fixes

* fix padding

* change note node horizontal padding

* [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-10-02 10:56:36 -05:00
Yuqi Tang
e58b27062c
feat: improve notes design (#3938)
* fix notes style

* fix notes style

* adding ghost node

* [autofix.ci] apply automated fixes

* change cursor position

* update notes related test

* [autofix.ci] apply automated fixes

* adjust shadow block width

* move cursor to middle:

* [autofix.ci] apply automated fixes

* fix padding

---------

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-10-02 05:45:19 -07:00
João
b9bcb09e63
feat: Add OpenSearch VectorStore Component with Ingest and Search Capabilities (#3799)
* update: adding opensearch-py dependency

* feat: adding OpenSearch icon

* feat: adding OpenSearch VectorStore code

* fix: removing unused methods and adding hybrid search capabilities using search method

* update: poetry lock with recent hash added

* fix: removing unused methods and adding hybrid search capabilities using search method

* fix: default value of search_input to an empty string

* fix: adapting code to match make format script
2024-10-01 21:42:55 +00:00
Cristhian Zanforlin Lousa
7f10a2a201
fix: playground img not working (#3980)
* 🐛 (model.py): fix issue where message.files was not being updated correctly when image_paths is empty in MessageBase class

* 🐛 (model.py): simplify condition for checking if image_paths is not empty to improve readability and maintainability

* [autofix.ci] apply automated fixes

* 🔧 (OutputParser.py): refactor error message handling for unsupported or missing parser to improve readability and maintainability

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-10-01 18:54:11 +00:00
Mendon Kissling
34f18185c5
docs: add notes to flows (#3861)
* add-note

* notes

* vector-store-rag-notes

* vector-store-rag-notes

* comma

* comma

* revert

* add-notes

* another-way

* revert

* revert

* fix

* descriptions

* lightbulb

* deployed-size

* size

* size

* resizing-is-true

* targethandle

* double

* set-components

* pin

* notes

* fix

* dont-change-code

* cleanup

* update example

* fix postion on example

* fix-descriptions

* swap-link

* newline-and-lightbulb

* another-docs-link

* play-button

* remove-double

* update NODE_FORMAT_ATTRIBUTES to prevent description updates on examples

* Update AstraDB documentation link

* update documentation on code

*  (chatInputOutputUser-shard-0.spec.ts): update the test to click on the last element with the text "Playground" to ensure correct element is clicked

* 🐛 (Basic Prompting.spec.ts): fix clicking on "Playground" element by selecting the last occurrence to ensure correct element is clicked

*  (Blog Writer.spec.ts): update test to click on the last element with text "Playground" to ensure correct element is clicked on the page

*  (Dynamic Agent.spec.ts): update test to click on the last element with text "Playground" to ensure correct element is clicked on the page

* 🐛 (decisionFlow.spec.ts): fix clicking on "Playground" button by selecting the last element with the text "Playground" to ensure correct element is clicked

* 🐛 (generalBugs-shard-3.spec.ts): fix clicking on "Playground" button by selecting the last occurrence to prevent ambiguity

* 🐛 (generalBugs-shard-0.spec.ts): fix clicking on "Playground" button by selecting the last element with the text "Playground" to ensure correct element is clicked

* 🐛 (general-bugs-shard-3836.spec.ts): fix clicking on "Playground" button by selecting the last element with the text "Playground" to ensure correct element is clicked

*  (chatInputOutputUser-shard-2.spec.ts): update test to click on the last element with text "Playground" to ensure correct interaction with chat input/output feature

*  (stop-button-playground.spec.ts): update test to click on the last occurrence of the text "Playground" to ensure correct element is clicked

* 🐛 (limit-file-size-upload.spec.ts): fix selector to click on the last element with text "Playground" instead of the first one

*  (fileUploadComponent.spec.ts): update test to click on the last element with text "Playground" to ensure correct element is clicked on the page

*  (chatInputOutput.spec.ts): update test to click on the last occurrence of the "Playground" text to ensure correct element is clicked

* 🐛 (generalBugs-shard-9.spec.ts): fix clicking on "Playground" element by selecting the last occurrence to prevent flakiness in tests

* 🐛 (Document QA.spec.ts): fix clicking on "Playground" element by selecting the last occurrence to ensure correct element is clicked

*  (similarity.spec.ts): update click method to target the last occurrence of "Playground" text to ensure correct element is clicked

* 🐛 (Simple Agent.spec.ts): fix clicking on "Playground" button by selecting the last element with the text to avoid ambiguity

*  (textInputOutput.spec.ts): update test script to target the last occurrence of the "Playground" text element to ensure correct interaction with the UI.

*  (Travel Planning Agent.spec.ts): Update the selector for the "Playground" text to ensure the correct element is clicked on the page.

* 🐛 (Vector Store.spec.ts): fix clicking on "Playground" element by selecting the last one to avoid ambiguity

*  (generalBugs-shard-9.spec.ts): add click action on the last element with test id "title-Prompt" to improve test coverage and interaction with the page

---------

Co-authored-by: anovazzi1 <otavio2204@gmail.com>
Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
2024-10-01 16:26:18 +00:00
Mike Fortman
e63c377283
fix: Only show error state on components w/ errors for node validation (#3968)
* Only show error state on components w/ errors for node validation

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-10-01 10:22:31 -05:00
Lucas Oliveira
855694208e
fix: update docs link (#3966)
Fix docs link
2024-09-30 20:29:32 +00:00
Ítalo Johnny
f873309004
fix: security file upload (#3923)
* fix: add check user authentication
* fix: add request body multipart boundary validation
2024-09-30 19:14:03 +00:00
Mike Fortman
e1816246b5
feat: add env support for Astra Db components (#3908)
* add env support for Astra Db components

* [autofix.ci] apply automated fixes

* use parse_api_endpoint

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes

* quick cleanup

* merge

* package lock

* reset templates

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-09-27 16:00:31 -05:00
Cristhian Zanforlin Lousa
ef11e98c8f
fix: force floatInputComponent to send Number (#3953)
🔧 (floatComponent/index.tsx): update handleChange function to convert input value to a number before passing it to onChange function
2024-09-27 20:41:58 +00:00
Cristhian Zanforlin Lousa
6db15255a5
feat: improve file uploader size validation - custom hook (#3952)
* 📝 (inputFileComponent/index.tsx): add useFileSizeValidator hook to validate file size before upload to improve code readability and maintainability

* 📝 (chatInput/index.tsx): remove unused imports and refactor file size validation to use a custom hook for better code organization and readability

* 📝 (FileInput/index.tsx): refactor file input component to use a custom hook for file size validation instead of utility store
🔧 (FileInput/index.tsx): remove dependency on utility store for max file size upload and use a custom hook for file size validation instead

*  (use-file-size-validator.tsx): introduce a new custom hook useFileSizeValidator to validate file size before uploading it
2024-09-27 18:01:16 +00:00
Cristhian Zanforlin Lousa
8facb67944
tests: improve tests of store (#3949)
 (store-shard-1.spec.ts): Improve test case for liking and adding components and flows by adding more specific selectors and reducing timeout durations for better performance and reliability
 (store-shard-3.spec.ts): Enhance test case for filtering by type by adding more specific selectors and reducing timeout durations for better performance and reliability
2024-09-27 16:39:39 +00:00
Cristhian Zanforlin Lousa
948b150946
feat: truncate parsed uploads to prevent database and frontend blocking caused by excessively large files (#3914)
* 📝 (constants.ts): increase maxSizeFilesInBytes constant value from 10MB to 100MB to allow larger file uploads

* 🐛 (inputFileComponent): fix bug in setting the maximum file size alert message to display the correct file size limit of 100 bytes instead of 10 bytes

* 📝 (schemas.py): Add a new field_serializer method to serialize data in VertexBuildResponse class
📝 (schemas.py): Add a new truncate_text helper function to safely truncate text in nested dictionaries
📝 (model.py): Add a new field_serializer method to serialize outputs in TransactionBase class
📝 (model.py): Add a new truncate_text helper function to safely truncate text in nested dictionaries
📝 (model.py): Add a new field_serializer method to serialize data and artifacts in VertexBuildBase class
📝 (model.py): Add a new truncate_text helper function to safely truncate text in nested dictionaries

* 🐛 (schemas.py): fix truncation length of text fields to 10 characters instead of 99999
🐛 (model.py): fix truncation length of text fields to 10 characters instead of 99999
🐛 (model.py): fix truncation length of text fields to 10 characters instead of 99999
🐛 (index.tsx): truncate resultMessage to 99999 characters and add message if text is too long

* 🔧 (switchOutputView/index.tsx): Use useMemo to memoize resultMessage transformations for performance optimization

* 🐛 (model.py): Fix typo in the path for 'base_retriever' data field
🐛 (model.py): Fix typo in the path for 'base_retriever' data field
🐛 (model.py): Fix typo in the path for 'base_retriever' data field
🐛 (model.py): Fix typo in the path for 'base_retriever' data field
🐛 (index.tsx): Fix logic to correctly handle resultMessageMemoized when it is an object

* 📝 (model.py): refactor truncate_text function to truncate_long_strings for better clarity and consistency
📝 (model.py): update serialize_outputs and serialize_artifacts functions to use truncate_long_strings for string truncation
📝 (model.py): introduce MAX_TEXT_LENGTH constant for defining the maximum length of text to truncate in the models

* 📝 (schemas.py): refactor serialize_data method in VertexBuildResponse class to use a new helper function truncate_long_strings for better code readability and maintainability

* 🔧 (schemas.py): Move the `truncate_long_strings` function to a separate module to improve code organization and reusability
🔧 (model.py): Import the `truncate_long_strings` function from the correct module to fix the reference error
🔧 (model.py): Import the `truncate_long_strings` function from the correct module to fix the reference error

* 📝 (util.py): add function truncate_long_strings to recursively truncate long strings in dictionaries and lists to prevent exceeding the maximum text length.

* 📝 (constants.py): add constant MAX_TEXT_LENGTH with value 99999 for defining maximum text length allowed in the application

* 📝 (model.py): update import path for truncate_long_strings function to match new location in util module

*  (test_truncate_long_strings_on_objects.py): Add unit tests for the function truncate_long_strings to ensure correct behavior when truncating long strings in various data structures
🐛 (switchOutputView/index.tsx): Fix truncation logic to correctly truncate long strings by adding ellipsis at the end instead of displaying additional text about truncation.

* [autofix.ci] apply automated fixes

*  (test_truncate_long_strings_on_objects.py): Update import path for truncate_long_strings function
📝 (test_truncate_long_strings_on_objects.py): Add additional tests for handling negative, zero, and small max_length values in truncate_long_strings function

* ♻️ (schemas.py): refactor import statement to use the updated module name util_strings instead of util for better clarity and consistency.

* 📝 (model.py): Update import path for util_strings module to fix module import error
📝 (util.py): Remove redundant code for truncating long strings and move it to a separate util_strings module for better organization and separation of concerns.

* 📝 (schemas.py): refactor serialize_data method to handle both BaseModel and non-BaseModel data inputs in VertexBuildResponse class

* 📝 (util_strings.py): Update util_strings.py to improve string truncation function for dictionaries and lists
🔧 (test_truncate_long_strings_on_objects.py): Update test cases for string truncation function to cover additional scenarios and edge cases

* Update src/backend/base/langflow/utils/util_strings.py

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

* 📝 (vite.config.mts): update environment variable MAX_FILE_SIZE to be defined in vite config for frontend to use in the application.

* 📝 (constants.ts): update maxSizeFilesInBytes constant to use process.env.MAX_FILE_SIZE environment variable for configurable file size limit
📝 (constants.ts): add MAX_TEXT_LENGTH constant with a value of 99999 for maximum text length limit

* 📝 (switchOutputView/index.tsx): import MAX_TEXT_LENGTH constant from shared constants file to improve code organization and reusability

*  (langflow/__main__.py): add support for defining maximum file size for upload in MB to improve user experience and prevent large file uploads

* 🐛 (files.py): add validation to check if uploaded file size exceeds the maximum allowed size before processing it

*  (schemas.py): add max_file_size_upload field to ConfigResponse schema to handle maximum file size allowed for upload

* 🔧 (vite.config.mts): remove MAX_FILE_SIZE environment variable configuration as it is no longer needed

*  (base.py): introduce max_file_size_upload setting to limit the file size for uploads in MB

* 🐛 (util.py): add support for setting max_file_size_upload in update_settings function to allow configuring maximum file size for uploads

* 📝 (inputFileComponent/index.tsx): add support for retrieving max file size upload from utility store to improve code modularity and reusability
🐛 (inputFileComponent/index.tsx): fix error handling logic to display error message when uploading a file fails

* 📝 (constants.ts): remove maxSizeFilesInBytes constant as it is no longer used and update MAX_TEXT_LENGTH constant to a higher value

*  (use-get-config.ts): add functionality to set max file size upload value from config response

*  (utilityStore.ts): introduce maxFileSizeUpload property and setMaxFileSizeUpload function to handle maximum file size upload in bytes

*  (frontend): introduce maxFileSizeUpload property and setMaxFileSizeUpload method to handle maximum file size upload functionality in the UtilityStoreType

* ♻️ (util_strings.py): refactor truncate_long_strings function to improve code readability and consistency by removing unnecessary whitespace and aligning assignment operators.

* 🐛 (files.py): fix formatting issue in the raise statement to improve code readability and maintain consistency

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-09-27 15:44:05 +00:00
Gabriel Luiz Freitas Almeida
b34a7c7f02
fix: Handle group nodes in graph sorting (#3929)
* Fix: Handle group nodes in graph sorting

- Added `get_root_of_group_node` function to identify the root of a group node.
- Updated `sort_up_to_vertex` to use `get_root_of_group_node` for handling group nodes.
- Modified `__filter_vertices` to pass `parent_node_map` to `sort_up_to_vertex`.

* Refactor: Update NodeStatus component to handle group nodes and improve build status handling

* [autofix.ci] apply automated fixes

* Update type hint for parent_node_map in sort_up_to_vertex function

---------

Co-authored-by: anovazzi1 <otavio2204@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-09-27 15:26:20 +00:00
Cristhian Zanforlin Lousa
3ddd123b66
feat: add dynamic metadata to components + search on sidebar (#3945)
*  (frontend_node/base.py): add metadata attribute to store additional information for the component node

*  (constants.py): add 'metadata' attribute to NODE_FORMAT_ATTRIBUTES list to include additional metadata information for nodes in the application.

* 📝 (attributes.py): add new function getattr_return_dict to return a dictionary if the value is of type dict, otherwise return an empty dictionary. Update ATTR_FUNC_MAPPING to include the new function for the "metadata" attribute.

* update basic examples

* 📝 (extraSidebarComponent/index.tsx): refactor handleSearchInput function to improve code readability and maintainability
🐛 (extraSidebarComponent/index.tsx): fix searchInMetadata function to correctly handle nested objects in metadata for search functionality

* 📝 (component.py): add _metadata attribute to CONFIG_ATTRIBUTES list to include it in the configuration attributes
2024-09-27 12:19:35 -03:00
anovazzi1
5dec9cca9b
fix: usePatchUpdateFlow to conditionally refetch queries based on the browser URL (#3915)
* fix usePatchUpdateFlow to conditionally refetch queries based on the browser URL, preventing unecessary request

* [autofix.ci] apply automated fixes

* Refactor PageComponent to remove unnecessary query using useQueryClient

* Refactor usePatchUpdateFlow to conditionally refetch queries based on the browser URL

* [autofix.ci] apply automated fixes

* Refactor PageComponent to remove unnecessary query using useQueryClient

* Implement query cache cleanup on MainPage unmount

* fix spelling

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-09-27 12:12:49 -03:00
anovazzi1
f906059a72
fix: animation of building edges on build stop (#3937)
fix: remove animation of builidng edges on build stop
2024-09-27 14:44:27 +00:00
Jordan Frazier
1bf6781dc4
fix: use init_subclass instead of metaclass to enforce decorator (#3942)
* Use init_subclass instead of metaclass to enforce decorator

* [autofix.ci] apply automated fixes

* fix imports

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-09-27 12:06:15 +00:00
Cristhian Zanforlin Lousa
232b0d7d00
fix: truncate text on filter to x icon fits the parent div (#3941)
🔧 (index.tsx): improve layout of sidebarFilterComponent to display type in a more readable way
2024-09-26 20:52:38 +00:00
Cristhian Zanforlin Lousa
11d0f4487b
fix: search for the parent category on sidebar (#3940)
* 📝 (extraSidebarComponent/index.tsx): refactor handleSearchInput function to use a normalizeString helper function for better code readability and maintainability

* ♻️ (extraSidebarComponent/index.tsx): remove unnecessary console.log statement from the code
2024-09-26 16:51:59 -03:00
anovazzi1
106a34d2ff
fix: unnecessary re-renders in PageComponent and update edgeTypes (#3917)
fix: Update edgeTypes in PageComponent to prevent unecessary re-renders and remove console alert
2024-09-26 04:27:10 -07:00
Cristhian Zanforlin Lousa
17fc2482a0
fix: "Start Here" button not working as expected + fe tests (#3910)
*  (general-bugs-shard-3909.spec.ts): add test case to ensure user can create a new flow by clicking on "Start Here" button

*  (componentsComponent/index.tsx): Add NewFlowModal component to allow users to create a new flow
📝 (componentsComponent/index.tsx): Update ComponentsComponent to handle opening and closing of NewFlowModal

*  (emptyComponent/index.tsx): refactor EmptyComponent to use useIsFetching hook from @tanstack/react-query for loading state and pass handleOpenModal as a prop to improve code readability and maintainability

*  (componentsComponent/index.tsx): refactor handleOpenModal function to improve code readability and maintainability
2024-09-25 19:31:45 +00:00
dependabot[bot]
44a78bd7cf
build(deps): bump rollup from 4.21.1 to 4.22.4 in /src/frontend (#3897)
Bumps [rollup](https://github.com/rollup/rollup) from 4.21.1 to 4.22.4.
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollup/rollup/compare/v4.21.1...v4.22.4)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-25 17:54:16 +00:00
Patrick Loeber
c567323413
feat: add AssemblyAI components (#3829)
* Add AssemblyAI components

* add icons

* [autofix.ci] apply automated fixes

* Add ruff 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-09-25 17:32:03 +00:00
Mike Fortman
8ed93654f2
feat: add tracking and custom param label (#3902)
* add tracking and custom param label

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-09-24 14:00:34 -05:00
dependabot[bot]
e0e54a3ed0
build(deps-dev): bump vite from 5.4.2 to 5.4.7 in /src/frontend (#3889)
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.4.2 to 5.4.7.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v5.4.7/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.4.7/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>
2024-09-24 06:49:52 -07:00
Yuqi Tang
34ef5f5964
Add undo/redo check (#3893)
* add check for other browsers

* [autofix.ci] apply automated fixes

* add command + zand y test

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-09-23 21:12:59 -03:00
anovazzi1
bf9ded5063
fix: Update class name in PageComponent (#3842)
* refactor: Update class name in PageComponent

* [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>
2024-09-23 15:28:52 +00:00
Cristhian Zanforlin Lousa
ad97ee9830
fix: image not been sent on ChatInputComponent during runtime of building a flow (#3862)
* refactor: Refactor file path rewriting logic

This commit refactors the logic for rewriting file paths in the `rewrite_file_path` function. The function now splits the file path by "/" and checks if it has at least two parts. If it does, it creates a consistent file path by concatenating the last two parts. If not, it returns the original file path. This change improves the consistency of file paths in the codebase.

Refactor the file path rewriting logic in the `rewrite_file_path` function.

* refactor: Refactor file path rewriting logic and treat file paths in InterfaceVertex

* Refactor file path rewriting logic and treat file paths in InterfaceVertex

* Refactor file path rewriting logic and treat file paths in InterfaceVertex

* Refactor file path rewriting logic and treat file paths in InterfaceVertex

*  (general-bugs-shard-3836.spec.ts): update test description to be more specific about the tool used for sending images on chat
📝 (general-bugs-shard-3836.spec.ts): remove unused import of readFileSync from fs module

*  (test_rewrite_file_path.py): add unit tests for the rewrite_file_path function to ensure correct behavior with various file path scenarios

* ♻️ (utils.py): refactor file_path function to handle both forward and backward slashes and extract file path after drive letter if present

* style: fix single quotes, commas, and spaces

---------

Co-authored-by: italojohnny <italojohnnydosanjos@gmail.com>
2024-09-23 12:19:09 -03:00
Cristhian Zanforlin Lousa
aa2578370b
fix: limit file upload size to 10mb to prevent LF crashing due data render component limitations (#3870)
* 🐛 (inputFileComponent/index.tsx): add check for file size before uploading to prevent uploading files larger than the maximum allowed size

*  (alerts_constants.tsx): add new constant INVALID_FILE_SIZE_ALERT to display an alert message when the file size is too large

*  (constants.ts): add constant maxSizeFilesInBytes to define the maximum file size allowed for upload in bytes

* 🐛 (inputFileComponent/index.tsx): update INVALID_FILE_SIZE_ALERT parameter from 9 to 10 to match the new file size limit
🐛 (constants/constants.ts): increase maxSizeFilesInBytes constant value from 9MB to 10MB to reflect the new file size limit
2024-09-20 18:33:02 -03:00
Cristhian Zanforlin Lousa
98c1f0e8aa
fix: fix building loop when renaming a folder and opening a new flow and running It (#3844)
* refactor: Add useIsFetching hook for folder fetching in DropdownButtonComponent

* refactor: Improve folder sidebar buttons component

Refactor the folder sidebar buttons component to improve its structure and readability. This includes adding a new hook for folder fetching, handling rendering and filtering functionality, and updating the UI for adding and uploading folders. The changes also include handling double-click and keydown events for folder items, as well as fixing some bugs related to folder editing and deleting. These improvements enhance the overall user experience and maintainability of the codebase.

* refactor: Remove unused import and variable in DropdownButtonComponent

* refactor: Remove unused import and variable in DropdownButtonComponent

- Remove unused import and variable in DropdownButtonComponent
- Add useIsFetching hook for folder fetching in DropdownButtonComponent

* refactor: Remove unused import and variable in DropdownButtonComponent
2024-09-18 20:13:47 -03:00
Lucas Oliveira
bad009c0fa
fix: update project description, update alerts animation, fix delete and duplicate loading (#3835)
* Deleted "personal" from manage your projects

* Removed animations from alerts on the dropdown

* Changed useDeleteFlow to return isPending as well

* Added delete loading to components and added filter of components not present in "flows" for deletion

* added isDuplicating as a isMutating with the postAddFlow
2024-09-18 13:30:49 +00:00
Cristhian Zanforlin Lousa
8c8be151e5
feat: add duckduckgo search component (#3798)
* 🔧 (pyproject.toml): add duckduckgo-search dependency to the project
 (DuckDuckGoSearchRun.py): introduce DuckDuckGoSearchComponent for performing web searches using DuckDuckGo search engine
 (DuckDuckGo.jsx): add SVG icon for DuckDuckGo
 (index.tsx): create DuckDuckGoIcon component for displaying DuckDuckGo icon
🔧 (styleUtils.ts): import DuckDuckGoIcon for nodeIconsLucide in styleUtils

* 📝 (DuckDuckGoSearchRun.py): remove unnecessary whitespace to improve code readability and consistency

*  (DuckDuckGoSearchRun.py): Add retry logic to DuckDuckGo search component for rate-limited requests
📝 (DuckDuckGoSearchRun.py): Update component description to reflect the addition of retry logic
📝 (DuckDuckGoSearchRun.py): Add new inputs for max_retries and initial_delay to configure retry behavior
📝 (DuckDuckGoSearchRun.py): Update search_response method to use search_with_retry method with retry logic
📝 (DuckDuckGoSearchRun.py): Update format_results method to handle formatted results
📝 (DuckDuckGoSearchRun.py): Add search_with_retry method to handle search with retry logic
📝 (DuckDuckGoSearchRun.py): Update search_response method to use search_with_retry method
📝 (DuckDuckGoSearchRun.py): Update search_response method to set status messages
📝 (DuckDuckGoSearchRun.py): Handle exceptions and set appropriate status messages in search_response method
 (duckduckgo.spec.ts): Add integration test for DuckDuckGo search component in frontend

* 📝 (DuckDuckGoSearchRun.py): add newline at the end of the file to follow best practices and avoid potential issues with some tools that expect it

* [autofix.ci] apply automated fixes

* updating duckudckgo

* [autofix.ci] apply automated fixes

*  (DuckDuckGoSearchRun.py): Refactor DuckDuckGoSearchComponent to use pydantic BaseModel for schema definition and improve code structure for better readability and maintainability. Add support for result limiting in search functionality.

* 🔧 (DuckDuckGoSearchRun.py): Remove unnecessary import and update status message for DuckDuckGo Search Tool to improve clarity

* [autofix.ci] apply automated fixes

*  (duckduckgo.spec.ts): update test selectors for duckduckgo search component to match changes in the frontend code and improve test reliability

* 🐛 (linkComponent.spec.ts): fix an issue where the key combination for selecting all text was not working correctly on Mac devices. Updated the key combination to use the correct modifier key based on the user's operating system.

* 📝 (frontend): mark is-unicode-supported package as extraneous in package-lock.json

* rollback lock file

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-09-17 16:39:17 -03:00
Cristhian Zanforlin Lousa
3e617acf2f
feat: Add New Link Parameter Type for External Links in Node UI (#3806)
*  (inputs/__init__.py): Add LinkInput class to support linking functionality in inputs
📝 (inputs/input_mixin.py): Add Link field type to support linking functionality in inputs
📝 (inputs/inputs.py): Add LinkInput class to support linking functionality in inputs
📝 (io/__init__.py): Import and export LinkInput class for linking functionality in inputs
📝 (frontend/src/components/linkComponent/index.tsx): Create LinkComponent to display and handle links in frontend components
📝 (frontend/src/components/parameterRenderComponent/index.tsx): Add support for rendering LinkComponent in parameter rendering based on template type
📝 (frontend/src/constants/constants.ts): Add "link" as a supported type for LANGFLOW_SUPPORTED_TYPES
📝 (frontend/src/types/api/index.ts): Add icon and text fields to InputFieldType for link component
📝 (frontend/src/types/components/index.ts): Define LinkComponentType for passing link data to LinkComponent

 (linkComponent.spec.ts): Add unit test for link component interaction to ensure proper functionality and behavior
📝 (unit-test-components.spec.ts): Add template for a unit test file to be used for testing components in the frontend application

* style: apply make format

* Update input_mixin.py

---------

Co-authored-by: italojohnny <italojohnnydosanjos@gmail.com>
2024-09-17 16:56:10 +00:00
Mike Fortman
d4bed03f9c
refactor: Move to LoadEnv in vite config (#3825)
use loadenv
2024-09-16 14:34:59 -05:00
Lucas Oliveira
3e11d8a64d
fix: vite config and routes to support no slashes, and api interceptor for fetch (#3824)
* Fix vite config and routes to support no slashes

* Added fetch intercept to add custom headers into fetch calls
2024-09-16 18:42:08 +00:00
Lucas Oliveira
2f1f1808b9
refactor: handle rendering and filtering functionality (#3512) 2024-09-13 17:27:30 -03:00
Mike Fortman
2bd5d4b911
feat: Update tracking (#3805)
* Update tracking

* [autofix.ci] apply automated fixes

* cleanup

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-09-13 13:01:06 -05:00
Lucas Oliveira
56802bada6
refactor: add custom banner and refactor pagelayout to include it (#3803)
* Added custom banner

* Refactored pageLayout to include custom banner
2024-09-13 17:29:19 +00:00
Lucas Oliveira
35c194e575
fix: json dark mode colors and dict component button view (#3802)
* Fix dark mode colors on jsonView

* Fix dict component button view

* Changed style of dict component button

* Changed parameter render to remove space on the bottom of the inputs that are only handles

* Fixed space below nodes
2024-09-13 16:34:58 +00:00