Commit graph

13,490 commits

Author SHA1 Message Date
Gabriel Luiz Freitas Almeida
865fc24293
refactor: update schema.py to include Edge related types (#3117)
* refactor: update code references to use _code instead of code

* refactor: add backwards compatible attributes to Component class

* refactor: update Component constructor to pass config params with underscore

Refactored the `Component` class in `component.py` to handle inputs and outputs. Added a new method `map_outputs` to map a list of outputs to the component. Also updated the `__init__` method to properly initialize the inputs, outputs, and other attributes. This change improves the flexibility and extensibility of the `Component` class.

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

* refactor: change attribute to use underscore

* refactor: update CustomComponent initialization parameters

Refactored the `instantiate_class` function in `loading.py` to update the initialization parameters for the `CustomComponent` class. Changed the parameter names from `user_id`, `parameters`, `vertex`, and `tracing_service` to `_user_id`, `_parameters`, `_vertex`, and `_tracing_service` respectively. This change ensures consistency and improves code readability.

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

* refactor: update BaseComponent to accept UUID for _user_id

Updated the `BaseComponent` class in `base_component.py` to accept a `UUID` type for the `_user_id` attribute. This change improves the type safety and ensures consistency with the usage of `_user_id` throughout the codebase.

* refactor: import nanoid with type annotation

The `nanoid` import in `component.py` has been updated to include a type annotation `# type: ignore`. This change ensures that the type checker ignores any errors related to the `nanoid` import.

* fix(custom_component.py): convert _user_id to string before passing to functions to ensure compatibility with function signatures

* feat(component.py): add method to set output types based on method return type to improve type checking and validation in custom components

* refactor: extract method to get method return type in CustomComponent

* refactor(utils.py): refactor code to use _user_id instead of user_id for consistency and clarity

perf(utils.py): optimize code by reusing cc_instance instead of calling get_component_instance multiple times

* refactor(utils.py, base.py): change parameter name 'add_name' to 'keep_name' for clarity and consistency in codebase

* [autofix.ci] apply automated fixes

* refactor: update schema.py to include Edge related typres

The `schema.py` file in the `src/backend/base/langflow/graph/edge` directory has been updated to include the `TargetHandle` and `SourceHandle` models. These models define the structure and attributes of the target and source handles used in the edge data. This change improves the clarity and consistency of the codebase.

* refactor: update _extract_return_type method in CustomComponent to accept Any type

The _extract_return_type method in CustomComponent has been updated to accept the Any type as the return_type parameter. This change improves the flexibility and compatibility of the method, allowing it to handle a wider range of return types.

* refactor: update BaseComponent to use get_template_config method

Refactored the `BaseComponent` class in `base_component.py` to use the `get_template_config` method instead of duplicating the code. This change improves code readability and reduces redundancy.

* feat: add BaseModel class with model_config attribute

A new `BaseModel` class has been added to the `base_model.py` file. This class extends the `PydanticBaseModel` and includes a `model_config` attribute of type `ConfigDict`. This change improves the codebase by providing a base model with a configuration dictionary for models.

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

* refactor: update langflow.graph.edge.schema.py

Refactor the `langflow.graph.edge.schema.py` file to include the `TargetHandle` and `SourceHandle` models. This change improves the clarity and consistency of the codebase.

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

* refactor: update build_custom_component_template to use add_name instead of keep_name

Refactor the `build_custom_component_template` function in `utils.py` to use the `add_name` parameter instead of the deprecated `keep_name` parameter. This change ensures consistency with the updated method signature and improves code clarity.

* feat(component.py): add method to set output types based on method return type to improve type checking and validation in custom components (#3115)

* feat(component.py): add method to set output types based on method return type to improve type checking and validation in custom components

* refactor: extract method to get method return type in CustomComponent

* refactor: update _extract_return_type method in CustomComponent to accept Any type

The _extract_return_type method in CustomComponent has been updated to accept the Any type as the return_type parameter. This change improves the flexibility and compatibility of the method, allowing it to handle a wider range of return types.

* refactor: add _template_config property to BaseComponent

Add a new `_template_config` property to the `BaseComponent` class in `base_component.py`. This property is used to store the template configuration for the custom component. If the `_template_config` property is empty, it is populated by calling the `build_template_config` method. This change improves the efficiency of accessing the template configuration and ensures that it is only built when needed.

* refactor: add type checking for Output types in add_types method

Improve type checking in the `add_types` method of the `Output` class in `base.py`. Check if the `type_` already exists in the `types` list before adding it. This change ensures that duplicate types are not added to the list.

* update starter projects

* refactor: optimize imports in base.py

Optimize imports in the `base.py` file by removing unused imports and organizing the remaining imports. This change improves code readability and reduces unnecessary clutter.

* fix(base.py): fix condition to check if self.types is not None before checking if type_ is in self.types

* refactor: update build_custom_component_template to use add_name instead of keep_name

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-08-01 12:34:16 +00:00
Gabriel Luiz Freitas Almeida
34bb9d9130
refactor: parameter name 'add_name' to 'keep_name' (#3116)
* refactor: update code references to use _code instead of code

* refactor: add backwards compatible attributes to Component class

* refactor: update Component constructor to pass config params with underscore

Refactored the `Component` class in `component.py` to handle inputs and outputs. Added a new method `map_outputs` to map a list of outputs to the component. Also updated the `__init__` method to properly initialize the inputs, outputs, and other attributes. This change improves the flexibility and extensibility of the `Component` class.

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

* refactor: change attribute to use underscore

* refactor: update CustomComponent initialization parameters

Refactored the `instantiate_class` function in `loading.py` to update the initialization parameters for the `CustomComponent` class. Changed the parameter names from `user_id`, `parameters`, `vertex`, and `tracing_service` to `_user_id`, `_parameters`, `_vertex`, and `_tracing_service` respectively. This change ensures consistency and improves code readability.

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

* refactor: update BaseComponent to accept UUID for _user_id

Updated the `BaseComponent` class in `base_component.py` to accept a `UUID` type for the `_user_id` attribute. This change improves the type safety and ensures consistency with the usage of `_user_id` throughout the codebase.

* refactor: import nanoid with type annotation

The `nanoid` import in `component.py` has been updated to include a type annotation `# type: ignore`. This change ensures that the type checker ignores any errors related to the `nanoid` import.

* fix(custom_component.py): convert _user_id to string before passing to functions to ensure compatibility with function signatures

* feat(component.py): add method to set output types based on method return type to improve type checking and validation in custom components

* refactor: extract method to get method return type in CustomComponent

* refactor(utils.py): refactor code to use _user_id instead of user_id for consistency and clarity

perf(utils.py): optimize code by reusing cc_instance instead of calling get_component_instance multiple times

* refactor(utils.py, base.py): change parameter name 'add_name' to 'keep_name' for clarity and consistency in codebase

* [autofix.ci] apply automated fixes

* refactor: update _extract_return_type method in CustomComponent to accept Any type

The _extract_return_type method in CustomComponent has been updated to accept the Any type as the return_type parameter. This change improves the flexibility and compatibility of the method, allowing it to handle a wider range of return types.

* refactor: update BaseComponent to use get_template_config method

Refactored the `BaseComponent` class in `base_component.py` to use the `get_template_config` method instead of duplicating the code. This change improves code readability and reduces redundancy.

* refactor: update build_custom_component_template to use add_name instead of keep_name

Refactor the `build_custom_component_template` function in `utils.py` to use the `add_name` parameter instead of the deprecated `keep_name` parameter. This change ensures consistency with the updated method signature and improves code clarity.

* feat(component.py): add method to set output types based on method return type to improve type checking and validation in custom components (#3115)

* feat(component.py): add method to set output types based on method return type to improve type checking and validation in custom components

* refactor: extract method to get method return type in CustomComponent

* refactor: update _extract_return_type method in CustomComponent to accept Any type

The _extract_return_type method in CustomComponent has been updated to accept the Any type as the return_type parameter. This change improves the flexibility and compatibility of the method, allowing it to handle a wider range of return types.

* refactor: add _template_config property to BaseComponent

Add a new `_template_config` property to the `BaseComponent` class in `base_component.py`. This property is used to store the template configuration for the custom component. If the `_template_config` property is empty, it is populated by calling the `build_template_config` method. This change improves the efficiency of accessing the template configuration and ensures that it is only built when needed.

* refactor: add type checking for Output types in add_types method

Improve type checking in the `add_types` method of the `Output` class in `base.py`. Check if the `type_` already exists in the `types` list before adding it. This change ensures that duplicate types are not added to the list.

* update starter projects

* refactor: optimize imports in base.py

Optimize imports in the `base.py` file by removing unused imports and organizing the remaining imports. This change improves code readability and reduces unnecessary clutter.

* fix(base.py): fix condition to check if self.types is not None before checking if type_ is in self.types

* refactor: update build_custom_component_template to use add_name instead of keep_name

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-07-31 16:44:02 -07:00
Gabriel Luiz Freitas Almeida
62191d92ae
refactor: update CustomComponent constructor (#3114)
* refactor: update code references to use _code instead of code

* refactor: add backwards compatible attributes to Component class

* refactor: update Component constructor to pass config params with underscore

Refactored the `Component` class in `component.py` to handle inputs and outputs. Added a new method `map_outputs` to map a list of outputs to the component. Also updated the `__init__` method to properly initialize the inputs, outputs, and other attributes. This change improves the flexibility and extensibility of the `Component` class.

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

* refactor: change attribute to use underscore

* refactor: update CustomComponent initialization parameters

Refactored the `instantiate_class` function in `loading.py` to update the initialization parameters for the `CustomComponent` class. Changed the parameter names from `user_id`, `parameters`, `vertex`, and `tracing_service` to `_user_id`, `_parameters`, `_vertex`, and `_tracing_service` respectively. This change ensures consistency and improves code readability.

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

* refactor: update BaseComponent to accept UUID for _user_id

Updated the `BaseComponent` class in `base_component.py` to accept a `UUID` type for the `_user_id` attribute. This change improves the type safety and ensures consistency with the usage of `_user_id` throughout the codebase.

* refactor: import nanoid with type annotation

The `nanoid` import in `component.py` has been updated to include a type annotation `# type: ignore`. This change ensures that the type checker ignores any errors related to the `nanoid` import.

* fix(custom_component.py): convert _user_id to string before passing to functions to ensure compatibility with function signatures

* refactor(utils.py): refactor code to use _user_id instead of user_id for consistency and clarity

perf(utils.py): optimize code by reusing cc_instance instead of calling get_component_instance multiple times

* [autofix.ci] apply automated fixes

* refactor: update BaseComponent to use get_template_config method

Refactored the `BaseComponent` class in `base_component.py` to use the `get_template_config` method instead of duplicating the code. This change improves code readability and reduces redundancy.

* refactor: update build_custom_component_template to use add_name instead of keep_name

Refactor the `build_custom_component_template` function in `utils.py` to use the `add_name` parameter instead of the deprecated `keep_name` parameter. This change ensures consistency with the updated method signature and improves code clarity.

* feat(component.py): add method to set output types based on method return type to improve type checking and validation in custom components (#3115)

* feat(component.py): add method to set output types based on method return type to improve type checking and validation in custom components

* refactor: extract method to get method return type in CustomComponent

* refactor: update _extract_return_type method in CustomComponent to accept Any type

The _extract_return_type method in CustomComponent has been updated to accept the Any type as the return_type parameter. This change improves the flexibility and compatibility of the method, allowing it to handle a wider range of return types.

* refactor: add _template_config property to BaseComponent

Add a new `_template_config` property to the `BaseComponent` class in `base_component.py`. This property is used to store the template configuration for the custom component. If the `_template_config` property is empty, it is populated by calling the `build_template_config` method. This change improves the efficiency of accessing the template configuration and ensures that it is only built when needed.

* refactor: add type checking for Output types in add_types method

Improve type checking in the `add_types` method of the `Output` class in `base.py`. Check if the `type_` already exists in the `types` list before adding it. This change ensures that duplicate types are not added to the list.

* update starter projects

* refactor: optimize imports in base.py

Optimize imports in the `base.py` file by removing unused imports and organizing the remaining imports. This change improves code readability and reduces unnecessary clutter.

* fix(base.py): fix condition to check if self.types is not None before checking if type_ is in self.types

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-07-31 15:28:42 -07:00
Gabriel Luiz Freitas Almeida
1c3ee13a85
refactor: improve file handling in loading starter projects (#3123)
Refactor the `load_starter_projects` function in `setup.py` to improve error handling when loading starter projects. Instead of using a try-except block around the `orjson.loads` function, the function now uses a `with` statement to open the file and handle any JSON decoding errors. This ensures that any errors are properly caught and a `ValueError` is raised with the appropriate error message. Additionally, the function now logs a message when a starter project is successfully loaded.
2024-07-31 22:11:46 +00:00
Cristhian Zanforlin Lousa
3835f8d8b6
refactor: change login/auto_login to use UseQuery (#3033)
*  (App.tsx): Introduce framer-motion library for animations in the frontend
🔧 (App.tsx): Update import path for useAutoLogin function in controllers/API/queries/auth
🔧 (index.ts): Remove autoLogin function from API controllers as it is now handled by useAutoLogin hook
🔧 (use-get-autologin.ts): Update function name to useAutoLogin and adjust return type
🔧 (use-post-login-user.ts): Update function name to loginUserFn for clarity
🔧 (LoginPage/index.tsx): Update import path for useLoginUser function in controllers/API/queries/auth
🔧 (LoginPage/index.tsx): Update function name to loginUserFn for clarity
🔧 (authStore.ts): Remove unused imports and functions related to autoLogin and login operations

* 📝 (LoginPage/index.tsx): remove unnecessary console.log statement from onSuccess callback in mutate function

* ♻️ (App.tsx): remove unused import statement for 'm' from 'framer-motion' to clean up code and improve readability

* removing abort from request

* [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-31 20:23:51 +00:00
Cristhian Zanforlin Lousa
d7aed90e5d
bugfix: check if user exists before create a new refresh token (#3076)
check if user exists before create a new refresh token
2024-07-31 19:50:10 +00:00
Cristhian Zanforlin Lousa
61c921e1ae
refactor: add useQuery management on globalVariables CRUD (#3121)
*  (App.tsx): Add useGetGlobalVariables hook to fetch global variables data
🔧 (addNewVariableButton.tsx): Replace registerGlobalVariable function with usePostGlobalVariables hook for adding new global variables
🔧 (inputGlobalComponent/index.tsx): Replace deleteGlobalVariable function with useDeleteGlobalVariables hook for deleting global variables
🔧 (authContext.tsx): Remove unused getGlobalVariables function and setGlobalVariables state from authContext
🔧 (constants.ts): Add VARIABLES constant for global variables endpoint
🔧 (index.ts): Remove getGlobalVariables, registerGlobalVariable, and deleteGlobalVariable functions from API index
 (variables/index.ts): Add use-delete-global-variables hook for deleting global variables
🔧 (use-delete-global-variables.ts): Implement useDeleteGlobalVariables hook for deleting global variables

 (use-get-global-variables.ts): Add functionality to fetch and set global variables from API
 (use-patch-global-variables.ts): Add functionality to update global variables via API patch request
 (use-post-global-variables.ts): Add functionality to create new global variables via API post request
📝 (index.tsx): Import useGetGlobalVariables hook to fetch global variables on login page
📝 (index.tsx): Call mutateGetGlobalVariables function to fetch global variables on successful login
📝 (index.tsx): Import useDeleteGlobalVariables hook to delete global variables on global variables page
📝 (index.tsx): Call mutateDeleteGlobalVariable function to delete selected global variables
📝 (index.tsx): Handle success and error cases for deleting global variables

* Removed console.log

---------

Co-authored-by: Lucas Oliveira <62335616+lucaseduoli@users.noreply.github.com>
2024-07-31 19:49:54 +00:00
Gabriel Luiz Freitas Almeida
e0afe90410
refactor: update code references to use _code instead of code (#3113) 2024-07-31 18:23:34 +00:00
Gabriel Luiz Freitas Almeida
f08467d84b
fix: handle PydanticSerializationError that generates generic errors in the UI (#3108)
* fix(main.py): handle PydanticSerializationError in JavaScriptMIMETypeMiddleware to provide detailed error message in case of serialization error

* fix(main.py): handle PydanticSerializationError in JavaScriptMIMETypeMiddleware to provide detailed error message in case of serialization error

* improve error handling

* feat: Handle PydanticSerializationError in JavaScriptMIMETypeMiddleware

Refactor the `JavaScriptMIMETypeMiddleware` class in `main.py` to handle the `PydanticSerializationError` exception. This change ensures that a detailed error message is provided in case of a serialization error. The error message is now serialized as a JSON string and included in the `detail` field of the `HTTPException` raised.

* feat: Add tryParseJson function to utils.ts

This commit adds a new function called `tryParseJson` to the `utils.ts` file. The function attempts to parse a JSON string and returns the parsed object. If parsing fails, it returns undefined. This function can be used to safely parse JSON strings without throwing an error.

* fix: Handle error message in buildVertex function

This commit modifies the buildVertex function in buildUtils.ts to handle error messages more effectively. It adds logic to extract the error message from the AxiosError response and parse it as JSON if possible. If the error message is not an array, it converts it into an array. This change ensures that the error message is properly displayed when building a component fails.

* remove console.log

* remove not related code

---------

Co-authored-by: anovazzi1 <otavio2204@gmail.com>
2024-07-31 18:23:19 +00:00
anovazzi1
ca68414e6b
feat: update GenericNode to include lf_version in node data (#3112)
* feat: update GenericNode to include lf_version in node data

* [autofix.ci] apply automated fixes

---------

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>
2024-07-31 14:38:27 -03:00
Lucas Oliveira
5076f2014e
fix: flow experimental components (#3093)
* refactor(utils.py): simplify data processing logic in build_data_from_result_data function for better readability and maintainability

* feat: set default output type to "chat" in run_flow function

* refactor(FlowTool.py): refactor FlowToolComponent class to inherit from LCToolComponent

* Fixed Flow as Tool component

* Fixed refresh button not appearing at the end

* Added way of connecting SecretStrInput to messages

* Added real_time_refresh when field has button update too

* Refactored SubFlow component

* Fixed FlowTool to only output tool and removed async function def

* fix: two statements in the same line

* [autofix.ci] apply automated fixes

* Fixed lint issues

* fixed dataobj with wrong name

* changed tweaks dict type

* Fixed margin appearing in output too

* Fixed useless button that made styling worse on handlerendercomponent

---------

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-07-31 16:03:42 +00:00
anovazzi1
7276f699fc
feat: remove unnecessary condition in App component (#3107)
The unnecessary condition in the App component was causing the error modal to not appear when there was an error in the health data. This commit removes the unnecessary condition to ensure that the error modal is displayed correctly.
2024-07-31 14:24:57 +00:00
Lucas Oliveira
97c897b753
fix: description of url component (#3105)
Fixed description of URL component
2024-07-31 14:14:02 +00:00
Nicolò Boschi
aa46f320ab
fix: starter projects refresh don't add new fields (#3110)
export stremaing module
2024-07-31 13:43:00 +00:00
Lucas Oliveira
1a5156784c
fix: deploy buttons images not appearing (#3092)
Added railway, render and GCP deploy images and link
2024-07-31 04:26:22 -07:00
Nicolò Boschi
4b650152f7
fix: ensure starter projects refreshed at startup (#3078)
* fix: ensure starter projects refreshed at startup

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-07-31 09:20:05 +02:00
Cristhian Zanforlin Lousa
02ed87e8e0
refactor: change user's endpoints requests to use useQuery (#3088) 2024-07-30 22:56:56 -03:00
Lucas Oliveira
6a1f1857e4
fix: text input jumps to the end of the text after writing one letter (#3090)
Fixed not being able to write in the middle of the component
2024-07-30 21:34:09 +00:00
Lucas Oliveira
1336ae0772
fix: dropdown and multiselect component values on disabled and option text not truncating (#3089)
* Fixed dropdown component showing empty value and not showing dropdown when combobox is true

* Fixed multiselect component showing empty value and not showing dropdown when combobox is true

* Added disabled onChange on multiline and dropdown, with snapshot ignore

* Fixed tooltip skip delay duration that made tooltip on Dropdown unusable

* Fixed size of text inside dropdown and multiselect

---------

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-07-30 21:30:50 +00:00
Mike Fortman
72ff6d3a58
feat: create Frontend feature flags (#3029)
* Add UI feature flag config

* [autofix.ci] apply automated fixes

* hide general settings if there is nothing to show

* make sure to handle !autoLogin case

* [autofix.ci] apply automated fixes

* missed commit

* [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-30 14:19:05 -07:00
Himanshu Dixit
818a17d0db
feat: add composio toolset (#3034)
* feat: add composio toolset

* feat: v1

* feat: format code

* feat: add support for multi tools

* feat: make methods private

* [autofix.ci] apply automated fixes

* feat: use logger

* refactor(ComposioAPI.py): reorganize import statement

* refactor: update typing import in langchain_utilities/model.py

* refactor: update typing import in ComposioAPI.py

---------

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-07-30 14:14:32 -07:00
anovazzi1
f352c53e70
enhancement: Update useFileDrop hook to handle multiple file drops (#3083)
* refactor: Update useFileDrop hook to handle multiple file drops

The useFileDrop hook in use-on-file-drop.tsx has been updated to handle multiple file drops. It now accepts an array of files instead of a single file, and processes each file individually. This allows for uploading multiple files at once and improves the user experience.

* [autofix.ci] apply automated fixes

* Remove unused console.log

* Removed console.log

---------

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>
2024-07-30 20:55:23 +00:00
Gabriel Luiz Freitas Almeida
8bc45b9ee2
refactor(FlowTool.py): update FlowToolComponent class to inherit from LCToolComponent (#3048)
* refactor(utils.py): simplify data processing logic in build_data_from_result_data function for better readability and maintainability

* feat: set default output type to "chat" in run_flow function

* refactor(FlowTool.py): refactor FlowToolComponent class to inherit from LCToolComponent

* Fixed Flow as Tool component

* Fixed FlowTool to only output tool and removed async function def

* [autofix.ci] apply automated fixes

* Fixed lint

---------

Co-authored-by: Lucas Oliveira <62335616+lucaseduoli@users.noreply.github.com>
Co-authored-by: Lucas Oliveira <lucas.edu.oli@hotmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-07-30 20:47:35 +00:00
Gabriel Luiz Freitas Almeida
709b90fe0e
chore: update langflow-base dependency path in pyproject.toml (#3091) 2024-07-30 13:09:21 -07:00
Paulo Salvatore
314e787459
docs(readme): add instructions for running from a cloned repo (#3072) 2024-07-30 21:37:29 +02:00
Gabriel Luiz Freitas Almeida
a861b86354 feat(Makefile): add build steps for frontend and langflow components when 'main' target is specified 2024-07-30 16:25:39 -03:00
anovazzi1
3d2d79c908
feat: Add Athena icon component (#3085)
* feat: Add Athena icon component

Add a new component called AthenaComponent that renders an SVG icon for Athena. This component is imported from the newly created file "athena.jsx" in the "icons/athena" directory. Additionally, an export for the AthenaIcon component is added in the "icons/athena/index.tsx" file.
2024-07-30 15:57:46 -03:00
Gabriel Luiz Freitas Almeida
15d566618b
fix: update curl command in release workflow to use correct endpoint (#3086) 2024-07-30 18:28:22 +00:00
Gabriel Luiz Freitas Almeida
17d387470a
ci: update cli command (#3084)
* chore: update pip installation command in release workflow

* fix: update pip installation command in release workflow
2024-07-30 18:00:30 +00:00
github-actions[bot]
8f3a82e0df
docs: update docs from notion (#3074)
* Update docs from Notion

* feat: Add RAG (Retrieval-Augmented Generation) components documentation

This commit adds documentation for RAG (Retrieval-Augmented Generation) components. It explains how these components process a user query by retrieving relevant documents and generating a concise summary that addresses the user's question. The documentation includes information about the Vectara component, its parameters, and the Vectara corpus. For more details, refer to the [Vectara documentation](https://docs.vectara.com/docs).

---------

Co-authored-by: ogabrielluiz <ogabrielluiz@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-07-30 17:52:03 +00:00
Gabriel Luiz Freitas Almeida
410cd46c39
ci: update workflow to skip publishing if package already exists (#3082)
fix: Update Makefile to skip publishing if package already exists
2024-07-30 17:25:02 +00:00
anovazzi1
69c089a011
fix: update node alert to detect outdated components (#3051)
* check nodes to update on build flow

* feat: update componentsToUpdate logic in flowStore.ts

The `updateComponentsToUpdate` function in `flowStore.ts` has been updated to properly check for outdated nodes. This ensures that components are only updated when necessary, improving performance and preventing unnecessary re-renders.

* [autofix.ci] apply automated fixes

* Update src/frontend/src/stores/flowStore.ts

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

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-07-30 16:39:20 +00:00
Gabriel Luiz Freitas Almeida
554294c2cd
chore: update Makefile to skip publishing if package already exists (#3077) 2024-07-30 16:18:34 +00:00
Rogério Chaves
06d185a976
chore: remove langwatch docs mdx, as .md files are now generated automatically from notion (#3073)
Remove langwatch docs mdx, as .md files are now generated automatically from notion
2024-07-30 14:34:10 +00:00
Nicolò Boschi
91da7f7b45
fix: endpoint /run api call could run same node twice (#3062)
fix: /run api call could run same node twice
2024-07-30 14:19:37 +00:00
Gabriel Luiz Freitas Almeida
4382e42d77
fix: update message reload and update langchain-core (#3054)
* refactor: update langchain-core to version 0.2.24

* refactor: convert inner messages to BaseMessage in load_lc_prompt method

* refactor: update ChatPromptTemplate instantiation in message.py

* refactor: update langflow-base dependency to use local path for development

* [autofix.ci] apply automated fixes

* refactor: update ChatPromptTemplate instantiation in message.py

* refactor: add async_from_template_and_variables and sync from_template_and_variables

* feat(tests): add unit test for Message schema serialization and prompt loading

* refactor: update langchain-core dependency to version 0.2.24

* chore: new lock

* mypy

* chore: format pyproject

* refactor: rename async_from_template_and_variables to from_template_and_variables in Message class

* refactor: Rename async_from_template_and_variables to from_template_and_variables in Message class

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Nicolò Boschi <boschi1997@gmail.com>
2024-07-30 13:54:51 +00:00
Daniel Gines
3e6d3dc326
chore: update makefile structure and functionality (#3000)
* 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.

* Improvements: Structure and Functionality Improvements

- Reorganized commands to facilitate understanding of the structure
- Enhanced check_tools to detect the Python version
- Added a multi-environment script to support check_tools
- make init now builds the frontend and runs the application
- Aesthetic improvements in output messages

TO-DO:
- Reorganize container-related commands
- Reorganize other miscellaneous utilities
- Document usage in the application docs
- Prepare the dev environment following the maintainers' recommended practices

* Removed pre-commit as it is no longer used.

* Restored 'patch' command in Makefile, it updates the 'pyproject.toml' with the new project version.

---------

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-07-30 06:43:13 -07:00
Cristhian Zanforlin Lousa
c2b5b98b64
bugfix: add steps to delete flows caused by new constraints (#3045)
* 📝 (flows.py): refactor delete_multiple_flows function to improve readability and efficiency
 (use-delete-flows.ts): add useDeleteFlows hook to handle deletion of multiple flows in frontend
♻️ (index.tsx): refactor handleDeleteMultiple function to use useDeleteFlows hook for deleting multiple flows
🔧 (actionsMainPage-shard-1.spec.ts): add test for selecting and deleting a flow in end-to-end tests

* 📝 (flows.py): Remove unused imports and variables to clean up the code and improve readability
♻️ (flows.py): Refactor code to remove unnecessary import and variable declarations, making the code more concise and maintainable

* add unit tests to delete multiple flows with transactions and build

* format

* add assert on tests
2024-07-30 13:41:54 +00:00
Nicolò Boschi
fc73e2c448
fix: update render.yaml to being compatible with langflow 1.0 (#3071) 2024-07-30 15:22:03 +02:00
anovazzi1
c39540c7d8
fix: Update Textarea component to have full height (#3069)
feat: Update Textarea component to have full height

The Textarea component was updated to have a full height by adding the "h-full" class to the parent div. This ensures that the textarea takes up the entire available vertical space.
2024-07-30 12:50:02 +00:00
Nicolò Boschi
747a1848d4
fix: file open leaks (#3067) 2024-07-30 14:45:42 +02:00
Nicolò Boschi
569869e211
ci: improve test jobs titles (#3065) 2024-07-30 05:19:14 -07:00
Nicolò Boschi
4136961155
fix: strict langchain integrations dep (#3063)
* fix: strict langchain vertexai dep

* fix: strict langchain vertexai dep

* fix: strict langchain vertexai dep

* [autofix.ci] apply automated fixes

* chore: update langchain-google-genai dependency to version 1.0.8

* more locks

* ci: improve test jobs titles

* openai 0.1.18

* openai 0.1.17

---------

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-30 12:11:58 +00:00
Gabriel Luiz Freitas Almeida
9213b4c070
chore: update package version to 0.0.92 (#3056) 2024-07-30 07:36:37 +00:00
Daniel Gines
d108ca11c5
feat: Add GitLoader Component with advanced filtering options (#2850)
* feat: Add GitLoader Component with advanced filtering options

This commit introduces the GitLoaderComponent, enabling users to load files from a Git repository with advanced filtering options.

GitLoader Component:

- Implementation of the GitLoaderComponent to load files from a Git repository using the `langchain_community.document_loaders.git.GitLoader` module.
- Advanced filtering option using `file_filter` to include or exclude specific files based on their extensions or other criteria.

Examples of `file_filter` usage:
- Include only .py files: `lambda file_path: file_path.endswith('.py')`
- Exclude .py files: `lambda file_path: not file_path.endswith('.py')`

This component ensures a flexible and customizable approach for loading documents from Git repositories, enhancing the user experience with advanced filtering capabilities.

Features:

- Support for loading documents from Git repositories.
- Advanced file filtering options to include or exclude specific files.

* feat: Add GitLoader Component with advanced filtering options

This commit introduces the GitLoaderComponent, enabling users to load files from a Git repository with advanced filtering options.

GitLoader Component:

- Implementation of the GitLoaderComponent to load files from a Git repository using the `langchain_community.document_loaders.git.GitLoader` module.
- Advanced filtering option using `file_filter` to include or exclude specific files based on their extensions or other criteria.

Examples of `file_filter` usage:
- Include only .py files: `lambda file_path: file_path.endswith('.py')`
- Exclude .py files: `lambda file_path: not file_path.endswith('.py')`

This component ensures a flexible and customizable approach for loading documents from Git repositories, enhancing the user experience with advanced filtering capabilities.

Features:

- Support for loading documents from Git repositories.
- Advanced file filtering options to include or exclude specific files.

* fix: Ensure proper evaluation and validation of file_filter in GitLoaderComponent

This commit fixes the issue where the GitLoaderComponent would fail if the file_filter input was not evaluated correctly. Changes include:

- Added a check to ensure that file_filter is a valid string before calling eval.
- Ensured that the evaluated file_filter is callable, otherwise it defaults to None.

* [autofix.ci] apply automated fixes

* feat: Enhance GitLoaderComponent with dynamic inputs, content filtering

- Changed inputs from `StrInput` to `MessageTextInput` to enable dynamic use with agents.
- Added `content_filter` field to allow additional content filtering using regex.
- Updated `file_filter` to support glob format, simplifying usage for users.
- Implemented binary file removal filter to exclude binary files from queries, aligning with the agent's purpose.

* [autofix.ci] apply automated fixes

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

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-07-30 02:00:53 +00:00
Gabriel Luiz Freitas Almeida
12e3b51980
ci: update Python version in release workflow and skip release if already released (#3053)
* ci: update Python in release workflow

* ci: skipp release of langflow-base when version is already released
2024-07-30 00:01:29 +00:00
Gabriel Luiz Freitas Almeida
340bfe22c4
refactor: lock poetry dependencies without updating (#3050)
Lock poetry dependencies without updating in the Makefile build_langflow target
2024-07-29 23:36:20 +00:00
Nicolò Boschi
53063957e4
fix: tool calling and openai tools do not include chat history (#3030)
* fix: tool calling and openai tools do not include chat history

* fix import

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-07-29 23:09:46 +00:00
Gabriel Luiz Freitas Almeida
32824276c8
chore: update package version to 0.0.91 (#3049) 2024-07-29 16:05:51 -07:00
Cristhian Zanforlin Lousa
a811834b93
refactor: change endpoint monitor/builds to use useQuery (#2622)
*  (constants.ts): add BUILDS endpoint to URLs constants
 (index.ts): create index file for builds-related queries
 (use-delete-builds.ts): implement useDeleteFLowPool hook for deleting builds

*  (chatView): integrate useDeleteFlowPool hook for deleting flow pool
♻️ (chatView): refactor clearChat function to use mutateFlowPool for deletion

* ♻️ (use-delete-builds.ts): rename useDeleteFLowPool to useDeleteBuilds for clarity
♻️ (index.tsx): update import and usage of useDeleteFLowPool to useDeleteBuilds

*  (API): add use-get-builds query to fetch build data
 (PageComponent): integrate use-get-builds query for fetching builds
 (flowStore): add setters for inputs, outputs, and hasIO in flowStore

* ♻️ (flowStore.ts): refactor hasIO to derive its value from inputs and outputs
🔥 (flowStore.ts): remove unused resetFlow function to clean up the codebase

* ♻️ (use-get-builds.ts): refactor useGetBuildsQuery to remove unused params
 (PageComponent): add logic to handle flow state, inputs, outputs, and viewport
♻️ (flowStore): refactor and add resetFlow method to handle flow state reset

*  (chatComponent): add data-testid attributes for better testability
 (generalBugs-shard-3.spec.ts): add end-to-end test for playground button state

---------

Co-authored-by: anovazzi1 <otavio2204@gmail.com>
2024-07-29 22:56:54 +00:00