Commit graph

13,335 commits

Author SHA1 Message Date
Nicolò Boschi
f86e3d3a8c
chore: improve contributors guidelines (#2784) 2024-07-18 12:31:58 -07:00
Gabriel Luiz Freitas Almeida
f9359309f7
ci: remove pull_request_review event type from workflow configuration (#2808)
chore(conventional-labels.yml): remove unnecessary pull_request_review event type to streamline workflow configuration
2024-07-18 12:31:29 -07:00
Lucas Poli
e4a8769e8d
docs: Fixing integrations-langwatch.md (#2783)
Update integrations-langwatch.md

Fixing the link to Langwatch.

Updated link from langwatch.com to langwatch.ai
2024-07-18 19:28:30 +00:00
Gabriel Luiz Freitas Almeida
6ca5780908
refactor(callback): simplify import statements and type annotations for better readability (#2793)
* refactor: add LogFunctionType protocol for type hint

The LogFunctionType protocol is introduced to define the structure of a logging function that takes a message and an optional name parameter. This protocol will be used to ensure consistency and compatibility with other parts of the codebase when logging messages.

* refactor(callback.py): simplify import statements and type annotations for better readability
2024-07-18 19:22:41 +00:00
Gabriel Luiz Freitas Almeida
6ffe579c7d
ci: refactor CI workflow conditions to run only when PR is approved (#2805)
* refactor: add check-reviews job to ci.yml

* refactor(ci.yml): update path-filter condition to depend on the output of check-reviews job for improved readability and maintainability

* chore(ci.yml): remove check-reviews job and update path-filter condition to check for 'lgtm' label before running the job
2024-07-18 19:19:47 +00:00
Cristhian Zanforlin Lousa
6ee14a502c
fix: change initial status on loading flowManagerStore to prevent infinity loading (#2804)
🐛 (flowsManagerStore.ts): fix isLoading initial value to false to correctly reflect loading state
2024-07-18 19:05:36 +00:00
Jordan Frazier
5ed8d1a63a
feat: add ai/ml model and embedding components (#2781) 2024-07-18 11:52:38 -07:00
Cezar Vasconcelos
495c95f036
fix(OpenAIModel): Move seed assignment to correct position (#2779)
* fix(OpenAIModel): Move seed assignment to correct position

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-07-18 18:46:47 +00:00
Cristhian Zanforlin Lousa
910b9974f6
fix: add correctly switch case to components on sidebar (#2802)
* 📝 (headerComponent/index.tsx): Remove unnecessary width styling from header-end-division class
🔧 (sidebarComponent/index.tsx): Ensure correct import of cn function from utils/utils file
💡 (sidebarComponent/index.tsx): Refactor sidebarContent logic to cover all conditions and provide a default case if necessary

* 📝 (sidebarComponent/index.tsx): remove unnecessary comment about ensuring correct import of cn function
2024-07-18 18:40:28 +00:00
Cristhian Zanforlin Lousa
011ebc2a5c
fix: session error after retries + refactor on interceptor component (#2803)
* 📝 (API): Add AxiosRequestConfig to import statement in api.tsx for better type checking
🔧 (API): Add useFlowsManagerStore to import statement in api.tsx for managing saveLoading state
♻️ (API): Refactor ApiInterceptor function in api.tsx to improve error handling and flow control
📝 (API): Update comments in api.tsx for better code readability and understanding
🔧 (API): Add setSaveLoading function to FlowsManagerStoreType in flowsManagerStore.ts for managing saveLoading state

* 🐛 (frontend): fix potential error when api response is null or undefined by adding optional chaining to data property access

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-07-18 18:40:11 +00:00
Ikko Eltociear Ashimine
57c72d3ea4
docs: add Japanese README (#2760) 2024-07-18 15:05:16 -03:00
Gabriel Luiz Freitas Almeida
d897752f0a
refactor: update import statements in tools (#2796)
* fix: update import statement for WikipediaAPI.py

* fix: update import statement for flow_tool.py

* fix: update import statement in StructuredTool

* fix: update import in retriever tool
2024-07-18 17:24:06 +00:00
Gabriel Luiz Freitas Almeida
f504bcc8c2
fix(get-python-api-code): set the endpoint in the correct variable (#2800)
* feat: refactor upload_file function to handle optional tweaks parameter

Refactor the upload_file function in utils.py to handle the optional tweaks parameter. If the tweaks parameter is not provided, it is set to an empty dictionary. This change improves the flexibility and usability of the function.

* fix(get-python-api-code): set the endpoint in the correct variable
2024-07-18 17:22:45 +00:00
Gabriel Luiz Freitas Almeida
66e6370ea8
ci: update path-filter job condition in ci.yml (#2801)
refactor: update path-filter job condition in ci.yml

The path-filter job condition in ci.yml has been updated to include an additional check for the 'workflow_dispatch' event. This change ensures that the job runs when the event is triggered manually, in addition to when the pull request is approved or when it is not a draft PR. The updated condition improves the flexibility and coverage of the path-filter job.
2024-07-18 16:58:23 +00:00
Harshith Deshalli Ravi
2caec4fd72
fix(readme): correct urls in documentation (#2795)
* fix all hugging face links in README.md

* Update README.PT.md

Fix all hugging face links
2024-07-18 15:24:48 +00:00
Gabriel Luiz Freitas Almeida
0122a50a35
refactor: move tests folder structure and update pytest commands (#2785)
* refactor: move tests folder to src/backend

* chore(Makefile): update pytest commands to run tests from the correct directory paths for unit and integration tests

* refactor: update file path in test_custom_component.py

The file path in the test_custom_component.py file has been updated to use the correct relative path to the component_multiple_outputs.py file. This change ensures that the test code can access the correct file and improves the reliability of the test.
2024-07-18 15:19:43 +00:00
Gabriel Luiz Freitas Almeida
afdff210b3
fix (typescript_test) : change cache-key to avoid errors (#2789)
fix(typescript_test.yml): change cache-key to avoid errors
2024-07-18 07:59:35 -07:00
Gabriel Luiz Freitas Almeida
6d291c88c1
feat: introduce helper functions for dynamic tracer import (#2778)
* fix: remove unused import in langwatch.py

* feat(tracing/service.py): introduce helper functions _get_langsmith_tracer and _get_langwatch_tracer to dynamically import tracers
2024-07-17 16:55:47 -07:00
Gabriel Luiz Freitas Almeida
d2a8f332de
fix: update langflow-base dependency to use local path (#2777)
Update the langflow-base dependency in pyproject.toml to use the local path "./src/backend/base" with the "develop" flag. This change allows for easier development and testing of the langflow-base module.
2024-07-17 16:37:40 -07:00
Gabriel Luiz Freitas Almeida
6fe229450e
fix: add nanoid dependency (#2776)
* refactor: import nanoid only after setting up langwatch

* fix: update nanoid to version 2.0.0

* chore: Update langflow-base dependency to version 0.0.86
2024-07-17 16:30:15 -07:00
Gabriel Luiz Freitas Almeida
1573d6126e
fix: return in case langwatch is not ready (#2773) 2024-07-17 15:43:48 -07:00
Lucas Oliveira
bf16cc158e
feat: add undraw cards for new flows (#2772)
Added cards for Complex Agent, Sequential Tasks and HierarchicalTasks
2024-07-17 15:25:00 -07:00
Lucas Oliveira
108decfeaa
fix: refactor mutation type (#2767)
* Fixed Mutation Types to include options as undefined

* Updated mutation function type to not include params if it is undefined

* updated useAddUser type to match the new useMutationFunctionType

* updated useDeleteUser type to match the new useMutationFunctionType

* feat: Update useLoginUser mutation function type

The useLoginUser mutation function type has been updated to match the new useMutationFunctionType signature. This change ensures consistency and compatibility with other mutation functions in the codebase.

* chore: Update useLogout mutation function type

The useLogout mutation function type has been updated to match the new useMutationFunctionType signature. This change ensures consistency and compatibility with other mutation functions in the codebase.

* feat: Update useRefreshAccessToken mutation function type

The useRefreshAccessToken mutation function type has been updated to match the new useMutationFunctionType signature. This change ensures consistency and compatibility with other mutation functions in the codebase.

* feat: Update useResetPassword mutation function type

The useResetPassword mutation function type has been updated to match the new useMutationFunctionType signature. This change ensures consistency and compatibility with other mutation functions in the codebase.

* feat: Update useUpdateUser mutation function type

The useUpdateUser mutation function type has been updated to match the new useMutationFunctionType signature. This change ensures consistency and compatibility with other mutation functions in the codebase.

* chore: Update useDeleteMessages mutation function type

The useDeleteMessages mutation function type has been updated to match the new useMutationFunctionType signature. This change ensures consistency and compatibility with other mutation functions in the codebase.

* refactor: Update useUpdateMessage mutation function type

The useUpdateMessage mutation function type has been updated to match the new useMutationFunctionType signature. This change ensures consistency and compatibility with other mutation functions in the codebase.

* feat: Update usePostLikeComponent mutation function type

The usePostLikeComponent mutation function type has been updated to match the new useMutationFunctionType signature. This change ensures consistency and compatibility with other mutation functions in the codebase.

* chore: Update usePostRetrieveVertexOrder mutation function type

The usePostRetrieveVertexOrder mutation function type has been updated to match the new useMutationFunctionType signature. This change ensures consistency and compatibility with other mutation functions in the codebase.

* refactor: Update useGetProfilePicturesQuery function type

The useGetProfilePicturesQuery function type has been updated to match the new useQueryFunctionType signature. This change ensures consistency and compatibility with other query functions in the codebase.

* feat: Update profile picture chooser component to use ProfilePicturesQueryResponse

The profile picture chooser component has been updated to use the `ProfilePicturesQueryResponse` type from the `@/controllers/API/queries/files` module. This change ensures consistency and compatibility with other parts of the codebase.

* refactor: Update ProfilePictureForm to use ProfilePicturesQueryResponse

Refactor the ProfilePictureForm component to use the ProfilePicturesQueryResponse type from the "@/controllers/API/queries/files" module. This change ensures consistency and compatibility with other parts of the codebase.

* refactor: Update handleGetProfilePictures to use useGetProfilePicturesQuery

Refactor the handleGetProfilePictures function in the GeneralPage component to use the useGetProfilePicturesQuery hook instead of manually calling the useGetProfilePicturesQuery function. This change ensures consistency and compatibility with other parts of the codebase.

* Refactored logout to use the onSuccess and onError inside the API hook instead of in a new hook.
2024-07-17 21:54:45 +00:00
Gabriel Luiz Freitas Almeida
31a3c4985a
fix: add check before setting up LangSmithTracer (#2771)
* fix: add check before setting up LangSmithTracer

Refactor the LangSmithTracer class in langsmith.py to improve error handling during initialization. The setup_langsmith method now checks for the presence of the LANGCHAIN_API_KEY environment variable before proceeding with the setup. This ensures that the tracer is only initialized when the necessary API key is available. Additionally, the order of operations within the __init__ method has been adjusted to ensure that the setup_langsmith method is called after the necessary attributes are assigned. These changes enhance the reliability and robustness of the LangSmithTracer.

* fix(langsmith.py): add conditional check to prevent executing code if tracer is not ready

---------

Co-authored-by: Lucas Oliveira <62335616+lucaseduoli@users.noreply.github.com>
2024-07-17 21:45:28 +00:00
Gabriel Luiz Freitas Almeida
2c3e93bd87
feat: add message_output and refactor LCAgentComponent (#2755)
* feat(agent.py): add support for handling message responses in LCAgentComponent to improve agent functionality and interaction with messages

* feat: add ToolEnabledLanguageModel type alias to constants.py

This commit adds a new type alias `ToolEnabledLanguageModel` to the `constants.py` file in the `field_typing` module. This type alias is used to define the type of language models that have tooling enabled. It includes the `BaseLanguageModel`, `BaseLLM`, and `BaseChatModel` types. This change enhances the typing capabilities of the codebase and improves the clarity of the code.

* feat: update agent.py to include support for ToolEnabledLanguageModel

This commit modifies the `agent.py` file to include support for the `ToolEnabledLanguageModel` in the `LCToolsAgentComponent` class. The `ToolEnabledLanguageModel` is now added as an input type in the `HandleInput` section. This change enhances the functionality of the agent by allowing it to work with language models that have tooling enabled. The addition of this input type improves the flexibility and versatility of the codebase.

* feat: add support for ToolEnabledLanguageModel in LCAgentComponent

This commit modifies the `agent.py` file to include support for the `ToolEnabledLanguageModel` in the `LCAgentComponent` class. The `ToolEnabledLanguageModel` is now added as an input type in the `HandleInput` section. This change enhances the functionality of the agent by allowing it to work with language models that have tooling enabled. The addition of this input type improves the flexibility and versatility of the codebase.

* feat: add AgentAsyncHandler for handling callbacks from Agents

This commit adds the `AgentAsyncHandler` class to handle callbacks from langchain in the `callback.py` file. The `AgentAsyncHandler` is an async callback handler that can be used to handle various events such as tool start, tool end, agent action, and agent finish. This change enhances the functionality of the codebase by providing a convenient way to handle callbacks from langchain and log the events if a log function is provided.

* chore: add field_serializer decorator to Log class for message serialization

This commit adds the `field_serializer` decorator to the `Log` class in the `schema.py` file. The decorator is used to serialize the `message` attribute of the `Log` class, ensuring that all nested objects are properly serialized. This change improves the serialization process and enhances the functionality of the codebase.

* feat: Fix issue with logs in LangSmithTracer

This commit fixes an issue in the `LangSmithTracer` class where logs were not being properly serialized. The `add_metadata` method now converts logs to dictionaries using the `model_dump` method if they are not already dictionaries. This ensures that all logs are correctly serialized and improves the functionality of the codebase.

* feat: Add support for Pydantic V1 models in Log serialization

* fix: Update LCAgentComponent to handle list results in result variable

This commit modifies the `LCAgentComponent` class in the `agent.py` file to handle list results in the `result` variable. If the `result` is a list, it is joined into a single string using the `text` attribute of each result dictionary. This change improves the functionality of the codebase by ensuring that the `result` variable is always a string, which is expected by the `Message` class.

* feat: Add "name" parameter to AgentAsyncHandler methods

This commit adds a "name" parameter to the `on_tool_start`, `on_tool_end`, `on_agent_action`, and `on_agent_finish` methods of the `AgentAsyncHandler` class in the `callback.py` file. The "name" parameter allows for specifying a name for the event, which can be useful for logging and tracking purposes. This change enhances the functionality of the codebase by providing more flexibility in handling callbacks and improves the clarity of the code.

* feat: Update AgentAsyncHandler constructor to support logging multiple loggable types

This commit updates the `AgentAsyncHandler` constructor in the `callback.py` file to support logging multiple loggable types. The `log_function` parameter now accepts a callable that can handle either a single `LoggableType` or a list of `LoggableType` objects along with a string representing the event name. This change enhances the flexibility of the codebase by allowing for more versatile logging options and improves the clarity of the code.

* refactor(callback.py): update type hints in AgentAsyncHandler constructor and methods for better readability and accuracy
refactor(callback.py): simplify on_tool_end method by using **kwargs for flexibility and consistency with other methods
2024-07-17 21:38:40 +00:00
Gabriel Luiz Freitas Almeida
d4f5d149a8
chore: Update langwatch to 0.1.10 (#2770)
feat: Update langwatch to 0.1.10
2024-07-17 21:21:00 +00:00
github-actions[bot]
868e22c6c3
docs: update docs from notion (#2747)
Update docs from Notion

Co-authored-by: ogabrielluiz <ogabrielluiz@users.noreply.github.com>
2024-07-17 21:11:21 +00:00
Gabriel Luiz Freitas Almeida
e8afe6ca23
fix: update projects with new components (#2769)
* update projects

* Update projects
2024-07-17 21:01:28 +00:00
Cristhian Zanforlin Lousa
e765a7fee6
fix: treat auto login session when changed on backend .env (#2768)
* feat(App.tsx): add LANGFLOW_AUTO_LOGIN_OPTION constant to handle auto login feature
feat(authContext.tsx): add LANGFLOW_AUTO_LOGIN_OPTION constant to handle auto login feature
feat(api.tsx): add support for LANGFLOW_AUTO_LOGIN_OPTION constant to handle auto login feature
feat(LoginPage/index.tsx): add support for auto login feature in login function
feat(LoginAdminPage/index.tsx): add support for auto login feature in login function

* [autofix.ci] apply automated fixes

* 🐛 (frontend): fix potential bug by checking if response object is null before accessing status property in saveFlowToDatabase and getFlowFromDatabase functions

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-07-17 20:55:21 +00:00
Lucas Oliveira
785771acef
fix: loading on small buttons (#2764)
* Formatting

* Fixed loading on buttons that are small

---------

Co-authored-by: anovazzi1 <otavio2204@gmail.com>
2024-07-17 20:18:52 +00:00
Gabriel Luiz Freitas Almeida
c26dd41679
feat: add new complex agent starter project (#2765)
* feat: add new complex agent starter project

* update project
2024-07-17 21:36:29 +02:00
Gabriel Luiz Freitas Almeida
b23e17e54a
refactor: update tools output type to Tool (#2766)
* refactor: update tools output type to Tool

* refactor: Update BingSearchAPI to return Tool type
2024-07-17 19:32:52 +00:00
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
Nicolò Boschi
b281a7d25e
feat: migrate Search APIs to Component syntax (#2637)
* feat: migrate bingsearch to Component syntax

* all

* fix style

* [autofix.ci] apply automated fixes

* feat: Update BingSearchAPI and WikipediaAPI components

Refactor the BingSearchAPI and WikipediaAPI components to improve code organization and readability. Migrate BingSearchAPI to Component syntax and make initialization separate from the constructor. Update the condition to run end_all_traces in the BingSearchAPIComponent. Also, update the WikipediaAPIComponent to use the WikipediaAPIWrapper with the specified parameters.

* update lock

---------

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-17 17:41:03 +00:00
Gabriel Luiz Freitas Almeida
e7c4474e07
ci: add auto_merge_enabled to pull_request types in ci.yml (#2762)
ci.yml: add pull_request types for auto_merge_enabled
2024-07-17 14:27:12 -03:00
Daniel Gines
8980538879
feat: Improvements to Makefile: Directory Cleanup and Descriptive Comments (#2745)
Updates and changes to the Makefile:

1. Added removal of `frontend` directory inside `src/backend/base/langflow/` and `build` directory inside `src/frontend/` to the `clean_npm_cache` target.
2. Added descriptive comments for the `build_and_install`, `build_and_run`, `fix_codespell`, `setup_poetry`, `unit_tests`, `integration_tests`, and `tests_frontend` targets.

Looking forward to your feedback.
2024-07-17 13:59:06 -03:00
Gabriel Luiz Freitas Almeida
c15e8ace8a
ci: update conditions at which CI runs (#2761)
* ci(conventional-labels.yml): update pull_request_target event types to remove unnecessary spaces and adjust pull_request_review event types to only trigger on submitted actions

* feat: add condition to run path-filter job only if PR is approved, manual run, or not a draft PR
2024-07-17 16:56:28 +00:00
Gabriel Luiz Freitas Almeida
50a64b0e0e
feat: Add YFinanceTool component for interacting with Yahoo Finance News (#2759)
* feat: add yfinance dependency to pyproject.toml

* feat: Add YFinanceTool component for interacting with Yahoo Finance News

* refactor: update YfinanceToolComponent to use type casting for Tool return value
2024-07-17 16:18:00 +00:00
Rodrigo Nader
d509c0a998
Update README.md 2024-07-17 13:15:47 -03: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
b2ad14e6a9
fix(crewai): replace MessageTextInput with MultilineInput (#2757)
* feat: Update input handling in HierarchicalTaskComponent

The code changes modify the `HierarchicalTaskComponent` in the `HierarchicalTask.py` file. The `MessageTextInput` inputs are replaced with `MultilineInput` inputs to allow for multiline descriptions and expected outputs. This change improves the user experience and provides more flexibility in input handling.

* refactor: Update input handling in SequentialTaskComponent

The code changes modify the `SequentialTaskComponent` in the `SequentialTask.py` file. The `MessageTextInput` inputs are replaced with `MultilineInput` inputs to allow for multiline descriptions and expected outputs. This change improves the user experience and provides more flexibility in input handling.

* refactor: Update input handling in CrewAIAgentComponent

The code changes modify the `CrewAIAgentComponent` in the `CrewAIAgent.py` file. The `MessageTextInput` inputs are replaced with `MultilineInput` inputs to allow for multiline descriptions and expected outputs. This change improves the user experience and provides more flexibility in input handling.
2024-07-17 14:48:15 +00: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
Gabriel Luiz Freitas Almeida
6ef0d0c1f9
feat: add opentelemetry-instrumentation-fastapi dependency (#2751)
Add opentelemetry-instrumentation-fastapi as a dependency in pyproject.toml and poetry.lock files. This dependency is required for instrumenting FastAPI with OpenTelemetry for distributed tracing and monitoring.
2024-07-17 11:59:43 +00:00
Gabriel Luiz Freitas Almeida
7aa4565343
chore(pyproject.toml): update package versions for langflow and langflow-base to 1.0.10 and 0.0.86 respectively (#2746) 2024-07-16 17:59:11 -07:00
Jordan Frazier
ae3439c40b
ci: add astra integration tests to CI (#2643)
* Add astra integration tests to CI

* Add astra integration tests to CI

* revert whitespace changes

* update filter

* Swap to using a scheduled job rather than filter
2024-07-16 17:38:17 -07: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