Commit graph

13,397 commits

Author SHA1 Message Date
Gabriel Luiz Freitas Almeida
ca98103af4
ci: add debug info (#2957)
* ci: add debug info

* fix: change echo commands
2024-07-25 16:51:57 +00:00
Gabriel Luiz Freitas Almeida
e0a0242d7a
refactor: update TelemetryService and change Service teardown methods to be async (#2937)
* refactor: convert teardown_services function to async

The `teardown_services` function in `utils.py` has been converted to an asynchronous function to ensure proper handling of asynchronous operations during service teardown. This change improves the overall reliability and performance of the codebase.

* refactor: convert teardown method to async

Convert the `teardown` method in the `Service` class to an asynchronous function to handle asynchronous operations during service teardown. This change improves the reliability and performance of the codebase.

* refactor: convert teardown methods to async in services

* feat: add teardown method in TelemetryService

Convert the `teardown` method in the `TelemetryService` class to an asynchronous function to handle asynchronous operations during service teardown. This change improves the reliability and performance of the codebase.

* refactor: update TelemetryService to use optimized payload in get request

The `TelemetryService` class in `service.py` has been updated to use an optimized payload dictionary in the `get` request. This change improves the efficiency and performance of the codebase.

* refactor: convert teardown method to async in utils.py
2024-07-25 12:49:43 +00:00
Gabriel Luiz Freitas Almeida
51b85dbc8e
fix: update path filter condition in ci.yml (#2947)
Update the path filter condition in ci.yml to use strict comparison for the 'should-run-ci' output value. This ensures that the CI job is only executed when the output value is 'true'.
2024-07-25 12:45:30 +00:00
Cristhian Zanforlin Lousa
44ffe8e6cd
refactor: change downloadFolders requests to use useQuery hook (#2920)
*  (sidebarComponent): Add support for downloading folders in the sidebar component to allow users to download folder data as JSON files
🔧 (sidebarComponent): Remove unused import and function related to downloading folders to clean up the codebase
📝 (use-get-download-folders): Add a new function to handle downloading folders from the API in a separate file for better code organization
♻️ (MainPage/services): Remove unused functions related to downloading and uploading flows from folders to simplify the services file and improve maintainability
🔧 (foldersStore): Remove unused import and function related to uploading flows from folders to clean up the codebase

* 📝 (sideBarFolderButtons/index.tsx): add error handling logic to display error message when downloading folder fails

* update error message

---------

Co-authored-by: anovazzi1 <otavio2204@gmail.com>
2024-07-25 01:25:27 +00:00
Gabriel Luiz Freitas Almeida
7d5ccb324a
fix: validate params assignment in custom_component_update endpoint (#2931)
* feat(RunFlow.py): update input and output definitions for RunFlowComponent

* refactor: update params assignment in custom_component_update endpoint

Simplify the params assignment in the custom_component_update endpoint by using a dictionary comprehension. This improves code readability and reduces the number of lines.

* feat(custom_component.py, flow.py): add support for specifying output type in run_flow method to filter outputs based on type
2024-07-25 00:33:05 +00:00
Gabriel Luiz Freitas Almeida
a22b76534b
fix: update button role in end-to-end test (#2936)
refactor: update button role in end-to-end test

Update the button role in the end-to-end test to use "Check & Save" instead of "Save".
2024-07-24 17:16:08 -07:00
Sai Kolasani
23b54a63c1
fix: Ollama model component parameter (#2935)
change params from model to model_name"

Co-authored-by: Sai Kolasani <sai.kolasani@datastax.com>
2024-07-24 23:50:58 +00:00
Injae Ryou
23e06fe882
docs: add Korean README (#2883) 2024-07-24 23:27:39 +00:00
Gabriel Luiz Freitas Almeida
459a80c983
ci: fix set-ci-condition job (#2934)
* chore(ci.yml): refactor CI workflow to include a new job 'set-ci-condition' to determine if CI should run based on conditions such as pull request labels and event type

* refactor: include new job 'set-ci-condition' in CI workflow to determine if CI should run based on conditions
2024-07-24 14:40:33 -07:00
Gabriel Luiz Freitas Almeida
950aac1cce
ci: update CI workflow to include new job 'set-ci-condition' (#2933)
chore(ci.yml): refactor CI workflow to include a new job 'set-ci-condition' to determine if CI should run based on conditions such as pull request labels and event type

Co-authored-by: Lucas Oliveira <62335616+lucaseduoli@users.noreply.github.com>
2024-07-24 14:33:29 -07:00
github-actions[bot]
384f622f48
docs: update docs from notion (#2922)
Update docs from Notion

Co-authored-by: lucaseduoli <lucaseduoli@users.noreply.github.com>
2024-07-24 21:22:39 +00:00
Lucas Oliveira
00df8f8405
fix: python code with null and undefined (#2932)
Updated pythonCode to include None as replacement to null and undefined
2024-07-24 21:09:55 +00:00
Lucas Oliveira
ce7418a688
bug: starter rag example didnt contain connection from rag to template (#2930)
* Changed starter example Vector Store RAG

* Formatted example
2024-07-24 17:52:32 -03:00
Cristhian Zanforlin Lousa
6c5b487e47
refactor: change post/patch folders requests to use UseQuery (#2917)
*  (sidebarComponent): Add usePostFolders hook to handle adding new folders in the sidebar
📝 (folders): Add use-post-folders and use-patch-folders hooks for handling post and patch requests for folders
🔧 (BundleModal): Remove useFolderSubmit hook and directly use usePostFolders hook for adding and updating folders in the modal

*  (sidebarComponent): Add usePatchFolders hook to handle updating folders in the sidebar component
🔧 (use-patch-folders): Refactor IPatchAddFolders interface to IPatchPatchFolders for better naming consistency
🔧 (use-patch-folders): Refactor addFoldersFn to patchFoldersFn for better function naming
🔧 (use-patch-folders): Update patchFoldersFn to send patch request to specific folder endpoint
🔧 (use-patch-folders): Update patchFoldersFn to handle updating folders and return updated data
🔧 (use-patch-folders): Update usePatchFolders hook to use patchFoldersFn for mutation
🔧 (use-post-folders): Remove unnecessary call to getFoldersApi after posting folders
🔧 (BundleModal): Remove BundleModal component and entities as they are no longer needed

🔧 (BundleModal/index.tsx): Remove unused imports and clean up code
🔧 (foldersModal/component/index.tsx): Remove unused imports and clean up code
🔧 (foldersModal/entities/index.ts): Remove unused zod schema and clean up code
🔧 (foldersModal/hooks/submit-folder.tsx): Remove unused imports and clean up code

 (foldersModal/index.tsx): Remove unused FoldersModal component from modalsComponent to optimize code and improve maintainability.

* 📝 (index.tsx): Remove unused openFolderModal and setOpenFolderModal props from ModalsComponent
♻️ (services/index.ts): Remove addFolder, updateFolder, and deleteFolder functions as they are not used in the application
♻️ (foldersStore.tsx): Remove unused import statements for uploadFlowsFromFolders from services and related functions

* 📝 (index.tsx): replace async/await with synchronous function call to refresh folders after successful operation
2024-07-24 18:57:31 +00:00
dependabot[bot]
8f678de217
chore(deps): bump langchain-community from 0.2.7 to 0.2.9 (#2925)
Bumps [langchain-community](https://github.com/langchain-ai/langchain) from 0.2.7 to 0.2.9.
- [Release notes](https://github.com/langchain-ai/langchain/releases)
- [Commits](https://github.com/langchain-ai/langchain/compare/langchain-community==0.2.7...langchain-community==0.2.9)

---
updated-dependencies:
- dependency-name: langchain-community
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-24 18:32:56 +00:00
Ítalo Johnny
e318694366
refactor: vertex instantiation (#2703)
* style: handle whitespaces around colons

* refactor: split a func into two

* refactor: update code to use newly created funcs

* refactor: merge code of one func into another

* refactor: rename func

* refactor: extract code segment to parent func

* refactor: extract code segment to parent func

* refactor: rename func

* refactor: rename object

* refactor: extract code segment into a new func

* feat: add condition to determine how the vertex is built

* fix: modify component initialization call
2024-07-24 18:28:53 +00:00
Carlos Coelho
0ac67a9e89
chore(template): adjust bug report template to include screenshot and WIP sections (#2899)
* Update bug-report.yaml

* Update bug-report.yaml

* Update feature-request.yaml

* Create work-in-progress.yaml
2024-07-24 11:13:22 -07:00
Cristhian Zanforlin Lousa
544e763c2d
test: improve test to allow any errors checks (#2926)
🐛 (generalBugs-shard-6.spec.ts): fix test assertion to check for error message length greater than 20 instead of 50 for improved accuracy
2024-07-24 18:13:01 +00:00
anovazzi1
4c3ec04dcb
enhancement: Add function to check broken edges (#2882)
* chore: create new function to check broken edges

* enhancement: add edges check when a new flow is added

* [autofix.ci] apply automated fixes

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

* refactor: update BROKEN_EDGES_WARNING message to use "connections" instead of "edges"

* [autofix.ci] apply automated fixes

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

* update function name

* refactor: improve error handling in detectBrokenEdgesEdges function

* remove console.log

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: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-07-24 17:02:48 +00:00
Cezar Vasconcelos
7ca1d84596
feat: add method and refresh button to fetch Groq models (#2902)
* feat: add method and refresh button to fetch Groq models

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-07-24 08:56:20 -07:00
anovazzi1
007c38afed
feat: add new node Input type for data in table format (#2635)
* feat: add Table component and related functionality

This commit adds the Table component and related functionality to the codebase. The Table component is used to display tabular data and includes features such as pagination, row deletion, row duplication, and adding new rows. The TableOptions component is also added to provide options for resetting the grid and adding new rows. Additionally, the necessary types and interfaces are updated to support the Table component. This feature enhances the user experience by allowing them to interact with tabular data in a more intuitive way.

* feat: add Edit Data trigger to TableNodeComponent

* [autofix.ci] apply automated fixes

* feat: add TableSchema class for defining table structure

* feat: add TableMixin class for table-related functionality

* feat: add TableInput class for table-related functionality

* feat: add TableInput to io module

* feat: update Column model in table schema

This commit updates the `Column` model in the table schema to include the `display_name` and `name` fields instead of `header` and `field`. It also adds validation for the `formatter` field to accept either a `FormatterType` enum value or a string. This change improves the clarity and flexibility of the table schema.

* feat: add displayEmptyAlert prop to TableComponent

This commit adds the `displayEmptyAlert` prop to the `TableComponent` in order to control whether an alert is displayed when the table has no data. By default, the alert will be shown, but it can be disabled by setting `displayEmptyAlert` to `false`. This feature enhances the flexibility of the table component by allowing users to customize the behavior when there are no rows in the table.

* This commit improves the TableAutoCellRender component by adding support for a custom formatter. The formatter can be specified as a prop and allows for rendering the cell value in different formats, such as JSON. This enhancement enhances the flexibility and customization options of the TableAutoCellRender component.

* feat: add FormatColumns function to utils.ts

This commit adds the `FormatColumns` function to `utils.ts` file. The function takes an array of `ColumnField` objects and returns an array of `ColDef` objects. It maps each `ColumnField` to a `ColDef` with properties like `headerName`, `field`, `sortable`, and `filter`. If a `ColumnField` has a `formatter` property, it sets the `cellDataType` or `cellRendererParams` accordingly. This function enhances the flexibility and customization options for formatting columns in the table.

* feat: enhance TableNodeComponent with FormatColumns function

This commit enhances the TableNodeComponent by utilizing the FormatColumns function from utils.ts. The FormatColumns function takes an array of ColumnField objects and returns an array of ColDef objects, allowing for flexible and customizable column formatting in the table. By integrating this function, the TableNodeComponent now has improved column handling capabilities.

* chore: Update TableNodeComponent and TableComponent

This commit updates the TableNodeComponent and TableComponent to improve column handling and customization options. The TableNodeComponent now utilizes the FormatColumns function from utils.ts, allowing for flexible and customizable column formatting in the table. The TableComponent now has a new prop, displayEmptyAlert, which controls whether an alert is displayed when the table has no data. These enhancements enhance the flexibility and customization options of the table components.

* [autofix.ci] apply automated fixes

* feat: Update TableNodeComponent and TableComponent

This commit updates the TableNodeComponent and TableComponent to improve column handling and customization options. It utilizes the FormatColumns function from utils.ts for flexible and customizable column formatting in the table. The TableComponent now has a new prop, displayEmptyAlert, to control the display of an alert when the table has no data. These enhancements enhance the flexibility and customization options of the table components.

* feat: initialize table field values as DataFrame

* feat: Enhance TableNodeComponent with duplicateRow function

This commit enhances the TableNodeComponent by adding the duplicateRow function. This function allows users to duplicate selected rows in the table. When called, it clones the selected nodes and adds the duplicated rows to the table. This feature enhances the flexibility and customization options of the TableNodeComponent.

* [autofix.ci] apply automated fixes

* feat: Remove "text" from basic_types in FormatColumns function

This commit removes the "text" value from the basic_types set in the FormatColumns function in utils.ts. The basic_types set is used to determine the column type for formatting in the table. By removing "text", we ensure that only "date" and "number" types are considered as basic types. This change improves the accuracy and consistency of column formatting in the table.

* fix: alingment bug on AgGrid cell

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes

* Styled the Open Table button on TableNodeComponent

* Fixed type of ref on tableComponent

* Creaed a TableModal component, that receives the props that are passed to the Table, as well as a title, and creates a modal

* Used the TableModal on the TableNodeComponent

* Fixed looks of TableModal

* Added description set on tableModal

* Add description field to TableNodeComponent

* Fixed text of description if info is not provided

* Added TableComponent in tableNodeCellRenderer

* Added styling based on editNode

* Added Auto Size to table modal

* refactor: update TableOptions component styling and behavior

- Update TableOptions component to dynamically apply text color based on selection
- Remove unnecessary console.log statement
- Improve hover behavior for the Trash2 icon

* chore: Remove unnecessary imports and initialize empty columns array in TableNodeComponent

* feat: Add default values for sortable and filterable in Column model

The code changes in `table.py` modify the `Column` model in the `langflow.schema` module. The `sortable` and `filterable` attributes of the `Column` model now have default values of `True`. This change ensures that new instances of the `Column` model will have these attributes set to `True` by default.

Based on the recent user commits and repository commits, the commit message follows the established convention of using a prefix to indicate the type of change (`feat` for a new feature) and provides a clear and concise description of the changes made.

* feat(utils.ts): add check for empty columns array in FormatColumns function to prevent errors

* feat: Add validation for TableInput value in inputs.py

The code changes in `inputs.py` add a validation function for the `value` attribute of the `TableInput` class. The function checks if the value is a list of dictionaries and raises a `ValueError` if it is not. This ensures that the `TableInput` instances have a valid value that is a list of dictionaries.

Based on the recent user commits and repository commits, the commit message follows the established convention of using a prefix to indicate the type of change (`feat` for a new feature) and provides a clear and concise description of the changes made.

* [autofix.ci] apply automated fixes

* feat: extend editable field to json field

* [autofix.ci] apply automated fixes

* feat: Add validation for TableInput value in inputs.py

* feat(validate.py): add exception handling to catch and re-raise ValidationError with a more informative error message

* chore: Refactor error message in build_custom_component_template function

* fix(validate.py): improve error message formatting in create_class function

Refactor the error message formatting in the `create_class` function in `validate.py` to improve readability and clarity. Instead of using a list comprehension to extract the error messages, the code now uses a nested list comprehension to split the error messages and extract the relevant information. This change ensures that the error message is properly formatted and provides more informative details about the validation errors.

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: Lucas Oliveira <lucas.edu.oli@hotmail.com>

* feat: Update TableMixin to support TableSchema or list of Columns

The TableMixin class in input_mixin.py has been updated to support either a TableSchema object or a list of Columns for the table_schema attribute. This change allows for more flexibility in defining the table schema for input validation.

* feat: Update TableNodeComponent to generate backend columns from value

Refactor the TableNodeComponent to generate backend columns from the value when the columns prop is not provided. This change ensures that the component can handle dynamic column generation based on the value, improving flexibility and usability.

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: Lucas Oliveira <lucas.edu.oli@hotmail.com>

* Refactor extractColumnsFromRows function to return only ColDef objects

The extractColumnsFromRows function in utils.ts has been refactored to return only ColDef objects instead of a combination of ColDef and ColGroupDef objects. This change simplifies the function's return type and improves consistency in the codebase.

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: Lucas Oliveira <lucas.edu.oli@hotmail.com>

* [autofix.ci] apply automated fixes

* refactor: Generate backend columns from value in TableNodeComponent

Refactor the TableNodeComponent to generate backend columns from the value when the columns prop is not provided. This change ensures that the component can handle dynamic column generation based on the value, improving flexibility and usability.

* feat: Update TableNodeComponent to handle number and date properly

* fix bug that delete all rows on modal close

* [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>
Co-authored-by: Lucas Oliveira <lucas.edu.oli@hotmail.com>
2024-07-24 06:20:58 -07:00
Cristhian Zanforlin Lousa
18dfd9a3d6
refactor: add useQuery to delete folder api requests (#2901)
* 🐛 (generalBugs-shard-5.spec.ts): fix test to wait for elements to be interactable before performing actions to prevent flakiness

*  (editFlowSettingsComponent): Add padding top class to improve styling of the component

📝 (folders/index.tsx): Add use-delete-folders query to handle deletion of folders

📝 (folders/use-delete-folders.ts): Create useDeleteFolders hook to handle deletion of folders

📝 (mainPage/index.tsx): Import useDeleteFolders hook and implement handleDeleteFolder function to delete folders and show success/error messages

* 🔧 (use-delete-folder.tsx): Remove unused file use-delete-folder.tsx
🔧 (mainPage/index.tsx): Remove import of use-delete-folder hook as it is no longer used
2024-07-23 19:28:03 -03:00
anovazzi1
ae5f8714b2
chore: Update langflow-embedded-chat to v1.0.4 (#2900)
chore: update langflow-embedded-chat to v1.0.4 in getWidgetCode.tsx
2024-07-23 18:57:22 +00:00
Cristhian Zanforlin Lousa
c83006e066
bugfix: add returning promises on interceptor errors + tests (#2896)
* 🐛 (generalBugs-shard-5.spec.ts): fix test to wait for elements to be interactable before performing actions to prevent flakiness

* 📝 (API/api.tsx): return error in promise rejection to handle errors properly
📝 (codeAreaModal/index.tsx): add data-testid attribute to title element for testing purposes
 (generalBugs-shard-6.spec.ts): add end-to-end test for error handling in Code Modal

* 📝 (generalBugs-shard-6.spec.ts): update test description for better clarity and grammar
2024-07-23 15:33:48 -03:00
Cristhian Zanforlin Lousa
7ffcdd2b68
bugfix: filter flows on folder to ensure is displaying only for the logged user (#2897)
* 🐛 (generalBugs-shard-5.spec.ts): fix test to wait for elements to be interactable before performing actions to prevent flakiness

* 🐛 (folders.py): fix issue where all flows were being returned instead of only flows from the current user in the specified folder
2024-07-23 14:06:16 -03:00
anovazzi1
b7bc36d32a
refactor: authentication logic and move isAdmin to zustand store (#2888)
* refactor: remove isAuthenticated from context and move it to zustand store

* [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 <72977554+Cristhianzl@users.noreply.github.com>
2024-07-23 14:59:13 +00:00
Cristhian Zanforlin Lousa
61265cc327
feat: change download flows to download as .zip file (#2870)
* 📝 (flows.py): Add endpoint to download multiple flows as a zip file
📝 (constants.ts): Add FLOWS constant for API endpoint
📝 (index.ts): Add use-post-download-multiple-flows query function
📝 (use-post-download-multiple-flows.ts): Implement function to download multiple flows as a zip file
📝 (index.tsx): Import usePostDownloadMultipleFlows in componentsComponent
📝 (index.tsx): Implement handleExport function to download multiple flows as a zip file
📝 (index.tsx): Update handleExport function to handle downloading and saving the zip file
📝 (headerComponent.tsx): Add shouldSelectAll state and setShouldSelectAll function to manage select all functionality

* formatting file

* 📝 (flows.py): Remove download_file endpoint and refactor download_multiple_file to support downloading multiple flows as a zip file
📝 (index.tsx): Refactor export functionality to handle exporting multiple flows as a zip file or a single flow as a JSON file
🔧 (use-post-download-multiple-flows.ts): Update API endpoint for downloading flows
🔧 (index.tsx): Remove unused imports and functions related to exporting flows
🔧 (reactflowUtils.ts): Remove unused downloadFlows function and related imports

* [autofix.ci] apply automated fixes

* 📝 (flows.py): remove unnecessary whitespace and improve code readability by aligning function parameters in download_multiple_file function

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-07-23 14:41:55 +00:00
dependabot[bot]
2db87e89bf
chore(deps): bump ag-grid-community from 31.3.2 to 32.0.0 in /src/frontend (#2650)
chore(deps): bump ag-grid-community in /src/frontend

Bumps [ag-grid-community](https://github.com/ag-grid/ag-grid) from 31.3.2 to 32.0.0.
- [Release notes](https://github.com/ag-grid/ag-grid/releases)
- [Commits](https://github.com/ag-grid/ag-grid/compare/v31.3.2...v32.0.0)

---
updated-dependencies:
- dependency-name: ag-grid-community
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-23 06:53:03 -07:00
Nicolò Boschi
8145d91f7d
fix: frontend image should forward /health_check to backend (#2887) 2024-07-23 15:08:43 +02:00
Cristhian Zanforlin Lousa
65acbd50a3
feat: Refactor Upload Folders to Use Mutations for HTTP Request Management (#2810)
*  (frontend): Add new API queries for user authentication and messages handling
📝 (frontend): Update API queries for user authentication to include new functionalities like logout, reset password, update user, add user, login user, and refresh access token
📝 (frontend): Update API queries for messages to change the update messages functionality to use PUT method instead of PATCH

*  (sideBarFolderButtons/index.tsx): Add usePostUploadFolders query to handle uploading folders and files
🔧 (constants.ts): Add FOLDERS constant to API URLs for folder-related endpoints
🔧 (folders/index.tsx): Add use-post-upload-folders query to handle uploading folders and files

🔧 (use-update-messages.ts): Remove unused file use-update-messages.ts to clean up the project
🔧 (foldersStore.tsx): Remove unused uploadFolder function to improve code maintainability and reduce complexity
🔧 (folders/index.ts): Remove unused uploadFolder function to simplify the codebase and improve readability

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-07-23 09:16:42 -03:00
anovazzi1
90508b25e5
refactor: move isAuthenticated from context to zustand store" (#2845)
* remove isAuthenticated from context and move it to zustand store

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes

* refactor: fix authentication logic in authStore.ts

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-07-22 22:28:51 +00:00
Cristhian Zanforlin Lousa
ae096a3167
test: add new tests based on new basic examples + vector store tests (#2879)
* 🔧 (.github/workflows/typescript_test.yml): add BRAVE_SEARCH_API_KEY secret to workflow environment variables
 (frontend/src/modals/IOModal/components/chatView/chatMessage/index.tsx): add data-testid attribute to div element for testing purposes
 (frontend/tests/end-to-end/Hierarchical Tasks Agent.spec.ts): add end-to-end test for Hierarchical Tasks Agent
 (frontend/tests/end-to-end/Sequential Tasks Agent.spec.ts): add end-to-end test for Sequential Tasks Agent

* updating hierarchical task json

* 🔧 (.github/workflows/typescript_test.yml): add secrets for ASTRA_DB_APPLICATION_TOKEN and ASTRA_DB_API_ENDPOINT
♻️ (playwright.config.ts): refactor timeout value to 3 minutes
📝 (Complex Agent.spec.ts): update test to use BRAVE_SEARCH_API_KEY instead of OPENAI_API_KEY
📝 (Complex Agent.spec.ts): update test to use "apple" instead of "agile"
📝 (Hierarchical Tasks Agent.spec.ts): update test to use "langflow" instead of "agile"
📝 (Sequential Tasks Agent.spec.ts): update test to use waitForTimeout instead of isVisible

 (Vector Store.spec.ts): Add checks to skip tests if required environment variables are not set
🔧 (Vector Store.spec.ts): Update test logic to fill in required environment variables before running tests to ensure proper test execution
2024-07-22 21:30:30 +00:00
Igor Carvalho
9ecf101449
fix: shortcuts settings page button spacing (#2859)
Co-authored-by: anovazzi1 <otavio2204@gmail.com>
Co-authored-by: Cristhian Zanforlin Lousa <72977554+Cristhianzl@users.noreply.github.com>
2024-07-22 18:09:53 -03:00
Cristhian Zanforlin Lousa
7007c05a08
test: fix output group preview test to be interactive (#2880)
* 🐛 (generalBugs-shard-5.spec.ts): fix test to wait for elements to be interactable before performing actions to prevent flakiness

* change temperature on canvas beside on component
2024-07-22 20:50:07 +00:00
Gabriel Luiz Freitas Almeida
77cc789e62
refactor: separate initialization of nodes and edges in test_graph.py (#2828)
* refactor: move test_graph.py

* refactor: allow Graph to be initialized with no nodes and edges

The Graph class in `base.py` was refactored to separate the initialization of nodes and edges into a separate method called `add_nodes_and_edges()`. This improves code readability and maintainability by organizing the code logic more effectively.

* refactor: separate initialization of nodes and edges in get_graph()

The `get_graph()` function in `conftest.py` was refactored to separate the initialization of nodes and edges. This improves code readability and maintainability by organizing the code logic more effectively.

* refactor: separate initialization of nodes and edges in test_graph.py

* refactor: separate initialization of nodes and edges in base.py

The `add_node()` and `add_edge()` methods were added to the `Graph` class in `base.py` to separate the initialization of nodes and edges. This improves code readability and maintainability by organizing the code logic more effectively.
2024-07-22 16:48:29 -03:00
Jordan Frazier
077f68f17b
fix: add checkout action to integration test workflow (#2869) 2024-07-22 11:34:33 -07:00
Gabriel Luiz Freitas Almeida
767a57d4de
refactor: update import statements in run.py (#2876)
* refactor: update import statements in create_assistant.py

Refactor the import statements in the create_assistant.py file to improve readability and maintainability. Update the import order and add type hints for better code organization. This change ensures consistency with the recent repository commits and follows established conventions.

* refactor: update import statements in create_thread.py

Refactor the import statements in the create_thread.py file to improve readability and maintainability. Update the import order and add type hints for better code organization. This change ensures consistency with the recent repository commits and follows established conventions.

* refactor: improve dotenv component

Refactor the dotenv component to improve code organization and error handling. Update the import statements and add type hints for better readability and maintainability. This change ensures consistency with recent repository commits and follows established conventions.

* refactor: update import statements in get_assistant.py

Refactor the import statements in the get_assistant.py file to improve readability and maintainability. Update the import order and add type hints for better code organization. This change ensures consistency with the recent repository commits and follows established conventions.

* refactor: update import statements in list_assistants.py

Refactor the import statements in the list_assistants.py file to improve readability and maintainability. Update the import order and add type hints for better code organization. This change ensures consistency with the recent repository commits and follows established conventions.

* refactor: update import statements in run.py

Refactor the import statements in the run.py file to improve readability and maintainability. Update the import order and add type hints for better code organization. This change ensures consistency with the recent repository commits and follows established conventions.
2024-07-22 18:28:39 +00:00
Gabriel Luiz Freitas Almeida
d8a90f6bb5
chore: update dependencies and add lock step in py_autofix.yml (#2875)
* chore: lock dependencies without updating in Makefile

Lock the dependencies without updating them in the Makefile. This ensures that the dependencies remain at their current versions and prevents any unintended changes in compatibility or functionality.

* chore: update dependencies and add lock step in py_autofix.yml

Update the dependencies in the py_autofix.yml workflow file to include a new step for checking the Poetry lock file. This ensures that the dependencies are locked and prevents any unintended changes in compatibility or functionality. The lock step is added to the existing workflow to ensure that the Poetry lock file is checked and updated if necessary.
2024-07-22 11:19:10 -07:00
Jordan Frazier
9dadfd45b1
ref: refactors the agents around and fixes a few bugs (#2847) 2024-07-22 18:06:37 +00:00
Gabriel Luiz Freitas Almeida
a4d6f4ff5b
chore: bump langflow and langflow-base to 1.0.12 and 0.88 (#2874)
chore: update dependencies in poetry.lock and pyproject.toml

Update the versions of various dependencies in the poetry.lock and pyproject.toml files to their latest versions. This ensures compatibility and incorporates bug fixes and improvements provided by the updated dependencies.
2024-07-22 17:33:57 +00:00
Sebastián Estévez
0d5228d681
Astra Assistants Support (#2041)
* ruff

* revert config.yaml

* add build_config

* ruff

* add build_config
2024-07-22 10:26:30 -07:00
Gabriel Luiz Freitas Almeida
912683009f
fix: add correct id to vertices_being_run and change condition to end traces (#2872)
* fix: add correct vertex id to vertices_being_run

* fix: update condition for ending all traces in build_vertex function
2024-07-22 10:23:29 -07:00
Gabriel Luiz Freitas Almeida
9933e54274
fix(cache): change base class of RedisCache from CacheService to AsyncBaseCacheService (#2871)
refactor(cache): change base class of RedisCache from CacheService to AsyncBaseCacheService for better compatibility and functionality
2024-07-22 10:17:57 -07:00
anovazzi1
c880d9035c
fix: Remove removeGlobalVariableFromComponents call on flow export (#2832)
refactor: remove removeGlobalVariableFromComponents call on flow export

Co-authored-by: Cristhian Zanforlin Lousa <72977554+Cristhianzl@users.noreply.github.com>
2024-07-22 16:12:10 +00:00
anovazzi1
48e3cc3517
refactor: Migrate autoLogin control variable to Zustand store (#2843)
* migrate autoLogin control variable to zustand store

* refactor: remove autoLogin control variable from authContext

The autoLogin control variable was removed from the authContext file to simplify the code and improve maintainability. The functionality related to auto login was migrated to the zustand store. This change ensures consistency and better organization of the authentication logic.

* [autofix.ci] apply automated fixes

* refactor: remove autoLogin control variable from authContext

* [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 <72977554+Cristhianzl@users.noreply.github.com>
2024-07-22 16:10:52 +00:00
anovazzi1
3c1cacbf9a
fix: change logical operator in Graph class improving API usage (#2838)
refactor: fix logical operator in Graph class

Fixes a logical operator in the Graph class that was causing incorrect filtering of vertices based on input components. The operator was changed from "or" to "and" to ensure that both conditions are met before skipping the vertex. This resolves an issue where certain vertices were being skipped incorrectly.

Co-authored-by: Cristhian Zanforlin Lousa <72977554+Cristhianzl@users.noreply.github.com>
2024-07-22 09:04:50 -07:00
Cristhian Zanforlin Lousa
4b9dc47021
test: Add New Test for Freeze Path Feature and Improve Existing Tests (#2833)
* 📝 (floatComponent/index.tsx): Add data-testid attribute to float input for testing purposes
🐛 (end-to-end tests): Update test selectors to match changes in component names for consistency and accuracy

 (freeze-path.spec.ts): Add end-to-end test for user ability to freeze a path in the application
🐛 (generalBugs-shard-0.spec.ts): Fix outdated component selector in end-to-end test for clearing chat messages
🐛 (generalBugs-shard-1.spec.ts): Fix outdated component selector in end-to-end test for deleting rows from a table message

🐛 (generalBugs-shard-3.spec.ts): Fix outdated component issue by updating the selector for the AlertTriangle icon and the API key input field, and selecting a different model option
🐛 (logs.spec.ts): Fix outdated component issue by updating the selector for the AlertTriangle icon and the API key input field, and selecting a different model option. Also, ensure the "built successfully" text is clicked within a specified timeout
🐛 (textInputOutput.spec.ts): Fix outdated component issue by updating the selector for the AlertTriangle icon and the API key input field, and selecting a different model option

* ⬆️ (typescript_test.yml): increase shardTotal value to 16 to match the updated shardIndex values for better test distribution.

* 📝 (inputComponent.spec.ts): remove unnecessary test case for clicking and checking collection name input field in InputComponent test to improve test focus and readability.

* Revert "refactor: update template api, handleonnewvalue and handlenodeclass hooks (#2628)"

This reverts commit b3c1b941b3.

*  (inputComponent.spec.ts): add test case to check if the input element is checked after clicking on it

*  (multiselectComponent/index.tsx): Refactor value assignment to handle both array and non-array values more efficiently
🔧 (inputComponent.spec.ts, intComponent.spec.ts, saveComponents.spec.ts): Update file paths to point to the correct location of test assets

*  (filterSidebar.spec.ts): comment out two failing test expectations for helpersChat Memory and agentsTool Calling Agent to prevent test failures
📝 (folders.spec.ts): update file path to read collection.json from the correct location
📝 (saveComponents.spec.ts): update file path to read flow_group_test.json from the correct location

* ⬆️ (typescript_test.yml): increase the number of shardIndex values from 16 to 20 to distribute tests more evenly across shards.

* 📝 (folders.spec.ts): update file path to read collection.json file to fix file not found error

* add condition to merge-reports

*  (filterSidebar.spec.ts): update test to check for visibility of agentsCSVAgent element instead of agentsTool Calling Agent element
🐛 (folders.spec.ts): increase timeout for page.waitForTimeout to 5000ms and add a comment suggesting to consider using a more reliable waiting mechanism. Also, add a comment to wait for the target element to be available before evaluation.

---------

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-07-22 15:15:31 +00:00
Gabriel Luiz Freitas Almeida
decc979e99
refactor: disable type-var error code (#2868)
* fix: disable error code "type-var" in mypy configuration

* refactor(VertexAiModel.py): restructure the return statement to improve readability and maintainability by using type casting for LanguageModel
2024-07-22 15:03:36 +00:00
Gabriel Luiz Freitas Almeida
724f54067f
fix: assign frozen flag from group to node correctly (#2867)
* fix: remove unnecessary code related to vertex parent_node_id in Graph class

* fix: update node["frozen"] assignment to node["data"]["node"]["frozen"] in add_frozen function
2024-07-22 13:04:38 +00:00
Gabriel Luiz Freitas Almeida
922ed594e7
fix: save store API key in database after encryption (#2866) 2024-07-22 12:52:38 +00:00