Commit graph

5,194 commits

Author SHA1 Message Date
anovazzi1
6e75a05978
feat: Add authentication store and create useLogoutHook (#2763)
* feat: add authentication store and create useLogoutHook

* [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-17 19:02:19 +00:00
Daniel Gines
114cdb9ac6
feat: Add new Atlassian Confluence Component for document loading and vector database integration (#2718)
* feat: Add Gemma 2 to Groq model list (#2586)

Add gemma2 to groq_constants.py

* Adds new ConfluenceComponent module with lazy loading support

- Implements ConfluenceComponent to load documents from the Confluence platform.
- Adds necessary inputs, including URL, username, API key, space_key, and more.
- Supports configuration of max_pages for pagination control.
- Implements lazy loading in the load_documents method for incremental document processing.
- Allows immediate processing of documents as they are loaded.

This new module facilitates integration with the Confluence platform and enables efficient handling of large volumes of data.

* Adds new ConfluenceComponent module

- Implements ConfluenceComponent to load documents from the Confluence platform.
- Adds necessary inputs, including URL, username, API key, space key, and more.
- Supports configuration of max_pages for pagination control.

This new module facilitates integration with the Confluence platform.

* Updated load_documents method to use Data.from_document

- Changed load_documents method to convert documents using Data..from_document instead of docs_to_data for better integration with Data module.
- Updated trace_type to "tool" because the LangSmith API only supports one of the following types: ["tool", "chain", "llm", "retriever", "embedding", "prompt", "parser"].

* [autofix.ci] apply automated fixes

---------

Co-authored-by: Gordon Stein <7331488+gsteinLTU@users.noreply.github.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-07-17 17:48:56 +00:00
Gabriel Luiz Freitas Almeida
865d3adf3e
feat: add astra_assistants color to nodeColors and nodeNames (#2743)
Add a new color and name for the "astra_assistants" node in the styleUtils.ts file.
2024-07-17 12:59:03 -03:00
Gabriel Luiz Freitas Almeida
5f18baadb5
feat: add two new starter projects (#2758)
* feat: add sequential agent starter project

* feat: add hierarchical agent starter project

* update example

* refactor: update newFlowModal examples for Sequential Agent, Hierarchical Agent, and Complex Agent
2024-07-17 08:48:35 -07:00
Gabriel Luiz Freitas Almeida
51af9639f7
feat: Add newFlowModal examples for Sequential Agent, Hierarchical Agent, and Complex Agent (#2756)
This commit adds new examples to the newFlowModal component for Sequential Agent, Hierarchical Agent, and Complex Agent. Each example is rendered as an UndrawCardComponent with the corresponding flow data. This enhancement provides users with more options when creating new flows.
2024-07-17 11:27:00 -03:00
anovazzi1
13fe129e4b
refactor: add queries and mutation for authentication refactor (#2754)
* feat: add API endpoint for retrieving user data

* feat: add useAddUser hook for adding a user via API

* feat: add useGetUserPage hook for retrieving users with pagination

* refactor: optimize deletion of messages (#2714)

* feat: optimize deletion of messages in SessionView component

This commit optimizes the deletion of messages in the SessionView component by using the useDeleteMessages hook from the API queries. It replaces the useRemoveMessages hook that was previously used. The new implementation handles the deletion of messages more efficiently and provides better error handling. The selectedRows state is updated after successful deletion, and a success message is displayed to the user. In case of an error, an error message is shown.

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

* feat: optimize deletion of messages in SessionView component

This commit optimizes the deletion of messages in the SessionView component by using the useDeleteMessages hook from the API queries. It replaces the useRemoveMessages hook that was previously used. The new implementation handles the deletion of messages more efficiently and provides better error handling. The selectedRows state is updated after successful deletion, and a success message is displayed to the user. In case of an error, an error message is shown.

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

* refactor: optimize deletion of messages in SessionView component

This commit optimizes the deletion of messages in the SessionView component by using the useDeleteMessages hook from the API queries. It replaces the useRemoveMessages hook that was previously used. The new implementation handles the deletion of messages more efficiently and provides better error handling. The selectedRows state is updated after successful deletion, and a success message is displayed to the user. In case of an error, an error message is shown.

* [autofix.ci] apply automated fixes

---------

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: Lucas Oliveira <lucas.edu.oli@hotmail.com>
Co-authored-by: Lucas Oliveira <62335616+lucaseduoli@users.noreply.github.com>

* fix: component seems to be clickable (#2731)

* Changed card to not have shadow on hover if it is a component

* removed unused console.log

* feat: add logs field to ResultData and Vertex class (#2732)

* feat: add logs to ResultDataResponse in schemas.py

* feat(schema.py): add logs field to ResultData class to store log messages for better debugging and monitoring

* feat(vertex): add logs attribute to Vertex class to store logs for each vertex operation

* feat: add useDeleteUsers hook for deleting users via API

* feat: add useUpdateUser hook for updating user data via API

* feat: add useResetPassword hook for resetting user password via API

* feat: add logout API endpoint and useLogout hook

Add the `logout` API endpoint and the `useLogout` hook to handle user logout functionality. The `logout` API endpoint sends a PATCH request to the server to log out the user, while the `useLogout` hook provides a convenient way to call the `logout` API endpoint. This addition allows users to securely log out of the application.

* feat: add login API endpoint and useLoginUser hook

Add the `login` API endpoint and the `useLoginUser` hook to handle user login functionality. The `login` API endpoint sends a POST request to the server with the user's username and password to authenticate the user. The `useLoginUser` hook provides a convenient way to call the `login` API endpoint. This addition allows users to securely log in to the application.

* feat: add autologin API endpoint and useGetAutoLogin hook

Add the `autologin` API endpoint and the `useGetAutoLogin` hook to handle automatic login functionality. The `autologin` API endpoint sends a GET request to the server to check if the user is already logged in. The `useGetAutoLogin` hook provides a convenient way to call the `autologin` API endpoint. This addition allows for seamless automatic login for users who have previously logged in to the application.

* feat: add REFRESH constant and useRefrshAccessToken hook

Add the `REFRESH` constant to the `constants.ts` file and the `useRefrshAccessToken` hook to handle refreshing the access token. The `REFRESH` constant represents the API endpoint for refreshing the access token, and the `useRefrshAccessToken` hook provides a convenient way to call this endpoint. This addition allows for seamless token refreshing for authenticated users.

* refactor: fromat code

---------

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: Lucas Oliveira <lucas.edu.oli@hotmail.com>
Co-authored-by: Lucas Oliveira <62335616+lucaseduoli@users.noreply.github.com>
2024-07-17 13:36:48 +00:00
anovazzi1
23874b81ed
feat: add new freeze function to component (#2624)
* feat: Add new API endpoint for retrieving vertex order

This commit adds a new API endpoint, , which allows for retrieving the order of vertices in a graph. It includes the necessary functions and types to make the API request and process the response. This feature enhances the functionality of the application by providing the ability to retrieve and work with vertex order data.

* feat: Add missing semicolon in constants.ts

The commit adds a missing semicolon in the  file in the  directory. This fix ensures that the code is syntactically correct and prevents any potential issues that may arise from the missing semicolon.

* feat: Refactor usePostRetrieveVertexOrder to improve code readability and maintainability

* feat: Add FreezeAllSvg component for displaying a freeze all icon

This commit adds a new component called FreezeAllSvg, which is responsible for rendering an SVG icon representing the freeze all feature. The component accepts props for customizing the size and color of the icon. This addition enhances the visual representation of the freeze all functionality in the application.

* feat: Add freezeMultipleNodes method to FlowStoreType

This commit adds the `freezeMultipleNodes` method to the `FlowStoreType` interface in the `index.ts` file. The method takes an array of node IDs as input and freezes the corresponding nodes in the flow. This addition enhances the functionality of the flow store by providing the ability to freeze multiple nodes at once.

* feat: Update freezeMultipleNodes to use updateFreezeStatus and updateNodeInternals

Refactor the NodeToolbarComponent to use the updated freezeMultipleNodes method in the FlowStore. Instead of directly freezing the nodes, the method now calls updateFreezeStatus to update the freeze status of the nodes and updateNodeInternals to update the node internals. This change improves the functionality and maintainability of the code.

* feat: Update FreezeAllSvg component to use currentColor for fill

The commit updates the FreezeAllSvg component to use the CSS `currentColor` value for the fill property. This change ensures that the fill color of the SVG icon will match the current text color, providing a consistent and customizable visual representation of the freeze all feature.

* feat: Add freezeAll shortcut and component

This commit adds the `freezeAll` shortcut and component to the application. The `freezeAll` shortcut allows users to freeze all nodes in the flow at once, while the `FreezeAllSvg` component is responsible for rendering an SVG icon representing the freeze all feature. These additions enhance the functionality and user experience of the application by providing a convenient way to freeze multiple nodes and a visual representation of the freeze all feature.

* [autofix.ci] apply automated fixes

* feat: Refactor get_vertex method to include silent parameter

This commit refactors the `get_vertex` method in the `Graph` class to include a `silent` parameter. The `silent` parameter allows the method to be called without raising an exception if the vertex is not found. This change improves the flexibility and usability of the method, as it can now be used in scenarios where the absence of a vertex is expected.

* feat: check if parent vertex is frozen and cache children

* feat: change ungroup_node function to add frozen status to nodes

This commit refactors the `ungroup_node` function in the `utils.py` file to add the `frozen` status to each node in the list of nodes. The `frozen` status is obtained from the `group_node_data` parameter and is assigned to each node in the loop. This change improves the functionality and maintainability of the code by ensuring that the frozen status is correctly applied to the nodes during the ungrouping process.

* Refactor code to check if parent vertex is frozen before caching children

* feat: Rename "Freeze All" to "Freeze Path" in shortcuts and components

This commit updates the codebase to rename the "Freeze All" feature to "Freeze Path" in the shortcuts and components. The changes include modifying the constant name, updating the shortcut key, and adjusting the component names and labels. This renaming improves the clarity and accuracy of the feature, aligning it with its intended functionality of freezing a specific path in the flow.

* [autofix.ci] apply automated fixes

* fix: refactor get_vertex method to handle silent parameter

* fix(base.py): remove unnecessary silent parameter in get_vertex method and remove conditional check for silent parameter in get_vertex method to simplify code and improve readability

* Added new freezeAll icon

---------

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-16 23:48:20 +00:00
Lucas Oliveira
0897ee542a
feat: logs on component output (#2740)
* Added tabs and passed the type of the table to the SwitchOutputView component

* Added type to SwitchOutputViewProps and changed results based on type

* Removed unused import

* Changed type of VertexDataTypeAPI to include logs

* Added condition where type is Logs to display only table

* Added handling when resultMessage is empty to SwitchOutputView

* Removed return that made Logs not appear when its empty

* Fixed logs not appearing

* feat: Add _output_logs attribute to CustomComponent

The code changes include adding a new attribute `_output_logs` to the `CustomComponent` class. This attribute is a dictionary that stores logs related to output values. This change is necessary to enhance the logging functionality of the component.

Note: Please remove any meta information such as issue references, tags, or author names from the commit message.

* feat: Serialize messages with to_json() in BaseCrewComponent

This commit modifies the `BaseCrewComponent` class in the `crew.py` file. It adds serialization of messages using the `to_json()` method to avoid circular reference issues. The `_messages_dict` dictionary is serialized by converting each message object to JSON format. This change enhances the functionality of the component and improves the logging process.

Note: Please remove any meta information such as issue references, tags, or author names from the commit message.

---------

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-07-16 22:36:10 +00:00
Lucas Oliveira
424118be7b
feat: add vertical scrolling capability to starter examples (#2739)
* Fixed vertical size of newFlowModal

* Added vertical scroll options to newFlowModal and added wrapper to look nice
2024-07-16 16:40:32 -03:00
Lucas Oliveira
643271df40
fix: component seems to be clickable (#2731)
* Changed card to not have shadow on hover if it is a component

* removed unused console.log
2024-07-16 18:15:07 +00:00
anovazzi1
2d92233fc5
refactor: optimize deletion of messages (#2714)
* feat: optimize deletion of messages in SessionView component

This commit optimizes the deletion of messages in the SessionView component by using the useDeleteMessages hook from the API queries. It replaces the useRemoveMessages hook that was previously used. The new implementation handles the deletion of messages more efficiently and provides better error handling. The selectedRows state is updated after successful deletion, and a success message is displayed to the user. In case of an error, an error message is shown.

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

* feat: optimize deletion of messages in SessionView component

This commit optimizes the deletion of messages in the SessionView component by using the useDeleteMessages hook from the API queries. It replaces the useRemoveMessages hook that was previously used. The new implementation handles the deletion of messages more efficiently and provides better error handling. The selectedRows state is updated after successful deletion, and a success message is displayed to the user. In case of an error, an error message is shown.

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

* refactor: optimize deletion of messages in SessionView component

This commit optimizes the deletion of messages in the SessionView component by using the useDeleteMessages hook from the API queries. It replaces the useRemoveMessages hook that was previously used. The new implementation handles the deletion of messages more efficiently and provides better error handling. The selectedRows state is updated after successful deletion, and a success message is displayed to the user. In case of an error, an error message is shown.

* [autofix.ci] apply automated fixes

---------

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: Lucas Oliveira <lucas.edu.oli@hotmail.com>
Co-authored-by: Lucas Oliveira <62335616+lucaseduoli@users.noreply.github.com>
2024-07-16 18:10:25 +00:00
Lucas Oliveira
3d02075170
fix: sorting on advanced modal parameters (#2730)
Added sorting in advanced values
2024-07-16 17:27:21 +00:00
Lucas Oliveira
caae43bc9b
fix: empty input message on empty streaming (#2729)
Fixed streaming bug where it shows a message before starting streaming
2024-07-16 17:26:55 +00:00
anovazzi1
b7223063c7
refactor: update edit messages text on Session view compoenent (#2715)
* feat: Add useUpdateMessages hook for updating messages

* refactor: Update useUpdateMessages hook to use singular naming convention

* refactor: update on session view

* [autofix.ci] apply automated fixes

* refactor: delete unused function

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-07-16 17:44:04 +02:00
Igor Carvalho
c4b86e9d63
Fix: Clicking tags on share modal updates store immediately (#2720)
* Fix: Click tags on share modal share component to the store immediately

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: anovazzi1 <otavio2204@gmail.com>
2024-07-16 14:41:28 +00:00
Gabriel Luiz Freitas Almeida
5ef84f7911
feat: add CrewAI components and refactor codebase (#2647)
* feat: Add CrewAI icon component

This commit adds the CrewAI icon component to the project. The component is imported and used in the styleUtils file, allowing it to be used throughout the application. This addition enhances the visual representation of the CrewAI feature in the user interface.

* feat: Add CrewAI[tools] dependency to project

This commit adds the CrewAI dependency to the project by including it in the pyproject.toml file. The version specified is "^0.36.0" and the "tools" extras are included. This addition allows the project to utilize the features provided by CrewAI.

* fix: update crewai icon size

* feat: Add CrewAIAgent component

This commit adds the CrewAIAgent component to the project. The component represents an agent of CrewAI and includes various inputs and outputs for role, goal, backstory, tools, language model, memory, verbosity, and delegation. This addition enhances the functionality of the project by integrating with CrewAI and allows for more advanced agent-based interactions.

* feat: Add CrewAICrew component

This commit adds the CrewAICrew component to the project. The component represents a group of agents and defines how they should collaborate and the tasks they should perform. It includes various inputs and outputs for tasks, agents, topic, verbosity, memory, cache, max RPM, process, and more. This addition enhances the functionality of the project by integrating with CrewAI and allows for more advanced agent-based interactions.

* feat: Add CrewAITask component

This commit adds the CrewAITask component to the project. The component represents a task in CrewAI and includes inputs for description, expected output, tools, agent, and async execution. It also provides an output for the task itself. This addition enhances the functionality of the project by integrating with CrewAI and allows for the creation and execution of tasks within the system.

* refactor: Update build configuration in custom_component_update endpoint

This commit updates the build configuration in the custom_component_update endpoint of the endpoints.py file. The previous implementation was assigning the result of code_request.get_template() directly to the build_config parameter, which caused an issue. The updated code now assigns the result to the updated_build_config variable before passing it to the cc_instance.update_build_config() method. This change ensures that the correct build configuration is used and improves the functionality of the custom_component_update endpoint.

* feat: Add SequentialTask and HierarchicalTask classes

This commit adds the SequentialTask and HierarchicalTask classes to the tasks.py file in the base/agents/crewai directory. These classes represent different types of tasks in the CrewAI system. The SequentialTask class is used for sequential tasks, while the HierarchicalTask class is used for hierarchical tasks. This addition enhances the functionality of the project by providing the necessary classes for implementing different types of tasks in CrewAI.

* refactor: Update CrewAIAgentComponent class name

This commit updates the class name from "CrewAIAgent" to "CrewAIAgentComponent" in the CrewAIAgent.py file. The new name better reflects the nature of the class as a component and improves the clarity of the codebase.

* refactor: Update CrewAICrewSequential component

This commit adds the CrewAICrewSequential component to the project. The component represents a group of agents and defines how they should collaborate and the tasks they should perform in a sequential manner. It includes various inputs and outputs for tasks, verbosity, memory, cache, max RPM, and more. This addition enhances the functionality of the project by providing a specific component for sequential tasks in the CrewAI system.

* feat: Add CrewAICrewHierarchical component

This commit adds the CrewAICrewHierarchical component to the project. The component represents a group of agents and defines how they should collaborate and the tasks they should perform in a hierarchical manner. It includes various inputs and outputs for tasks, verbosity, memory, cache, max RPM, and more. This addition enhances the functionality of the project by providing a specific component for hierarchical tasks in the CrewAI system.

* refactor: Rename CrewAITask.py to CrewAITaskHierarchical.py

This commit renames the file "CrewAITask.py" to "CrewAITaskHierarchical.py" in the "helpers" directory of the "langflow/components/helpers" package. The new name better reflects the purpose of the file, which is to define the "CrewAITaskHierarchical" component. This change improves the clarity and organization of the codebase.

* feat: Add CrewAITaskSequential component

This commit adds the CrewAITaskSequential component to the project. The component represents a sequential task in CrewAI and includes inputs for task description, expected output, tools, agent, and async execution. It also provides an output for the task itself. This addition enhances the functionality of the project by integrating with CrewAI and allows for the creation and execution of sequential tasks within the system.

* feat: Add BaseCrewComponent class

This commit adds the BaseCrewComponent class to the project. The class represents a group of agents, defining how they should collaborate and the tasks they should perform. It includes various inputs and outputs for tasks, verbosity, memory, cache, max RPM, and more. This addition enhances the functionality of the project by providing a base component for creating and managing crews in the CrewAI system.

* refactor: Update display name of CrewAIAgentComponent to "CrewAI Agent"

* refactor: Remove CrewAICrewHierarchical component

This commit removes the CrewAICrewHierarchical component from the project. The component represented a group of agents and defined how they should collaborate and the tasks they should perform in a hierarchical manner. However, it is no longer needed and has been deemed unnecessary for the current project requirements. This removal streamlines the codebase and improves the clarity of the project.

* refactor: make Crew use BaseCrew class

* refactor: Replace CrewAICrewSequential with SequentialCrew

This commit replaces the deprecated CrewAICrewSequential component with the new SequentialCrew component. The SequentialCrew component represents a group of agents and defines how they should collaborate and the tasks they should perform in a sequential manner. This change improves the clarity and organization of the codebase by using a more descriptive and consistent naming convention for the component. It also aligns with the recent refactorings in the project, such as the removal of the CrewAICrewHierarchical component and the addition of the BaseCrewComponent class. Overall, this update enhances the functionality and maintainability of the project.

* refactor: Rename CrewAITaskHierarchical.py to HierarchicalTask.py

This commit renames the file "CrewAITaskHierarchical.py" to "HierarchicalTask.py" in the "helpers" directory of the "langflow/components/helpers" package. The new name better reflects the purpose of the file, which is to define the "HierarchicalTask" component. This change improves the clarity and organization of the codebase.

* refactor: Rename CrewAITaskSequential.py to SequentialTask.py

This commit renames the file "CrewAITaskSequential.py" to "SequentialTask.py" in the "helpers" directory of the "langflow/components/helpers" package. The new name better reflects the purpose of the file, which is to define the "SequentialTaskComponent" component. This change improves the clarity and organization of the codebase.

* style: reorder imports

* chore: update lock

* refactor: Refactor build_crew method in BaseCrewComponent

This commit refactors the build_crew method in the BaseCrewComponent class. The method was previously taking tasks and agents as arguments, but it was not using them correctly. This update removes the unnecessary arguments and fixes the method to correctly build a Crew object. This refactor improves the clarity and functionality of the codebase.

* refactor: Update status assignment in CrewAIAgentComponent

This commit updates the status assignment in the CrewAIAgentComponent class. Previously, the status was set using the `model_dump()` method of the agent, but it has been changed to use the `repr()` method instead. This change improves the clarity and consistency of the codebase.

* refactor: Add agents input to HierarchicalCrewComponent

This commit adds the "agents" input to the HierarchicalCrewComponent class in the "HierarchicalCrew.py" file. The "agents" input is a list of "Agent" objects and allows for better management and collaboration between agents within the crew. This addition enhances the functionality and flexibility of the HierarchicalCrewComponent, improving the overall codebase.

* refactor: Fix post_process_raw function in artifact.py

This commit fixes the post_process_raw function in the artifact.py file. Previously, the function was not correctly handling the case when the raw data was a BaseModel or a dictionary. This update ensures that the raw data is properly encoded using jsonable_encoder and updates the artifact_type accordingly. This fix improves the functionality and reliability of the codebase.

* refactor: Update CustomComponent's repr_value handling

This commit updates the repr_value handling in the CustomComponent class. Previously, the repr_value was being modified directly within the class, which could lead to unexpected behavior. This update ensures that the repr_value is returned instead of modifying it directly. Additionally, it adds proper handling for different types of repr_value, such as dictionaries and BaseModel objects. This refactor improves the clarity and maintainability of the codebase.

* update lock

* refactor: Add task input to SequentialTaskComponent

This commit adds the "task" input to the SequentialTaskComponent class in the "SequentialTask.py" file. The "task" input is a SequentialTask object that will perform the task. This addition enhances the functionality and flexibility of the SequentialTaskComponent, improving the overall codebase.

* refactor: Change log level of file retrieval message in LocalStorageService

* refactor(crew.py): update import statement to include InputTypes from langflow.inputs.inputs module to enhance code readability and maintainability

* chore: Update cachetools dependency to version 5.4.0

* feat(crew.py): add new methods get_task_callback and get_step_callback to handle task and step callbacks respectively

* refactor: Add allow_code_execution input to CrewAIAgentComponent

This commit adds the "allow_code_execution" input to the CrewAIAgentComponent class in the "CrewAIAgent.py" file. The "allow_code_execution" input is a boolean value that determines whether the agent is allowed to execute code. This addition enhances the functionality and flexibility of the CrewAIAgentComponent, improving the overall codebase.

* Add step_callback and task_callback inputs to HierarchicalCrewComponent and SequentialCrewComponent

* style(SequentialTask.py): remove unnecessary 'required' attribute from input definition in SequentialTaskComponent class

* chore: fix lint issues
2024-07-15 16:56:47 -07:00
Igor Carvalho
a3959650fc
refactor: store tags API (#2678)
* feat: create useGetTags hook to handle tags API

* refactor: use useGetTagsQuery hook to handle tags

* [autofix.ci] apply automated fixes

* refactor: remove unnecessary state handling

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: anovazzi1 <otavio2204@gmail.com>
2024-07-15 12:39:25 +00:00
Cristhian Zanforlin Lousa
85161650bc
feat: Add the ability to hide/show components without input/output (I/O). (#2669)
♻️ (use-row-data.tsx): remove redundant check for LANGFLOW_SUPPORTED_TYPES in useRowData hook
2024-07-12 21:13:32 +00:00
Igor Carvalho
b0bdfa211f
refactor: store likes API (#2661)
* feat: create usePostLikeComponent hook to handle store like API

* refactor: use usePostLikeComponent hook to handle store likes

* [autofix.ci] apply automated fixes

* refactor: use mutate loading instead of managing loading with react state

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-07-12 17:53:59 -03:00
Cristhian Zanforlin Lousa
dc5ac092fb
test: Add Test to Prevent Bug on Output Inspection for Grouped Components (#2667)
* add new test for bug on output inspection + grouped components

* [autofix.ci] apply automated fixes

* 🔧 (typescript_test.yml): increase shard count from 14 to 15 to distribute tests more evenly
🔧 (typescript_test.yml): fix syntax issues in conditional expressions

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-07-12 20:10:00 +00:00
Cristhian Zanforlin Lousa
cdb8c80a7e
fix: prevent to loop on keys of object profile pictures when It's not loaded yet (#2658)
🐛 (use-preload-images.tsx): add null check for profilePictures to prevent errors when profilePictures is undefined

Co-authored-by: anovazzi1 <otavio2204@gmail.com>
2024-07-12 17:43:24 +00:00
Cristhian Zanforlin Lousa
eb0a70f646
fix: adjust function that add incremental name on flows that already exists + tests (#2645)
* 🐛 (reactflowUtils.ts): fix addVersionToDuplicates to exclude the updated flow from existing names to prevent naming conflicts

*  (menuBar): add data-testid to flow configuration button for testing
 (sideBarFolderButtons): add data-testid to delete folder button for testing
 (folders.spec.ts): update test to use new data-testid for delete folder button
 (generalBugs-shard-4.spec.ts): add new end-to-end test for flow operations

---------

Co-authored-by: anovazzi1 <otavio2204@gmail.com>
2024-07-12 17:14:38 +00:00
Gabriel Luiz Freitas Almeida
ef6d954357
fix: optimize filtering of vertices in useFlowStore (#2662)
Refactor the filtering logic in the useFlowStore hook to optimize the performance. The code changes ensure that the nextVertices array is filtered correctly by excluding vertices that already exist in the last layer.

Co-authored-by: anovazzi1 <otavio2204@gmail.com>
2024-07-12 16:37:47 +00:00
anovazzi1
229b8680f7
fix: fix bug on row selection at IO modal (#2627)
* feat: optimize filtering of messages in SessionView component

The code changes in this commit optimize the filtering of messages in the SessionView component. The useMemo hook is used to memoize the filteredMessages array, which improves performance by avoiding unnecessary re-rendering.

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-07-12 15:28:56 +00:00
Cristhian Zanforlin Lousa
34ef234c42
fix: enable copy when dict is disabled (#2642)
 (dictAreaModal): add customizeCopy function to copy JSON to clipboard
2024-07-11 18:47:00 -03:00
Gabriel Luiz Freitas Almeida
7d7502744e
fix: update Multiselect component to use 'values' prop instead of 'value' (#2640) 2024-07-11 22:21:41 +02:00
596050
180e475cc3
Frontend Feature: Multiselect ui-component and merge refs hook (#2405)
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-11 09:14:10 -07:00
anovazzi1
fb39c095da
fix: issue with freeze value on page refresh (#2623) 2024-07-10 18:51:14 +00:00
Gabriel Luiz Freitas Almeida
3406575c67
feat: add Maritalk model component (#2595)
* feat: add Maritalk icon

* feat: add Maritalk model component

* fix: update icon size

* feat: optimize MaritalkModelComponent initialization

This commit optimizes the initialization of the MaritalkModelComponent class in the Maritalk.py file. It updates the default value for the 'temperature' parameter to be within the range of 0 to 1, using the RangeSpec class. This ensures that the temperature value is valid and improves the overall functionality of the component.

* style: format maritalk svg

* feat: optimize MaritalkModelComponent initialization

This commit optimizes the initialization of the MaritalkModelComponent class in the Maritalk.py file. It updates the default value for the 'temperature' parameter to be within the range of 0 to 1, using the RangeSpec class. This ensures that the temperature value is valid and improves the overall functionality of the component.

* feat: update 'stream' parameter to be advanced in MaritalkModelComponent

This commit updates the 'stream' parameter in the MaritalkModelComponent class to be an advanced option. By setting the 'advanced' attribute to True, the 'stream' parameter will only be visible to advanced users. This change improves the usability of the component by hiding this option from regular users who do not need it.
2024-07-10 09:13:19 -03:00
Gabriel Luiz Freitas Almeida
d28fe8eedc
fix: Improve vertex filtering and update is_vertex_runnable logic (#2612)
* feat: improve is_vertex_runnable method in RunnableVerticesManager

This commit improves the `is_vertex_runnable` method in the `RunnableVerticesManager` class. It adds an additional parameter `activated_vertices` to the method signature and updates the logic to check if a vertex is runnable based on the presence of activated vertices. This enhancement improves the accuracy of determining whether a vertex is runnable or not.

* fix: add predecessors to vertices_to_run

* style: fix lint issues

* feat: optimize vertex filtering in useFlowStore

This commit optimizes the vertex filtering logic in the `useFlowStore` function in `flowStore.ts`. It introduces a more efficient way to filter out vertices that are already being built, resulting in improved performance and accuracy.

* refactor: add is_active method to Vertex class

This commit adds the `is_active` method to the `Vertex` class in the `base.py` file. The `is_active` method checks if the state of the vertex is set to `ACTIVE` and returns a boolean value accordingly. This enhancement improves the readability and maintainability of the codebase.

* refactor: improve is_vertex_runnable method in RunnableVerticesManager

* refactor: improve find_runnable_predecessors_for_successors method in Graph class

* refactor: move test_create_function
2024-07-10 07:40:16 -03:00
Cristhian Zanforlin Lousa
7174e6ef7d
fix: show loading component state while images arent fully loaded (#2609)
*  (ProfilePictureForm): add loading state to handle initial loading state

* ♻️ (use-get-profile-pictures.ts): refactor profile pictures query to process data on the server side
♻️ (ProfilePictureForm): simplify state management by removing redundant loading state

* ♻️ (use-get-profile-pictures.ts): rename ProfilePicturesResponse to ProfilePicturesQueryResponse for clarity
♻️ (use-preload-images.tsx): add loading check to useEffect to prevent unnecessary execution
♻️ (profilePictureChooserComponent): update profilePictures prop type to handle undefined and add loading to usePreloadImages
♻️ (ProfilePictureForm): remove unnecessary state and use response directly from useGetProfilePicturesQuery

* 🐛 (use-preload-images.tsx): add missing dependency 'loading' to useEffect dependency array to ensure images are preloaded correctly
2024-07-09 19:57:46 -03:00
Cristhian Zanforlin Lousa
0df06c01b0
fix: re-implement logic to correctly save or update flow in the appropriate folder on autologin = false (#2610)
♻️ (frontend): remove unused imports and variables in cardComponent
 (authContext): add setAllFlows and setSelectedFolder to AuthProvider
 (undrawCards): add folderIdUrl for better URL handling
 (collectionCard): add folder URL handling for navigation
 (use-delete-multiple): add setAllFlows and setSelectedFolder to handleDeleteMultiple
 (componentsComponent): add isLoadingFolders and setSelectedFolder
 (tabsComponent): add folder URL handling for tab navigation
 (flowsManagerStore): add folder URL handling in saveFlowDebounce

 (foldersStore.tsx): add setSelectedFolder method to manage selected folder state
♻️ (foldersStore.tsx): move setIsLoadingFolders call to improve loading state management
 (flowsManager/index.ts): add folderId parameter to saveFlow and saveFlowDebounce methods for better flow management
 (folders/index.ts): add setSelectedFolder method to FoldersStoreType for better folder state management
2024-07-09 15:29:52 -07:00
Gabriel Luiz Freitas Almeida
06464eda46
feat: adds NVIDIA components (#2591)
* chore: Update langchain-nvidia-ai-endpoints dependency to version 0.1.2

* feat: Add NVIDIAEmbeddingsComponent for generating embeddings using NVIDIA models

* feat: Add NVIDIAModelComponent for generating text using NVIDIA LLMs

* feat: Add NvidiaRerankComponent for reranking documents using the NVIDIA API and a retriever

* fix: add type ignore

* chore: Update NVIDIAEmbeddingsComponent and NVIDIAModelComponent to handle type ignore

* chore(poetry.lock): update lock
2024-07-09 15:26:23 -03:00
anovazzi1
311b66361e
fix: make chat lock when building (#2592)
Fix:lock chat bug
2024-07-08 14:22:00 -07:00
anovazzi1
ca3367d8e5
fix: Refactor messages API and session view (#2577)
* feat: create boilerplate code for messages api

* centering functionality on one component

* refactor useGetMessages

* update to new type format

* refactor Session view and get messages logic

* update to session view to useGetMessageQuery

* remove old api call

* feat: create boilerplate code for messages api

* centering functionality on one component

* refactor useGetMessages

* update to new type format

* refactor Session view and get messages logic

* update to session view to useGetMessageQuery

* remove old api call

* [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-08 14:05:31 -07:00
Gabriel Luiz Freitas Almeida
7e222187e4
fix: remove redundant superuser only if it has never logged in (#2582)
fix: Remove redundant superuser only if it has never logged in

The code changes in `utils.py` check if the superuser exists and if it has never logged in. If both conditions are true, the superuser is deleted from the database. This improves the efficiency and security of the application.
2024-07-08 16:37:03 +00:00
Lucas Oliveira
74433bf023
fix: outdated code conditions and global variable (#2581)
* Fixed Check Code Validity to set outdated as false when type does not exist

* feat: Refactor update_template_values function

Refactor the `update_template_values` function to improve code readability and maintainability. Rename the parameters `frontend_template` to `new_template` and `raw_template` to `previous_template` for clarity. Update the variable names within the function accordingly.

* feat(update_template_field): update load_from_db in case field value is not the default

* refactor: update template values in PromptComponent

Update the `update_template_values` function in the `PromptComponent` class to improve code readability and maintainability. Rename the parameters `frontend_template` to `new_template` and `raw_template` to `previous_template` for clarity. Update the variable names within the function accordingly.

---------

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-07-08 15:23:03 +00:00
Gabriel Luiz Freitas Almeida
7abf697b7b
fix: update run_manager on state changes (#2560)
* feat: update RunnableVerticesManager to include an update_run_state method

* feat: refactor build_run_map method in RunnableVerticesManager

This commit refactors the `build_run_map` method in the `RunnableVerticesManager` class. Instead of directly accessing the `graph` object, it now takes `predecessor_map` and `vertices_to_run` as parameters. This improves code readability and maintainability.

* fix(state): set vertices_to_run and predecessor_map correctly when updating a state

* fix: set inactive vertices to active when updating graph

* fix: add conditions to avoid duplicated vertices in maps

This commit fixes a bug in the Graph class where the predecessor and successor maps were not being updated correctly. The bug caused incorrect mapping of edges in the graph. This fix ensures that the maps are updated properly when adding edges to the graph.

* refactor: fix vertex build response in chat.py

This commit fixes the `build_vertex` function in `chat.py` to correctly handle the `VertexBuildResponse` object. The `inactivated_vertices`, `next_vertices_ids`, and `top_level_vertices` attributes are now converted to lists to remove any duplicate values. This ensures that the response object contains unique values for these attributes. The fix improves the accuracy and reliability of the vertex build process.

* style(graph/base.py): update type annotations for predecessor_map and successor_map variables to improve code readability and maintain consistency

* fix: uncomment code for stopping build in MenuBar component
2024-07-06 22:54:25 -04:00
Cristhian Zanforlin Lousa
e63479556c
fix: add click event on button to retry check connection to backend (#2558)
♻️ (App.tsx): remove console.log statement from setRetry function
🐛 (fetchErrorComponent): add onClick handler to Retry button to ensure retry logic is executed
2024-07-05 16:57:20 +00:00
Nicolò Boschi
eb3420523e
feat: migrate chains and memories to Component syntax (#2528)
* feat: migrate chains and memories to Component syntax

* use base class

* add classes

* [autofix.ci] apply automated fixes

* fix tests

* fix tests

*  (filterSidebar.spec.ts): increase waitForTimeout from 1000ms to 2000ms to ensure elements are fully loaded before interaction

---------

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: cristhianzl <cristhian.lousa@gmail.com>
Co-authored-by: Cristhian Zanforlin Lousa <72977554+Cristhianzl@users.noreply.github.com>
2024-07-05 16:30:23 +00:00
Igor Carvalho
6f827ca3dd
fix: pasting files not working (#2548)
* fix: pasting files not working

* [autofix.ci] apply automated fixes

* refactor: change new import

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
Co-authored-by: anovazzi1 <otavio2204@gmail.com>
2024-07-05 13:57:48 +00:00
anovazzi1
eed5a6390a
fix: version display (#2555)
* fix version

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-07-05 13:38:58 +00:00
anovazzi1
46f82a6af4
fix: update use-get-health.ts (#2553)
* update getHealth function to use options param

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-07-05 13:18:38 +00:00
Lucas Oliveira
6b3f34da77
fix: refactor of api structure (#2544)
* Refactored mutation and query types and callables

* Refactored version and other queries to new way of calling function

* update type declaration to support options

* update getVersionQuery

* [autofix.ci] apply automated fixes

* update type declaration to remove on Fetch options

* remove onFetch from version

* update transactions query

* [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>
Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
2024-07-05 12:44:10 +00:00
Igor Carvalho
6443354720
refactor: change node to component on FE constants (#2545) 2024-07-05 09:34:24 -03:00
anovazzi1
6160f70011
feat: improve getHealth logic (#2537)
* create get health custom hook

* refactor getHealth to use useQuery get

* fix: getHealth in App.tsx

* [autofix.ci] apply automated fixes

* refactor: update API endpoint in useGetHealthQuery

* chore: use new get_helth body

* [autofix.ci] apply automated fixes

* update interfaces names

* [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-05 12:03:52 +00:00
Cristhian Zanforlin Lousa
bfaac8b4ba
refactor: add new use-query endpoint of upload files (#2533)
* refactor: add new use-query endpoint of upload files

* extend type for payload callbackSuccess

* [autofix.ci] apply automated fixes

* bugfix: drag and drop image on chat not working

* Refactored query function to use Options

* Used dedicated function as queryFn

*  (API): export use-post-upload-file in files index
♻️ (FileInput): refactor file upload mutation to use onSuccess and onError
♻️ (chatInput): refactor file upload mutation to use onSuccess and onError
♻️ (chatView): refactor file upload mutation to use onSuccess and onError

* ♻️ (use-get-download-images.ts): simplify getDownloadImagesFn function
♻️ (use-get-transactions.ts): simplify getTransactionsFn function
 (use-handle-file-change.tsx): add hook to handle file input changes
 (use-upload.tsx): add hook to handle file paste events

* Added type on Request Processor

---------

Co-authored-by: anovazzi1 <otavio2204@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Lucas Oliveira <lucas.edu.oli@hotmail.com>
2024-07-04 20:25:57 +00:00
Cristhian Zanforlin Lousa
4f586adf0a
fix: remove uneceessary logic to disable button on search components/flows (#2540)
♻️ (index.tsx): simplify disableInputSearch logic by removing redundant conditions
2024-07-04 17:10:26 -03:00
Cristhian Zanforlin Lousa
2b8d314e30
test: fix test after changes on LLMs components (#2538)
*  (tests): remove redundant test assertions in filterEdge-shard-0.spec.ts
 (tests): add new test assertions and remove redundant ones in filterEdge-shard-1.spec.ts

*  (filterSidebar.spec.ts): add test for visibility of helpersID Generator
♻️ (filterSidebar.spec.ts): remove redundant visibility test for textsplittersCharacterTextSplitter

---------

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-07-04 18:54:01 +00:00
Cristhian Zanforlin Lousa
cb8185237a
refactor: add types to constant on IO (#2536) 2024-07-04 17:00:52 +00:00