Commit graph

10,798 commits

Author SHA1 Message Date
anovazzi1
2a27b083f6
refactor: Update lazy loading imports in routes.tsx (#3353)
* refactor: Update lazy loading imports in routes.tsx

The code changes in `routes.tsx` refactor the lazy loading imports by removing unnecessary code duplication and reorganizing the import statements. This improves the readability and maintainability of the code.

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-08-19 10:00:58 -03:00
Cristhian Zanforlin Lousa
c03677c4fb
tests: add test to stop building feature (#3364)
*  (use-icons-status.tsx): Add data-testid attribute to Loading component for testing purposes
 (index.tsx): Add data-testid attribute to stop building button for testing purposes
 (stop-building.spec.ts): Add end-to-end test to ensure user can stop a building process

*  (stop-building.spec.ts): Add additional tests to ensure the user can stop a building process successfully and verify the button functionality.

* test(stop-building.spec.ts): Comment out wait timeouts

---------

Co-authored-by: anovazzi1 <otavio2204@gmail.com>
2024-08-19 09:22:32 -03:00
Cristhian Zanforlin Lousa
a5cdab68bb
tests: Categorize Tests into CI and Scheduled Groups (#3391)
* categoring tests

*  (actionsMainPage-shard-1.spec.ts): Add end-to-end tests for selecting and deleting items, searching flows, and searching components on the main page to ensure proper functionality and user experience.

* 📝 (frontend/tsconfig.json): update file paths in include section to match the correct directory structure for scheduled-end-to-end tests.

* 🔧 (typescript_test.yml): update path in the command to change directory to run end-to-end tests in the frontend folder
📝 (typescript_test.yml): improve comments for better readability and understanding of the workflow logic

* add yml configuration to choose folder to run CI

* 🔧 (ci.yml): Fix formatting issues and add support for running tests in a specific folder
📝 (ci.yml): Update job dependencies to improve readability and maintainability of the workflow configuration

* ♻️ (typescript_test.yml): refactor matrix values for shardIndex and shardTotal to reduce redundancy and improve readability

* categoring tests

*  (actionsMainPage-shard-1.spec.ts): Add end-to-end tests for selecting and deleting items, searching flows, and searching components on the main page to ensure proper functionality and user experience.

* 📝 (frontend/tsconfig.json): update file paths in include section to match the correct directory structure for scheduled-end-to-end tests.

* 🔧 (typescript_test.yml): update path in the command to change directory to run end-to-end tests in the frontend folder
📝 (typescript_test.yml): improve comments for better readability and understanding of the workflow logic

* add yml configuration to choose folder to run CI

* 🔧 (ci.yml): Fix formatting issues and add support for running tests in a specific folder
📝 (ci.yml): Update job dependencies to improve readability and maintainability of the workflow configuration

* ♻️ (typescript_test.yml): refactor matrix values for shardIndex and shardTotal to reduce redundancy and improve readability

* 🐛 (fileUploadComponent.spec.ts): fix file path for file upload to correctly locate the test file in the assets folder

* changing test_folder

*  (fileUploadComponent.spec.ts): update file path for file upload test to match new file location in the project structure

* fix input on playwright command
2024-08-16 18:13:47 -03:00
Lucas Oliveira
0d60fbf3e7
fix: auto saving config (#3395)
* remove env definition from vite

* add get config query

* add save config hook to add info to autosaving and axios

* Use save config hook to get info

* Create autoSaving variable on flowsManagerStore

* Adds autoSaving from store into every place that used the env variables

* fix wrong url

---------

Co-authored-by: anovazzi1 <otavio2204@gmail.com>
2024-08-16 17:23:11 -03:00
David Oplatka
b0619f59ff
fix: adds credentials fields in Vectara RAG component (#3396)
* Fix Component

* Final Edits

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-08-16 20:06:16 +00:00
Gabriel Luiz Freitas Almeida
d313137f8c
feat: add starter project graphs (#3369)
* feat: Add basic prompting graph function.

* feat: Add blog writer starter project function.

* feat(langflow): Add document QA starter project.

* feat: Add memory chatbot graph function to create chatbot with memory component.

* feat: Add hierarchical tasks agent graph to handle sequential tasks.

* feat: Add a function to create a sequential tasks agent with specific tasks.

* feat: Add vector_store_rag module with ingestion and RAG graphs.

* Refactor: Update the hierarchical task agent to use builder methods for agents and models.

* feat: Refactor sequential tasks agent to utilize build_model and build_output methods.

* refactor: Rename functions in blog_writer, document_qa, and vector_store_rag to end with "_graph".

* feat: Add new graphs to starter projects __init__.py.

* feat: Add complex agent graph setup with prompts, tools, and agents.

* refactor: Add complex agent graph to starter projects.

* feat: Add starter project graphs and dump retrieval functions.

* test: Refactor test_directory_without_mocks method with temporary directory for testing purposes.
2024-08-16 12:47:19 -07:00
Gabriel Luiz Freitas Almeida
212a566dfc
fix: Handle KeyError in template parameter mapping and suggest closest match if not found (#3366) 2024-08-16 12:42:36 -07:00
Gabriel Luiz Freitas Almeida
16afd44295
fix: makes outputs be correctly retrieved from edge (#3392)
* feat: Add optional target handle name in get_result method.

* fix: Improve logic to consider target handle name in ComponentVertex.

Fixes #3380
2024-08-16 19:11:59 +00:00
Gabriel Luiz Freitas Almeida
c00e687ec1
feat: add auto_save option to Settings and CLI (#3386)
* feat: Add auto save feature in Langflow run function.

* feat: Add auto_save field to ConfigResponse model.

* refactor: Move logger import to the top in __main__.py and update auto save option help message.

* refactor: Update variable names for auto save to auto saving.
2024-08-16 18:39:19 +00:00
Lucas Oliveira
00d2cffe46
fix: auto save ui and env var (#3384)
* Added new confirmation modal for saving

* Fixed save button

* fixed header classes

* updated docs link

* Added different message to auto saving

* Changed tooltip to appear in saved text, not in button

* Changed tooltip back to previous when auto saving is enabled

* changed auto_save to auto_saving

* Fixed build not appearing and icons

* Changed modal when autosave is enabled

* 🐛 (menuBar/index.tsx): fix condition for disabling save button to include isBuilding flag to prevent saving during build process

* fix current flow not being updated on set nodes and edges and fix modal not letting user leave when flow is empty

* Removed console log

* Fix add flow not adding the flow that comes from the backend

---------

Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
Co-authored-by: Cristhian Zanforlin Lousa <72977554+Cristhianzl@users.noreply.github.com>
2024-08-16 18:17:42 +00:00
Gabriel Luiz Freitas Almeida
14ca9c9f9d
fix: Sort first layer in graph initialization. (#3383) 2024-08-16 18:11:39 +00:00
Gabriel Luiz Freitas Almeida
e4e1a747f8
test: Fix assertion in test_get_vertices function. (#3387)
* test: Fix assertion in test_get_vertices function.

* test: fix set

---------

Co-authored-by: italojohnny <italojohnnydosanjos@gmail.com>
2024-08-16 10:49:02 -07:00
Gabriel Luiz Freitas Almeida
c4d2dc56c7
fix(edge): Handle invalid input types when creating TargetHandle (#3368)
* fix(edge): Handle invalid input types when creating TargetHandle

* test(edge): add test for raising error on invalid target handle

* fix: mypy error union-attr

---------

Co-authored-by: italojohnny <italojohnnydosanjos@gmail.com>
2024-08-16 07:52:43 -07:00
Gabriel Luiz Freitas Almeida
8de100eae3
feat: add description on graph (#3371)
* feat: Add optional description attribute to Graph class and handle description in serialization.

* refactor: Remove 'type' field from NodeData class.

* refactor: Set default graph name if not provided.

* fix: mypy error typeddict-item

---------

Co-authored-by: italojohnny <italojohnnydosanjos@gmail.com>
2024-08-16 14:50:58 +00:00
anovazzi1
26bc6bc645
fix: Add TableNodeComponent and set default formatter type (#3382)
* feat: Add TableNodeComponent for rendering table data in ParameterRenderComponent

* refactor: Set default formatter type for columns in FormatColumns function

* [autofix.ci] apply automated fixes

* refactor: Improve object rendering in ObjectRender component

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-08-16 14:47:44 +00:00
Gabriel Luiz Freitas Almeida
640f1becf3
build(langchain-core): Update langchain-core to version 0.2.32. (#3372) 2024-08-16 06:46:21 -07:00
Anand Dev Singh
6f001c64be
fix: Corrected Changed the data type of number field from string to number (#3363)
* Changed the data type of number field from string to number

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-08-15 21:15:12 +00:00
Gabriel Luiz Freitas Almeida
2baee5fef1
feat: get result from output if possible (#3338)
* refactor: Extract method to set params from normal edge in Vertex class.

* feat: Add method to retrieve value from template dict in Vertex class.

* feat: Add handling for cycle and contract edge targets in ComponentVertex build method.

* refactor: Update result retrieval logic in ComponentVertex class.

* refactor: Add condition to check flow_id before creating log transactions.

* refactor: Add missing `Edge` import and cast `cast` in types.py for better typing.
2024-08-15 16:44:06 +00:00
Gabriel Luiz Freitas Almeida
cdab352bc8
feat: Add timeout parameter to HTTP request in StoreService. (#3362) 2024-08-15 06:50:11 -07:00
Gabriel Luiz Freitas Almeida
bb923cf9e1
feat: update output attribute handling (#3329)
* refactor: improve function structure in _build_results

* fix: remove function call that overrides Component.outputs

* refactor: Add handling for outputs in __getattr__ method.
2024-08-15 13:00:09 +00:00
Ítalo Johnny
93537933c3
fix: handle case where tweak values are nested dicts (#3349) 2024-08-15 11:36:30 +00:00
anovazzi1
981f314a73
refactor: improve store and collection card components (#3350)
* refactor: add card store component

* refactor: use StoreCardComponent for displaying store cards

* refactor: Remove unused code

* refactor: Update Collection card to fit only to the my collection case

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-08-14 19:02:46 -03:00
anovazzi1
642df45bf6
enhancement: update widget code to use latest version of langflow-embedded-chat (#3347)
refactor: Update widget code to use latest version of langflow-embedded-chat
2024-08-14 21:26:32 +00:00
Gabriel Luiz Freitas Almeida
664da106d0
build: lock langchain-core to version 0.2.30. (#3348) 2024-08-14 13:17:31 -07:00
Gabriel Luiz Freitas Almeida
a90cb1249b
fix: do not mark self.stop caller (#3335)
* refactor: Refactor mark_branch method in Graph class.

* fix: do not mark caller vertex
2024-08-14 18:45:40 +00:00
anovazzi1
e5ee0ba946
refactor: Add ComponentTextModal and Prompt modal for displaying and editing text areas and components (#3346)
* add separated component for prompt modal

* refactor: rename promptAreaModal to promptModal and update type import

* refactor: update promptComponent to use PromptModal instead of GenericModal

* refactor: update textarea-primary class in applies.css

* refactor: add ComponentTextModal for displaying and editing text areas

Add a new component, ComponentTextModal, for displaying and editing text areas. This component includes a textarea input, a title, and an icon. It also supports password visibility toggling. The ComponentTextModal is used within a BaseModal component and includes a save button for finishing the editing process. This commit refactors the code to add the ComponentTextModal and its related functionality.

* refactor: Add ComponentTextModal for displaying and editing text areas

* delete genericModal component and their references

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-08-14 15:08:59 -03:00
Gabriel Luiz Freitas Almeida
7ce6a9ee03
feat: Add maximum iterations limit in Graph start method. (#3336)
* feat: Add maximum iterations limit in Graph start method.

* feat: Add OutputConfigDict and StartConfigDict to schema.py.

* feat: Add ability to apply configuration before starting graph.

* feat: Add max_iterations parameter to async_start method and update schema imports.
2024-08-14 11:06:25 -07:00
Lucas Oliveira
765895432e
refactor: folder fetching, folder sidebar and fix various issues (#3344)
* Removed unused code

* Separated folder sidebar from common sidebar

* Removed useOnFileDrop from common sidebar

* Added folderSidebarComponent that fetches the folders

* Added useOnFileDrop and SIdebarFoldersButton

* Make auth context not get folders

* Make delete folder refetch get folders

* Make folder mutations refetch the getFolder

* Create getFolder query

* Removed unused functions from useFolderStore

* Make isLoading from application depend only on flows

* Make main page not refetch folders

* Change types of folders store

* removed getFolders refetch on duplicateFolders

* Added loading from query into ComponentsComponent

* Made the flow page get the flows and types if they're not available

* Made the loading be the isLoading only

* Removed unused function

* Make cards appear even if it didnt load

* Removed setLoading of various pages

* Fixed loading happening every time the flow changes

* Added skeleton instead of loading on folders

* Added routing to contain folderId on both flows and initial page

* remove redirect of useFileDrop

* remove folderid getting from state

* removed setAllFlows

* chore: Remove unused variables and functions in useDuplicateFlows hook

* Added refetch of folders when the flow is deleted or added

* Changed redirectToLastLocation to redirect to last folder also

* Added upload flow to folder tanstack and refetched folders on upload

* Added loading of current folder on display of empty component

* Removed refetching folder on file drop

* Removed unused code

* Fixed add new flow from header not redirecting correctly

* Fixed unused code

* Added undefined on setting current flow as empty

* Added disable top bar and make it be displayed on the top of an empty folder

* Fixed select all checked when deleting all flows
2024-08-14 14:40:18 -03:00
Gabriel Luiz Freitas Almeida
1d8a24eb86
refactor: rename ContractEdge to CycleEdge (#3334)
* refactor: Add CycleEdge class and make necessary adjustments in base.py files.

* refactor: Change ContractEdge to CycleEdge for consistency in vertex class properties.

* [autofix.ci] apply automated fixes

* refactor: Update type hints in types.py and base.py.

* [autofix.ci] apply automated fixes

* refactor(base.py): Update imports in base.py.

* [autofix.ci] apply automated fixes

* refactor: Changed ContractEdge to CycleEdge for building and getting edges.

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-08-14 17:39:16 +00:00
Gabriel Luiz Freitas Almeida
8d83c3a8bf
feat: Add method to set specific parameters on output object. (#3328) 2024-08-14 17:29:11 +00:00
Gabriel Luiz Freitas Almeida
33e72f162f
refactor: Prevent infinite loop in get_successors function. (#3332)
* refactor: Prevent infinite loop in get_successors function.

* feat(base): improve get_all_successors method to handle cyclic graphs and flat parameter efficiently
2024-08-14 10:04:51 -07:00
Gabriel Luiz Freitas Almeida
15dc4347e0
refactor: Simplify __repr__ method in Edge and ContractEdge classes. (#3333) 2024-08-14 16:54:10 +00:00
Gabriel Luiz Freitas Almeida
77b071155c
feat: add functions to detect cycles in Graph (#3327)
* feat: Add functions to detect cycles in directed graphs.

* test: Add new test cases for cycle detection in graph utils.

* test: temporarily disable test

---------

Co-authored-by: italojohnny <italojohnnydosanjos@gmail.com>
2024-08-14 16:14:56 +00:00
anovazzi1
0e2f27736c
refactor: update keyboard shortcuts display (#3316)
* remove repeated code

* refactor: remove useless code

* feat: sort input parameters in GenericNode renderInputParameter

* refactor: remove unused code in GenericNode component

* refactor: add NodeName component for displaying and editing node names

* refactor: add NodeDescription component for displaying and editing node descriptions

* fix import and add autofocus on nodeName

* feat: add NodeStatus component for displaying and managing node status

* [autofix.ci] apply automated fixes

* refactor: remove unused code in GenericNode component

* fix bugs on minimize

* [autofix.ci] apply automated fixes

* refactor: remove unused code and handle count in GenericNodeToolbar component

* refactor: Add useShortcuts hook for handling keyboard shortcuts in nodeToolbarComponent

* refactor: Add keyboard shortcuts handling to nodeToolbarComponent need to test

* refactor: Update FreezeAllVertices function in NodeToolbarComponent

* feat: Add getNodeLength function to calculate the length of a node's template fields

* refactor: Update RenderIcons component to use navigator.platform for detecting macOS

* refactor: Add ShortcutDisplay component to nodeToolbarComponent

* refactor: Update nodeToolbarComponent to remove RenderIcons and add ShortcutDisplay

* refactor: Improve keyboard shortcuts handling in nodeToolbarComponent

* [autofix.ci] apply automated fixes

* refactor: Add OptionIcon to nodeIconsLucide

* feat: Add SHORTCUT_KEYS constant

* feat: Add SHORTCUT_KEYS constant

* refactor: Add RenderKey component for rendering keyboard shortcuts

* refactor: Update RenderIcons component to use RenderKey for rendering keyboard shortcuts

* update shortcut page to use shortcut icons

* [autofix.ci] apply automated fixes

* Update Astra link in README.md (#3314)

* Update link in README.md

* Update README.md

* Update getting-started-installation.md

* Update README.KR.md

* Update README.ja.md

* refactor: Simplify NodeToolbarComponent's save flow logic

* [autofix.ci] apply automated fixes

* feat: Google Drive Search Component (#3319)

* feat: Google Drive Search Component

feat: Google Drive Search Component
Ability to search Google Drive and get back the relevant Doc id or Doc urls

* Updated Google Drive Search.py

* feat: Add support for metadata filtering and namespaces for the Upstash Vector component (#3254)

* feat: add metadata filtering and namespace support for the upstash vector component

* docs: add upstash vector to the vectorstores doc

* [autofix.ci] apply automated fixes

---------

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

* ci: Update pytest configuration and add pytest-flakefinder. (#3330)

* chore: Refactor NodeToolbarComponent to simplify code structure

* [autofix.ci] apply automated fixes

* refactor: Simplify NodeToolbarComponent's save flow logic

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Alex Leventer <3254549+alexleventer@users.noreply.github.com>
Co-authored-by: Edwin Jose <edwin.jose@datastax.com>
Co-authored-by: ytkimirti <yusuftaha9@gmail.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-08-14 12:28:46 -03:00
anovazzi1
7fe6c53b37
refactor: improve node toolbar code (#3311)
* remove repeated code

* refactor: remove useless code

* feat: sort input parameters in GenericNode renderInputParameter

* refactor: remove unused code in GenericNode component

* refactor: add NodeName component for displaying and editing node names

* refactor: add NodeDescription component for displaying and editing node descriptions

* fix import and add autofocus on nodeName

* feat: add NodeStatus component for displaying and managing node status

* [autofix.ci] apply automated fixes

* refactor: remove unused code in GenericNode component

* fix bugs on minimize

* [autofix.ci] apply automated fixes

* refactor: remove unused code and handle count in GenericNodeToolbar component

* refactor: Add useShortcuts hook for handling keyboard shortcuts in nodeToolbarComponent

* refactor: Add keyboard shortcuts handling to nodeToolbarComponent need to test

* refactor: Update FreezeAllVertices function in NodeToolbarComponent

* feat: Add getNodeLength function to calculate the length of a node's template fields

* refactor: Update RenderIcons component to use navigator.platform for detecting macOS

* refactor: Add ShortcutDisplay component to nodeToolbarComponent

* refactor: Update nodeToolbarComponent to remove RenderIcons and add ShortcutDisplay

* refactor: Improve keyboard shortcuts handling in nodeToolbarComponent

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-08-14 15:04:25 +00:00
Ítalo Johnny
493b73f9d8
fix: add double quotes to curl command generation (#3337) 2024-08-14 14:36:00 +00:00
Gabriel Luiz Freitas Almeida
9035f1194f
ci: Update pytest configuration and add pytest-flakefinder. (#3330) 2024-08-14 14:29:03 +00:00
ytkimirti
ce17bd4e71
feat: Add support for metadata filtering and namespaces for the Upstash Vector component (#3254)
* feat: add metadata filtering and namespace support for the upstash vector component

* docs: add upstash vector to the vectorstores doc

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-08-14 07:18:45 -07:00
Edwin Jose
ac4442d221
feat: Google Drive Search Component (#3319)
* feat: Google Drive Search Component

feat: Google Drive Search Component
Ability to search Google Drive and get back the relevant Doc id or Doc urls

* Updated Google Drive Search.py
2024-08-14 07:11:58 -07:00
Lucas Oliveira
c19a031b9c
fix: dark mode and header text display issues (#3315)
* Fix dark mode not starting with the browser saved variable

* Added the Last saved at text on the header too

* Fixed css
2024-08-13 20:01:46 -03:00
anovazzi1
62b1b88644
refactor: improve NodeOutputField and NodeInputField components (#3235)
* remove refhtml and create new component

* refactor: refactor NodeOutputField component in GenericNode

* refactor: refactor NodeOutputField component in GenericNode

* refactor: refactor NodeInputField component in GenericNode

* refactor: remove output shortcut

* [autofix.ci] apply automated fixes

* refactor: remove console.log statements in NodeOutputField component

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-08-13 16:52:26 -03:00
Ítalo Johnny
4f5dca89f3
test: adds new tests for new variable service (#3306)
* test: adds new tests for new method

* test: remove unused variable
2024-08-13 18:01:10 +00:00
anovazzi1
64aecddeca
refactor: add components for node name, description, and status (#3248)
* remove repeated code

* refactor: remove useless code

* feat: sort input parameters in GenericNode renderInputParameter

* refactor: remove unused code in GenericNode component

* refactor: add NodeName component for displaying and editing node names

* refactor: add NodeDescription component for displaying and editing node descriptions

* fix import and add autofocus on nodeName

* feat: add NodeStatus component for displaying and managing node status

* [autofix.ci] apply automated fixes

* refactor: remove unused code in GenericNode component

* fix bugs on minimize

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-08-13 14:37:33 -03:00
Ítalo Johnny
952ba5eef1
feat: centralize global variable management (#3284)
* test: add tests for global variable endpoints

* test: add unit tests variable service

* fix: anticipate checks to prevent the code from breaking

* feat: add a new method to interface

* feat: add method to update fields in variable service

* feat: replace variable api code

* fix: mypy error

* fix: mypy error

* feat(variable): Allow deleting variables by name or ID in DatabaseVariableService.

* refactor(api): Simplify delete method in variable router.

---------

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-08-13 13:32:57 +00:00
anovazzi1
665842680e
enhancement: prevent esc on codeAreaModal (#3232)
* add onEscapeKeyDown

* refactor: Add ConfirmationModal to CodeAreaModal for better user experience

* refactor: Update CodeAreaModal to use ReactAce for code editing

* fix closing o x modal

* refactor: Update CodeAreaModal to use ReactAce for code editing

* [autofix.ci] apply automated fixes

* decompose object

---------

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-08-13 12:35:02 +00:00
Gabriel Luiz Freitas Almeida
46f705461e
chore: update lock files with new versions (#3300)
* chore: update lock files with new versions

* build(uvicorn): Update uvicorn to v0.30.6 and its hash values.
2024-08-13 11:16:40 +00:00
Gabriel Luiz Freitas Almeida
c5d9cbae49
feat: add dynamic state model creation and update (#3271)
* feat: add initial implementation of dynamic state model creation and output getter in graph state module

* feat: implement _reset_all_output_values method to initialize component outputs in custom_component class

* feat: add state model management with lazy initialization and dynamic instance getter in custom_component class

* feat: Refactor Component class to use public method get_output_by_method

Refactor the Component class in the custom_component module to change the visibility of the method `_get_output_by_method` to public by renaming it to `get_output_by_method`. This change improves the accessibility and clarity of the method for external use.

* feat: add output setter utility to manage output values in state model properties

* feat: implement validation for methods' classes in output getter/setter utilities in state model to ensure proper structure

* feat: add state model creation from graph in state_model.py

* feat: enhance Graph class with lazy loading for state model creation from graph

* feat: add unit tests for state model creation and validation in test_state_model.py

* feat: add unit tests for state model creation and validation in test_state_model.py

* feat: add functional test for graph state update and validation in test_graph_state_model.py

* fix: update _instance_getter function to accept a parameter in component.py for state model instance retrieval

* refactor: rename test to clarify purpose in test_state_model.py for functional state update validation

* chore: import Finish constant in test_graph_state_model.py for improved clarity and usage in state model tests

* refactor: add optional validation in output getter/setter methods for improved method integrity in state model handling

* refactor: enhance state model creation with optional validation and error handling for output methods in model.py

* refactor: serialize and deserialize GraphStateModel in test_graph_state_model.py

* refactor: improve error message and add verbose mode for graph start in test_state_model.py

* refactor: remove verbose flag from graph.start in TestCreateStateModel for consistency in test_state_model.py

* refactor: disable validation when creating GraphStateModel in state_model.py for improved flexibility

* refactor: add validation documentation for method attributes in model.py to enhance code clarity and usability

* refactor: expand docstring for build_output_getter in model.py to clarify usage and validation details

* refactor: add detailed docstring for build_output_setter in model.py to improve clarity on functionality and usage scenarios

* refactor: add comprehensive docstring for create_state_model in model.py to clarify functionality and usage examples

* refactor: enhance docstring for create_state_model_from_graph in state_model.py to clarify functionality and provide examples

* test: add JSON schema validation in graph state model tests for improved structure and correctness verification

* refactor: Improve graph_state_model.json_schema unit test readability and structure.
2024-08-12 17:53:57 -07:00
Sai Kolasani
2ffd723065
Update Ollama Model + Links (#3294)
wip

Co-authored-by: Sai Kolasani <sai.kolasani@datastax.com>
2024-08-13 00:45:31 +00:00
Carlos Coelho
dc419d11fd
fix: Corrected URI handling in SQLDatabaseComponent (#3291) 2024-08-12 15:45:13 -07:00
Lucas Oliveira
7264028e41
refactor: optimize flow saving functionality and implement manual saving (#3283)
* fixed patch update flow

* fixed update flow patch to receive id by payload

* created save flow hook with auto save and manual save functions

* fix poetry lock

* added auto save check with environment variable

* removed unused user

* separated autosave and put the flow as a creation with nodes and edges

* removed set nodes that skipped saving

* implemented auto save hook

* removed autosave from setNodes and setEdges

* added auto save hook and saved on viewport move and added useEffect to save on nodes and edges changed

* changed type of setNodes

* removed unused var

* removed deletion of empty flow

* Added saving of flow on button when autoSave is disabled

* disable saving when the nodes are empty

* removed save loading as false when the access token is renewed

* implemented useDebounce

* added save loading to save flow hook

* removed setting nodes and edges on fetching, since they are set when the current flow is updated

* removed unused var

* use debounce hook to save flow

* set nodes and edges on current flow id change

* removed useplaygroundeffect

* removed unused import

* put set save loading before the If

* removed flow cleaning and inputs setting, since the inputs and outputs are set on the ResetFlow function

* updated to use ResetFlow function to update everything regarding flow

* removed flow pool get on resetFlow, for it to be fetched only if the user is inside the flow

* updated packagelock

* Changed router to outlet on app.tsx to use createRouter

* Created authSettingsGuard to guard the general settings

* Fixed routes to use createBrowserRouter to allow the use of useBlocker

* Changed index.tsx to use RouterProvider and the router just created

* Changed flowStore to have a local flow state

* Implemented setting the current flow state when saving the flow

* Added the update of current flow when auto saving

* changed current flow to use the current flow from Flow Store instead of Flows Manager Store

* Changed codeTabsComponent Tweaks check to show if its checked

* Removed unused variables

* Removed browser router from context wrapper

* Removed unused console.log

* Changed initialSetup to just run when opening the modal

* changed confirmationModal to have destructiveCancel and to only call onCancel if the other buttons were not pressed

* Created a SaveChangesModal that confirms if the user wants to save their changes

* Get folder by id when folder id changes too

* Changed reset flow calls to store whole flow

* Added check if user is exiting page to prevent him when there are unsaved changes

* Added new types on ConfirmationModalType

* Implement save on clicking the save button on the header

* added save component shortcut to use save shortcut as save flow

* added save component shortcut on shortcutsStore type

* changed save shortcut to save component on node toolbar

* added save shortcut to header menubar

* changed shortcuts name to be compatible with existing ones

* changed shortcuts to be backwards compatible

* changed save to changes to maintain retrocompatibility

* changed save_component to save to maintain retrocompatibility

* Changed time difference to unsaved changes

* changed the toolbar select item to get the right save shortcut

* Changed save flow to use current flow from useFlowStore instead of the previous saved flow

* changed changesNotSaved to include flow name and metadata

* Added way of saving the flow settings just locally instead of directly to database

* Changed shareModal to save flow with hook

* removed old auto saving on connect

* Removed save functions from flowsManagerStore

* refactor: Remove unused imports and state variables in EditFlowSettings component

* use current flow not saved one and refactored page to not receive flow

* added check of isFlowPage to display the menubar

* Added checks to render playground if API key is valid and if Flows exists

* Added check to not display X on chat on playground page

* Updated flows variable to be undefined by start to prevent things from loading before flows initialize

* Implemented log builds parameter to not allow the builds to be logged if user not on flowPage
2024-08-12 22:21:52 +00:00