Commit graph

13,802 commits

Author SHA1 Message Date
Cristhian Zanforlin Lousa
9b83f44611
feat: add stop button on Playground Chat (#3704)
* 📝 (buttonSendWrapper/index.tsx): refactor button styling logic to use constants for better readability and maintainability
🐛 (buttonSendWrapper/index.tsx): fix logic to disable button when chat is locked and not building
🐛 (buttonSendWrapper/index.tsx): fix conditional rendering of icons based on button state

*  (stop-button-playground.spec.ts): Add end-to-end test for stopping building from inside Playground.

* 🔧 (buttonSendWrapper/index.tsx): refactor conditional logic to correctly prioritize showStopButton condition and improve code readability

*  (stop-button-playground.spec.ts): add assertion to check if "build stopped" text is visible after clicking on the stop button
2024-09-06 20:19:00 +00:00
Cristhian Zanforlin Lousa
f72e009406
feat: Add x-large size option to baseModal and various modals resizes (#3710)
* feat: Add x-large size option to baseModal

The code changes introduce a new size option "x-large" to the baseModal component. This size option sets the minimum width to "min-w-[95vw]" and the height to "h-[95vh]". This change allows for a larger modal size when needed.

* feat: Add x-large size option to baseModal

* chore: Update CodeAreaModal to use x-large size option

* feat: Update EditNodeModal to use x-large size option

* feat: Update FlowLogsModal to use x-large size option

* chore: Update modal components to use x-large size option

* 🔧 (applies.css): Rearrange CSS classes properties for better readability and maintainability. Fix the order of properties in CSS classes to follow a consistent pattern.
2024-09-06 18:30:48 +00:00
Cristhian Zanforlin Lousa
40798c5b5a
refactor: improve readability of several components (#3714)
* refactor to improve readability

* refactor to improve readability

* refactor to improve readability

* refactor to improve readability

* refactor to improve readability

* refactor to improve readability

* refactor to improve readability

* refactor to improve readability

*  (Simple Agent.spec.ts): update expected count of python words to 2 for accurate test results
📝 (auto-login-off.spec.ts): add a 1-second timeout before checking visibility of a text element to ensure proper rendering and improve test reliability

* 📝 (cardComponent/index.tsx): Extract handlePlaygroundClick function to improve code readability and maintainability
📝 (codeAreaComponent/index.tsx): Refactor code to use consistent naming conventions and improve code structure
📝 (rename-label.tsx): Refactor code to use consistent naming conventions and improve code structure
📝 (dictAreaModal/index.tsx): Refactor code to use consistent naming conventions and improve code structure

* 🔧 (rename-label.tsx): Refactor RenameLabel component to improve readability and maintainability by restructuring the component logic into separate functions for handling blur, change, and double click events. Split the component rendering logic into separate functions for input and span elements.

* update type

* [autofix.ci] apply automated fixes

---------

Co-authored-by: anovazzi1 <otavio2204@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-09-06 18:30:20 +00:00
Cristhian Zanforlin Lousa
835559a05d
feat: add a better scroll behave on playground's chat (#3680)
* feat: Add useUtilityStore hook to IOModal for setting playground scroll behavior

* feat: Add useUtilityStore hook to IOModal for setting playground scroll behavior

* feat: Add setPlaygroundScrollBehaves function to useUtilityStore hook

* feat: Update codeTabsPropsType to allow undefined for the 'open' property

* feat: Add `playgroundScrollBehaves` and `setPlaygroundScrollBehaves` to `UtilityStoreType`

The `UtilityStoreType` now includes the `playgroundScrollBehaves` property of type `ScrollBehavior` and the `setPlaygroundScrollBehaves` function to update it. This allows for managing the scroll behavior of the playground in the application.

* refactor: Remove unused 'open' prop from CodeTabsComponent
2024-09-06 14:49:50 -03:00
dependabot[bot]
cb1d720796
build(deps): bump cryptography from 42.0.8 to 43.0.1 in /src/backend/base (#3703)
build(deps): bump cryptography in /src/backend/base

Bumps [cryptography](https://github.com/pyca/cryptography) from 42.0.8 to 43.0.1.
- [Changelog](https://github.com/pyca/cryptography/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pyca/cryptography/compare/42.0.8...43.0.1)

---
updated-dependencies:
- dependency-name: cryptography
  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-09-06 10:42:02 -07:00
Phil Miesle
255c604730
feat: add pull_policy to Docker compose example (#3693)
add pull_policy to Docker compose example
2024-09-06 10:41:47 -07:00
Ítalo Johnny
82b6daee53
fix: use permanent cache for all types dict and build only once (#3711)
* use permanent cache for all types dict and build only once


---------

Co-authored-by: ming <itestmycode@gmail.com>
2024-09-06 13:36:59 -03:00
Mendon Kissling
5eaebe58f3
docs: add new starter flows (#3688)
add-new-starter-flows
2024-09-06 15:14:18 +00:00
Jordan Frazier
3643d962b9
fix: deepcopy component output to avoid overriding previous outputs (#3698)
* Fixes copy of component outputs

* Fix issue with copying outputs in custom components

- Update loop to iterate over `_outputs.values()` instead of `outputs` to ensure correct attribute setting.

* Refactor output handling in custom component to use dictionary values

- Updated methods to iterate over `_outputs.values()` instead of `outputs`.
- Ensured consistent access to output values across various methods.
- Fixed potential issues with output value resetting and state model building.

* Fix incorrect attribute reference in set_output_value method

* Add missing import for CustomComponent in test_custom_component.py

* Refactor `test_read_flow` to generate unique flow names for each test run

* Refactor: Rename `_outputs` to `_outputs_map` in custom component

- Updated all references of `_outputs` to `_outputs_map` in `component.py` to improve clarity and consistency.
- Adjusted related methods and attributes in `base.py` to align with the new naming convention.

* Fix output handling in custom component

- Moved `_reset_all_output_values` call to ensure outputs are reset after initialization.
- Updated attribute access to use `_outputs_map` instead of `_outputs` for consistency.

---------

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-09-06 05:23:13 -07:00
Cristhian Zanforlin Lousa
1e334335d1
tests: fix decision flow tests - conditional router component (#3702)
 (decisionFlow.spec.ts): Remove unnecessary code related to connection 4 and improve flow by adding a new connection for prompt input user message
📝 (decisionFlow.spec.ts): Update test to fill in a different message in the chat playground and verify a different emoji response
2024-09-05 18:26:17 -03:00
Lucas Oliveira
3bc9cc9686
fix: update saving behavior when exiting flow (#3673)
* Updated save flow to only execute when the flow has unsaved changes

* Made flowPage call saveFlow immediatly when trying to exit page

* Changed save changes modal to automatically exit when saved on autoSave

* Changed flowPage to save and exit when autoSave

* Remove confirmation button if it does not exist and remove footer if confirmation and cancel does not exist

* Changed saveChangesModal to not show buttons when autoSave is on and to set loading as true when autoSave is off and the user saves

* Add timer to close modal, so, if saving takes less than 1 second, it waits

* Changed type of confirmationModal

* Added handling for when it's building and there is unsaved changes

* Added success toast when flow finishes saving

* refactored confirmationModal

* check autoLogin !== undefined before calling things

* Fix use save flow to compare the passed flow instead of the current one

* Changed style of save changes modal

* deleted build in progress modal

* Removed build in progress modal, just stopping the build

* Fix condition on api

* Changed condition to be autoLogin !== undefined
2024-09-05 21:10:15 +00:00
Lucas Oliveira
c31005a84f
fix: remove saving on flow pan and add fit view to reactflow (#3696)
* Remove save on pan flow and added fit view

* Removed viewport setting on resetFlow and setReactflowInstance

* Made last saved appear on header

* Made it only fit on set react flow instance

---------

Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com>
2024-09-05 19:17:21 +00:00
Jordan Frazier
7b3e51f769
ci: create a nightly build workflow (#3553)
* test poetry install

* Add nightly builds workflow

* remove old comments and fix poetry

* remove old debug statement

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-09-05 19:13:04 +00:00
Lucas Oliveira
414bfe799e
fix: set refetch on window focus to false for all queries on flow page (#3699)
Add refetchOnWindowFocus as false on every query that is run on the flow
2024-09-05 18:03:40 +00:00
Lucas Oliveira
a4dc5381b2
feat: add build in progress modal when trying to exit (#3695)
* Changed store to stop the isBuilding state as well

* Create Build In Progress modal

* Use blocker to stop if its building as well
2024-09-05 13:50:12 +00:00
Gabriel Luiz Freitas Almeida
46a66a57c1
fix: add user dependency to webhook endpoint for flow execution (#3685)
* Add helper function to retrieve user by flow ID or endpoint name in user.py

- Introduced `get_user_by_flow_id_or_endpoint_name` function to fetch user details based on flow ID or endpoint name.
- Added error handling for cases where the flow or user is not found.
- Utilized `get_db_service` for database session management.

* Add user dependency to webhook endpoint for flow execution

- Import `get_user_by_flow_id_or_endpoint_name` helper function.
- Add `user` parameter to `webhook_run_flow` endpoint.
- Pass `user` to `simple_run_flow_task` for API key association.
2024-09-04 16:00:47 -07:00
anovazzi1
533d5afdc6
fix: Delete folder from cache after successful deletion (#3686)
* feat: Delete folder from cache after successful deletion

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-09-04 18:19:46 -03:00
Gabriel Luiz Freitas Almeida
aaaf6f3784
refactor: replace get_actions call with get_tools in Composio Component (#3684)
* refactor: update deprecated call to get_actions

* Update composio-langchain dependency to version 0.5.13 in pyproject.toml

* Downgrade `composio-langchain` dependency to version `0.5.9` in `pyproject.toml`

* Add missing import for CustomComponent in test_custom_component.py
2024-09-04 21:16:36 +00:00
anovazzi1
addadeb5cb
fix: remove edges glitch (#3689)
fix: Update transition property in App.css

The transition property in App.css has been updated to only transition the color property instead of all properties. This change improves performance by reducing unnecessary transitions.
2024-09-04 21:05:36 +00:00
anovazzi1
5ad48b4212
chore: update TextInput and TextOutput components to use MultilineInput (#3664)
chore: Update TextInput and TextOutput components to use MultilineInput instead of MessageTextInput
2024-09-04 19:12:19 +00:00
Cristhian Zanforlin Lousa
a670a7cb0b
fix: getall is being called unnecessarily every time the user accesses the My Collection page (#3681)
*  (use-get-folders.ts): Update useGetFoldersQuery to check if types are empty before calling getTypes to avoid unnecessary API calls
♻️ (typesStore.ts): Remove unnecessary useAlertStore setState call to improve code readability and maintainability

* feat: Update getTypes function to always force refresh

The `getTypes` function in `typesStore.ts` has been updated to always force a refresh of the types data. This change ensures that the latest data is fetched from the API, avoiding unnecessary API calls.

* Changed types check in other pages

---------

Co-authored-by: Lucas Oliveira <lucas.edu.oli@hotmail.com>
2024-09-04 16:48:09 +00:00
Eric Hare
de1fdff742
feat: Switch to API for Unstructured Component (#3671)
* FEAT: Switch to API for Unstructured Component

* chore: new lock

---------

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-09-04 05:51:52 -07:00
Marcelo Nunes Alves
d93c90760a
feat: add component clickhouse for vector database (#3657)
* fix: Problem in the description field when using the MariaDB or MySQL database.

* fix: Problem in the description field when using the MariaDB or MySQL database.

* fix: Add the migration script to update description columns type.

* [autofix.ci] apply automated fixes

* Update src/backend/base/langflow/alembic/versions/1d90f8a0efe1_update_description_columns_type.py

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

* feat: add component clickhouse for vector database

* feat: add component clickhouse for vector database - conflicts resolved

* [autofix.ci] apply automated fixes

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

* feat: add component clickhouse for vector database - conflicts resolved

* feat: add component clickhouse for vector database - update poetry

* feat: add component clickhouse for vector database - conflicts resolved

---------

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-04 05:33:30 -07:00
Mendon Kissling
78541f453d
docs: add Loaders components page (#3672)
add-loaders
2024-09-03 21:00:58 +00:00
Cristhian Zanforlin Lousa
4bd990f2fa
feat: renaming Langchain Hub component (#3669)
📝 (LangChainHubPrompt.py): update display name to "LangChain Hub" for better clarity and consistency with the component's purpose

Co-authored-by: anovazzi1 <otavio2204@gmail.com>
2024-09-03 21:00:18 +00:00
Gabriel Luiz Freitas Almeida
6388883f1b
fix: update Makefile to conditionally enable --reload based on worker count (#3675)
* Update Makefile to handle backend port kill errors

* Update Makefile to conditionally enable --reload based on worker count
2024-09-03 17:58:35 -03:00
Rodrigo Nader
978bdf5fec
add text embedder component (#3663)
* add text embedder component

* [autofix.ci] apply automated fixes

* add embedding similarity component

* [autofix.ci] apply automated fixes

* change text embedder output type to data

*  (similarity.spec.ts): Add end-to-end test for checking similarity between embedding texts in the frontend application.

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
2024-09-03 20:11:18 +00:00
Lucas Oliveira
61e5bbb482
fix: folders call when saving flow (#3658)
* Removed refetching of get folder on save

* Made component appear if its loading

* Rebaned query key to not refetch folders

* Changed isLoading to isFetching for the component to be unclickable while refetching
2024-09-03 17:41:53 +00:00
Lucas Oliveira
27ad129049
fix: iomodal and folders api calls (#3661)
* Fixed IOModal calling getMessages again

* Fixed folders API being called twice

* removed unused imports

* Re-added query of get messages and changed to enable query when open

* Fix auto login off test
2024-09-03 17:29:35 +00:00
Nicolò Boschi
1c7ef6ee60
feat: add Parse JSON component (#3167)
* feat: add Parse JSON component

* feat: Update ParseJSONDataComponent to handle JSON decoding errors

* fix tests

* [autofix.ci] apply automated fixes

* add string check in _parse_data

---------

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-09-03 16:36:30 +00:00
Gabriel Luiz Freitas Almeida
439565413e
refactor: conditionally disable reload and workers in Makefile based on the presence of the workers variable (#3614)
Conditionally disable reload and workers in Makefile based on the presence of the workers variable
2024-09-03 09:28:35 -07:00
Lucas Oliveira
be3cb833dd
fix: selected node and edge color and width (#3667)
* Fix border node color to use ring in order to not shrink component and to use selected edge color

* Updated selected edge width to match selected node width

---------

Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com>
2024-09-03 14:45:51 +00:00
Gabriel Luiz Freitas Almeida
b2f5a43d06
chore: add migration to enforce non-nullable 'id' in 'vertex_build' table (#3655)
Add Alembic migration to enforce non-nullable 'id' in 'vertex_build' table
2024-09-02 22:58:03 +00:00
Lucas Oliveira
f2abb944f6
fix: console reported issues (#3660)
* Added key to sidebar buttons

* Added key directrly to sidebar category

* Removed key definition on sidebar category

* Fix error of nested buttons on secretKeyModal

* Fix nested buttons on output modal

* Fix clip-path warning on components

* Fix components cannot be given refs on nodeOutputField

* Removed unused console.log

* Added key on profile pictures map

* Fixed hideOverlay being called when the table is destroyed

* Fixed valueFormatter error on Apply To Fields field on GlobalVariables page

* Updated headers on config page to ensure consistent design
2024-09-02 21:48:05 +00:00
Cristhian Zanforlin Lousa
70af48cfe4
fix: success dialog popping wrong (#3659)
* 🐛 (sideBarFolderButtons/index.tsx): fix success message not being set when files array is empty

* 🐛 (index.tsx): fix issue where success message was not being displayed when uploading files successfully
2024-09-02 14:10:47 -07:00
Cristhian Zanforlin Lousa
706d559003
fix: update Self Query Retriever Component (#3653)
* 🔧 (pyproject.toml): add lark dependency to support parsing and processing of grammars in the project
♻️ (SelfQueryRetriever.py): refactor input types in metadata fields to improve clarity and maintainability

* 📝 (SelfQueryRetriever.py): Update class name and imports for consistency and clarity
📝 (SelfQueryRetriever.py): Refactor input and output definitions for better readability and maintainability
📝 (SelfQueryRetriever.py): Refactor method signatures and variable names for improved code organization and understanding

* [autofix.ci] apply automated fixes

* ♻️ (SelfQueryRetriever.py): Remove unused import 'VectorStore' to clean up the code and improve maintainability.

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-09-02 20:19:37 +00:00
anovazzi1
076f4f0772
fix: update BUNDLES_SIDEBAR_FOLDER_NAMES constant to include "Notion" (#3651)
* chore: update BUNDLES_SIDEBAR_FOLDER_NAMES constant to include "Notion"

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-09-02 17:18:47 +00:00
Nicolò Boschi
9368aef91e
ci: add tests for text input/output components (#3649)
* ci: add tests for text input/output components

* ci: add tests for text input/output components

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-09-02 07:33:30 -07:00
Gabriel Luiz Freitas Almeida
3eaad7bc3a
feat: add EventManager to centralize callbacks (#3434)
* refactor: Update MessageBase text attribute based on isinstance check.

* feat: Add update_message function to update a message in the database.

* refactor(chat): Update imports and remove unnecessary config method in ChatComponent.

* refactor: Add stream_message method to ChatComponent.

* refactor: Update method call in ChatOutput component.

* feat: Add callback function to custom component and update build_results signature.

* feat: Add callback parameter to instantiate_class function.

* feat(graph): Add callback functions for sync and async operations.

* feat: Add callback function support to vertex build process.

* feat: Add handling for added message in InterfaceVertex class.

* feat: Add callback support to Graph methods.

* feat(chat): Add callback function to build_vertices function.

* refactor: Simplify update_message function and use session_scope for session management.

* fix: Call set_callback method if available on custom component.

* refactor(chat): Update chat message chunk handling and ID conversion.

* feat: Add null check before setting cache in build_vertex_stream function.

* refactor: Fix send_event_wrapper function and add callback parameter to _build_vertex function.

* refactor: Simplify conditional statement and import order in ChatOutput.

* refactor: move log method to Component class.

* refactor: Simplify CallbackFunction definition.

* feat: Initialize _current_output attribute in Component class.

* feat: store current output name in custom component during processing.

* feat: Add current output and component ID to log data.

* fix: Add condition to check current output before invoking callback.

* refactor: Update callback to log_callback in graph methods.

* feat: Add test for callback graph execution with log messages.

* update projects

* fix(chat.py): fix condition to check if message text is a string before updating message text in the database

* refactor(ChatOutput.py): update ChatOutput class to correctly store and assign the message value to ensure consistency and avoid potential bugs

* refactor(chat.py): update return type of store_message method to return a single Message object instead of a list of Messages
refactor(chat.py): update logic to correctly handle updating and returning a single stored message object instead of a list of messages

* update starter projects

* refactor(component.py): update type hint for name parameter in log method to be more explicit

* feat: Add EventManager class for managing events and event registration

* refactor: Update log_callback to event_manager in custom component classes

* refactor(component.py): rename _log_callback to _event_manager and update method call to on_log for better clarity and consistency

* refactor(chat.py): rename _log_callback method to _event_manager.on_token for clarity and consistency in method naming

* refactor: Rename log_callback to event_manager for clarity and consistency

* refactor: Update Vertex class to use EventManager instead of log_callback for better clarity and consistency

* refactor: update build_flow to use EventManager

* refactor: Update EventManager class to use Protocol for event callbacks

* if event_type is not passed, it uses the default send_event

* Add method to register event functions in EventManager

- Introduced `register_event_function` method to allow passing custom event functions.
- Updated `noop` method to accept `event_type` parameter.
- Adjusted `__getattr__` to return `EventCallback` type.

* update test_callback_graph

* Add unit tests for EventManager in test_event_manager.py

- Added tests for event registration, including default event type, empty string names, and specific event types.
- Added tests for custom event functions and unregistered event access.
- Added tests for event sending, including JSON formatting, empty data, and large payloads.
- Added tests for handling JSON serialization errors and the noop function.

* revert chatOutput change

* Add validation for event function in EventManager

- Introduced `_validate_event_function` method to ensure event functions are callable and have the correct parameters.
- Updated `register_event_function` to use the new validation method.

* Add tests for EventManager's event function validation logic

- Introduce `TestValidateEventFunction` class to test various scenarios for `_validate_event_function`.
- Add tests for valid event functions, non-callable event functions, invalid parameter counts, and parameter type validation.
- Include tests for handling unannotated parameters, flexible arguments, and keyword-only parameters.
- Ensure proper warnings and exceptions are raised for invalid event functions.

* Add type ignore comment to lambda function in test_event_manager.py

* refactor: Update EventManager class to use Protocol for event callbacks

* refactor(event_manager.py): simplify event registration and validation logic to enhance readability and maintainability
feat(event_manager.py): enforce event name conventions and improve callback handling for better error management

* refactor(chat.py): standardize event_manager method calls by using keyword arguments for better clarity and consistency
refactor(chat.py): extract message processing logic into separate methods for improved readability and maintainability
fix(chat.py): ensure proper handling of async iterators in message streaming
refactor(component.py): simplify event logging by removing unnecessary event name parameter in on_log method call

* update event manager tests

* Add callback validation and manager parameter in EventManager

- Introduced `_validate_callback` method to ensure callbacks are callable and have the correct parameters.
- Updated `register_event` to include `manager` parameter in the callback.

* Add support for passing callback through the Graph in test_callback_graph

* fix(event_manager.py): update EventCallback signature to include manager parameter for better context in event handling
2024-09-02 15:41:19 +02:00
Lucas Oliveira
882c35ef6b
fix: stop building with abort controller (#3634)
* Added buildController and stopBuilding controllers

* Used stop building in header Stop button

* Set the build controller in API performstreamingrequest

* added setbuildcontroller to types
2024-09-02 06:36:51 -07:00
Nicolò Boschi
96872f3aa5
chore: refactor and add components integration tests (#3607)
* improve inegration tests

* add fixes

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-09-02 15:21:47 +02:00
anovazzi1
4ee25359a5
feature: add flow notes (#3460)
* feat: Add NoteDraggableComponent to extraSidebarComponent

This commit adds the NoteDraggableComponent to the extraSidebarComponent in the FlowPage. The NoteDraggableComponent allows users to drag and drop sticky note icons onto the page. When a note is dragged, its data is set as "note" in the dataTransfer object. The note has a default text value of null and a noteColor of "yellow". This component enhances the user experience by providing a convenient way to add notes to the page.

* feat: Add NoteNode component for displaying and editing notes

This commit adds the NoteNode component, which is responsible for displaying and editing notes in the FlowPage. The NoteNode component includes functionality for resizing, selecting, and editing the note text. It enhances the user experience by providing a convenient way to add and manage notes on the page.

* feat: Add NoteNode and NoteDraggableComponent for managing notes in FlowPage

This commit adds the NoteNode component, responsible for displaying and editing notes in the FlowPage. It also introduces the NoteDraggableComponent, allowing users to drag and drop sticky note icons onto the page. These components enhance the user experience by providing a convenient way to add and manage notes on the page.

* feat: Add DRAG_EVENTS_CUSTOM_TYPESS constant for custom drag event types

This commit adds the DRAG_EVENTS_CUSTOM_TYPESS constant to the constants file. It defines custom drag event types for the generic node and note node components. This constant enhances the code by providing a centralized place to manage and reference the custom drag event types.

* feat: Add support functions for custom drag event types

* feat: Add support for custom drag event types in PageComponent

This commit adds support for custom drag event types in the PageComponent of the FlowPage. It imports the necessary functions from the utils file and uses them to check if the dragged data has supported node types. This enhancement improves the drag and drop functionality by allowing only supported node types to be dropped on the page.

* feat: Add NoteDataType for managing note data in FlowPage

* refactor: create new types for noteNode

* feat: Update NoteNode component to use new NoteDataType

The NoteNode component in the NoteNode/index.tsx file has been updated to use the new NoteDataType for managing note data in the FlowPage. This change ensures consistency and improves the codebase.

* node with title and description

* feat: Add "note" alias for StickyNote in nodeIconsLucide

This commit adds the "note" alias for the StickyNote icon in the nodeIconsLucide object in the styleUtils.ts file. This alias allows for more intuitive usage of the StickyNote icon by providing an alternative name. It improves code readability and maintainability.

* refactor: Update NodeDescription component to use emptyPlaceholder prop

The NodeDescription component in the GenericNode/components/NodeDescription/index.tsx file has been updated to use the emptyPlaceholder prop. This change allows for more flexibility in customizing the placeholder text when the description is empty. It improves code reusability and enhances the user experience.

* refactor: Remove unused Textarea import in NoteNode component

* add initial resize to note component

* [autofix.ci] apply automated fixes

* refactor: add code validation functionality on tanstack mutation (#3469)

* Added Validate endpoint

* Added API Code Validate type

* Added post validate code hook

* Used mutation instead of API call to validate code

* Removed validate code api call

* refactor: Update NodeName component to use full width in GenericNode

The NodeName component in the GenericNode module has been updated to use the full width of the parent container. This change ensures that the input field or tooltip for the node name occupies the entire available space, improving the visual consistency and user experience.

* refactor: Update NodeDescription component to use full height in GenericNode

The NodeDescription component in the GenericNode module has been updated to use the full height of the parent container. This change ensures that the description text area occupies the entire available space, improving the visual consistency and user experience.

* refactor: Update NodeDescription component to use full height in GenericNode

* refactor: Update NodeDescription component to use full height in GenericNode

* increase size control on note node

* refactor: Update NoteNode component to use constants for min and max dimensions

The NoteNode component in the CustomNodes module has been updated to use the constants for the minimum and maximum dimensions. This change improves code readability and maintainability by centralizing the values in the constants file. The component now uses the NOTE_NODE_MIN_WIDTH, NOTE_NODE_MIN_HEIGHT, NOTE_NODE_MAX_HEIGHT, and NOTE_NODE_MAX_WIDTH constants for setting the dimensions of the NodeResizer and the inline styles. This ensures consistency across the application and makes it easier to adjust the dimensions in the future.

* fix overflow issue

* refactor: update NoteDraggableComponent

The NoteDraggableComponent in the extraSidebarComponent module has been updated to remove unused code and improve functionality. The code for adding a note has been removed as it is no longer needed. Additionally, the component has been updated to use a new design and layout for better user experience. This refactor improves the overall code cleanliness and removes unnecessary clutter.

* refactor: Update NoteNode component to use constants for min and max dimensions

* update component to accept multiple colors

* update note colors

* update min width

* refactor: Update NodeDescription component to accept additional styling options

The NodeDescription component in the GenericNode module has been updated to accept additional styling options. The component now includes the inputClassName, mdClassName, and style props, allowing for more customization of the input and markdown elements. This refactor improves the flexibility and extensibility of the component, making it easier to adapt to different design requirements.

* fix bug on description size

* [autofix.ci] apply automated fixes

* feat: skip note nodes when building vertices"

add check to skip nodes of type NoteNode when building vertices in the graph
this prevents unnecessary processing of note nodes which are not part of the actual graph logic

* fix: update serialization and improve error handling (#3516)

* feat(utils): add support for V1BaseModel in serialize_field

Add support for V1BaseModel instances in the serialize_field function by
checking for a "to_json" method. If the method is not present, return the
attribute values as a dictionary.

* refactor: Update field serializer function and error handling in build_flow function

* fix: no module named 'psycopg2' (#3526)

* fix: add dependecy to Dockerfile

* fix: revert quick fix

* fix: update poetry.lock

* feat: add compression support to frontend and backend (#3484)

* Added compression lib to frontend

* Added compression handling to backend

* Added compression to body requests on frontend

* [autofix.ci] apply automated fixes

---------

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

* refactor: add code validation functionality on tanstack mutation (#3469)

* Added Validate endpoint

* Added API Code Validate type

* Added post validate code hook

* Used mutation instead of API call to validate code

* Removed validate code api call

* refactor: Update NodeName component to use full width in GenericNode

The NodeName component in the GenericNode module has been updated to use the full width of the parent container. This change ensures that the input field or tooltip for the node name occupies the entire available space, improving the visual consistency and user experience.

* fix imports

* refactor: remove unused import in styleUtils.ts

* refactor: update checkOldNodesOutput to include only generic nodes

The checkOldNodesOutput function in reactflowUtils.ts has been updated to include only generic nodes when checking for nodes without outputs. This change ensures that only nodes of type "genericNode" are considered, improving the accuracy of the check and preventing false positives.

* refactor: improve checkOldNodesOutput to include only generic nodes

* [autofix.ci] apply automated fixes

* 📝 (frontend): Add data-testid attribute to elements for testing purposes in NodeDescription, NoteToolbarComponent, NoteNode, and Textarea components
 (frontend): Create end-to-end test for interacting with sticky notes including creating, editing, duplicating, and deleting notes

*  (stop-building.spec.ts): Add a 1-second delay after clicking the stop building button to improve user experience
 (sticky-notes.spec.ts): Add a new end-to-end test for interacting with sticky notes on the main page to ensure functionality and user interaction with sticky notes.

* refactor: update NodeName and GenericNode components to improve UI and code readability

* [autofix.ci] apply automated fixes

* chore: Update NodeDescription component to use dark mode placeholder color

* chore: Update sidebar note component icon to use StickyNote instead of SquarePen

* refactor(main.py): remove unused imports and middleware related to GZip to simplify code and improve readability
feat(main.py): add middleware for configuring logger to improve logging functionality and centralize logging configuration

* add center postion in the flow

* chore: Update NoteNode icon to use SquarePen instead of StickyNote

* [autofix.ci] apply automated fixes

* chore: Update API base URL

* [autofix.ci] apply automated fixes

* chore:  add feature flag for MVPs

* code format

*  (NoteNode/index.tsx): Wrap IconComponent in a div with data-testid "note_icon" for better accessibility and testing
 (PageComponent/index.tsx): Add data-testid "add_note" to ControlButton for easier testing and identification
🔧 (sticky-notes.spec.ts): Update test selectors to use new data-testid "note_icon" and "add_note" for improved test reliability

* chore: Update types-markdown to version 3.7.0.20240822

* feat: Add lazy loading for images in sticky-notes.spec.ts

* [autofix.ci] apply automated fixes

* update poetry lock

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes

* Refactor feature flag import for ENABLE_MVPS across components and tests

* Add skip marker to unimplemented test in test_graph_state_model.py

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Lucas Oliveira <62335616+lucaseduoli@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: Ítalo Johnny <italojohnnydosanjos@gmail.com>
Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
2024-09-02 11:53:47 +00:00
Gabriel Luiz Freitas Almeida
bc6e918f49
fix: add tests to cycles in Graph and improve error handling (#3628)
* Add cycle detection and handling in graph edge building process

- Introduced `cycles` property to detect cycles in the graph.
- Modified `_build_edges` and `build_edge` methods to differentiate between `CycleEdge` and `Edge`.
- Updated imports and type hints to support new functionality.

* Add cycle detection and handling in graph processing

- Introduced `is_cyclic` property to check for cycles in the graph.
- Added `_snapshot` method for capturing the current state of the graph.
- Modified `layered_topological_sort` to handle cyclic graphs by starting from a specified start component.
- Updated imports and type hints for better code clarity and functionality.

* Refactor tests and components for improved caching and data handling

- Updated `test_vector_store_rag.py` to use `set_on_output` with `cache=True` and simplified assertions.
- Enhanced `test_memory_chatbot.py` with additional assertions for graph structure and caching.
- Simplified `to_data` method in `base.py` to directly return `_data` without JSON serialization.

* Add unit tests for detecting cycles in graph

- Introduce `test_cycle_in_graph` to verify cyclic behavior in the graph.
- Add `test_cycle_in_graph_max_iterations` to ensure max iterations limit is respected.
- Implement `Concatenate` component for testing purposes.

* Disable output cache in graph tests to allow loops to work

* Refactor: Update VertexStates enum values to uppercase and optimize imports in base.py

* Refactor type hints and improve error handling in `Vertex` class

- Replace `ValueError` with `NoComponentInstance` exception for missing component instances.
- Add `target_handle_name` parameter to `_get_result` method for better result retrieval.
- Refactor type hints to use `collections.abc` for `AsyncIterator`, `Generator`, and `Iterator`.
- Update type hints for `extract_messages_from_artifacts` and `successors_ids` methods to use generic `dict` and `list`.
2024-09-02 11:45:37 +00:00
dependabot[bot]
751edcf5dc
build(deps):(deps): bump install-pinned/ruff from 48a5818c5f7ce30e2822b67fb9c26d3e25d31fab to 826c99bfba88282a5506ab737c92253a106c070e (#3645)
build(deps):(deps): bump install-pinned/ruff

Bumps [install-pinned/ruff](https://github.com/install-pinned/ruff) from 48a5818c5f7ce30e2822b67fb9c26d3e25d31fab to 826c99bfba88282a5506ab737c92253a106c070e.
- [Release notes](https://github.com/install-pinned/ruff/releases)
- [Commits](48a5818c5f...826c99bfba)

---
updated-dependencies:
- dependency-name: install-pinned/ruff
  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-09-02 04:42:58 -07:00
Gabriel Luiz Freitas Almeida
e790925b75
feat(pyproject.toml): update langchain-google-vertexai, langchain-groq, langchain-pinecone, and langchain-mistralai versions to the latest available (#3604)
* feat(pyproject.toml): update langchain-google-vertexai, langchain-groq, langchain-pinecone, and langchain-mistralai versions to the latest available

update markdown and upstash-vector versions

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-08-31 14:40:29 -07:00
Lucas Oliveira
c9cf9d8304
refactor: update docs link to be modular (#3637)
changed docs link to be modular
2024-08-30 21:51:05 +00:00
Lucas Oliveira
47a9bf3890
fix: add unstructured icon (#3631)
Added Unstructured icon

Co-authored-by: Cristhian Zanforlin Lousa <cristhian.lousa@gmail.com>
2024-08-30 21:41:25 +00:00
Cristhian Zanforlin Lousa
70ac19740a
tests: add new tests to tableComponent (#3627)
* refactor: modularized categories and fixed Discover More not appearing

* refactor: modularized categories and fixed Discover More not appearing

* refactor: modularized categories and fixed Discover More not appearing

* refactor: add end-to-end test for interacting with table input component

* refactor: Remove duplicate ID in filterSidebar.spec.ts and remove commented code in tableInputComponent.spec.ts
2024-08-30 21:35:51 +00:00
Nicolò Boschi
1c87a804bf
chore: improve db session access (#3138)
* chore: improve db session access

* chore: improve db session access

* fix

* [autofix.ci] apply automated fixes

* Refactor session management in test_sqlite_pragmas to use with_session method

---------

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-30 14:03:29 -07:00
Lucas Oliveira
27b5f55ef9
refactor: health check endpoint (#3635)
* Changed health check to use /health_check and to be modularized

* Added default value

* Added health constant to default export

* check cors before inserting custom headers

* Added get global variables check on init

* Updated global variables to start with undefined

* Fixed redirect when showGeneralSettings is disabled

* Added isOpen props to custom api generator
2024-08-30 20:40:16 +00:00