Commit graph

642 commits

Author SHA1 Message Date
Ítalo Johnny
f18c4e9079
chore: bump langflow versions (#3765) 2024-09-11 19:20:13 -03:00
Christophe Bornet
7273a6e78a
feat: Add CassandraGraphVectorStoreComponent and HtmlLinkExtractorComponent (#3757)
* Add CassandraGraphVectorStoreComponent and HtmlLinkExtractorComponent

* Move uuid import to global imports

* fix test with new text spliter

* update poetry lock

* ci: add continue-on-error to py_autofix.yml

---------

Co-authored-by: Ítalo Johnny <italojohnnydosanjos@gmail.com>
Co-authored-by: anovazzi1 <otavio2204@gmail.com>
2024-09-11 14:56:25 -03:00
Ítalo Johnny
bf640be53f
fix: disables langfuse_plugin code (#3745) 2024-09-10 19:01:21 +00:00
Christopher Bradford
ce11df2a94
feat: add support for DataStax HCD vector store (#3728) 2024-09-09 12:03:25 -03:00
Jordan Frazier
7b3e51f769
ci: create a nightly build workflow (#3553)
* test poetry install

* Add nightly builds workflow

* remove old comments and fix poetry

* remove old debug statement

* [autofix.ci] apply automated fixes

---------

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

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

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

* Add missing import for CustomComponent in test_custom_component.py
2024-09-04 21:16:36 +00:00
Eric Hare
de1fdff742
feat: Switch to API for Unstructured Component (#3671)
* FEAT: Switch to API for Unstructured Component

* chore: new lock

---------

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

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

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

* [autofix.ci] apply automated fixes

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

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

* feat: add component clickhouse for vector database

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

* [autofix.ci] apply automated fixes

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

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

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

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

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-09-04 05:33:30 -07:00
Nicolò Boschi
1c7ef6ee60
feat: add Parse JSON component (#3167)
* feat: add Parse JSON component

* feat: Update ParseJSONDataComponent to handle JSON decoding errors

* fix tests

* [autofix.ci] apply automated fixes

* add string check in _parse_data

---------

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-09-03 16:36:30 +00:00
Cristhian Zanforlin Lousa
706d559003
fix: update Self Query Retriever Component (#3653)
* 🔧 (pyproject.toml): add lark dependency to support parsing and processing of grammars in the project
♻️ (SelfQueryRetriever.py): refactor input types in metadata fields to improve clarity and maintainability

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

* [autofix.ci] apply automated fixes

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

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-09-02 20:19:37 +00:00
Nicolò Boschi
96872f3aa5
chore: refactor and add components integration tests (#3607)
* improve inegration tests

* add fixes

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-09-02 15:21:47 +02:00
Gabriel Luiz Freitas Almeida
e790925b75
feat(pyproject.toml): update langchain-google-vertexai, langchain-groq, langchain-pinecone, and langchain-mistralai versions to the latest available (#3604)
* feat(pyproject.toml): update langchain-google-vertexai, langchain-groq, langchain-pinecone, and langchain-mistralai versions to the latest available

update markdown and upstash-vector versions

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-08-31 14:40:29 -07:00
Gabriel Luiz Freitas Almeida
15bb39ac9c
chore: Remove PDF extra from unstructured dependency because of pytorch (#3633)
Remove PDF extra from unstructured dependency in pyproject.toml
2024-08-30 13:26:04 -07:00
Eric Hare
1ed5ce8e26
fix: Dependency update for unstructured component (#3552)
* FIX: Dependency update for unstructured component

* [autofix.ci] apply automated fixes

* Add nltk download script

* chore(pyproject.toml): move nltk_setup script definition to [tool.poetry.scripts] section for better organization and readability

* [autofix.ci] apply automated fixes

* Make nltk resource downloading part of run

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes

* Use logger for nltk messages

* Move the download resources function

* [autofix.ci] apply automated fixes

* Move nltk resource download

* [autofix.ci] apply automated fixes

* Update main.py

* Update poetry lock

* Update main.py

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-08-30 06:48:36 -07:00
Jordan Frazier
1a0bc3b968
fix: update astra assistants version (#3602)
fixes issue with tree-sitter-python on m1 macs
2024-08-28 12:30:23 -07:00
Himanshu Dixit
9e7c2d0100
feat: bump composio version (#3586)
feat: bump composio
2024-08-28 05:00:31 -07:00
anovazzi1
03e95d4522
feat: add notion integration components (#3579) 2024-08-27 22:01:43 -03:00
Gabriel Luiz Freitas Almeida
c92bea64c4
chore: bump langflow versions (#3570) 2024-08-27 05:57:32 -07:00
Ítalo Johnny
f19aceb520
fix: no module named 'psycopg2' (#3526)
* fix: add dependecy to Dockerfile

* fix: revert quick fix

* fix: update poetry.lock
2024-08-23 19:00:50 +00:00
Himanshu Dixit
b623854ac1
feat: bump composio version in pyproject (#3510)
* feat: bump composio version

* [autofix.ci] apply automated fixes

* chore(poetry.lock): update Poetry version from 1.8.2 to 1.8.3
chore(poetry.lock): remove milvus_lite-2.4.9-py3-none-manylinux2014_aarch64.whl package from lock file

* [autofix.ci] apply automated fixes

* fix(poetry.lock): update Poetry version from 1.8.2 to 1.8.3 to reflect the actual version used

---------

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-08-23 11:59:14 +00:00
Gabriel Luiz Freitas Almeida
9d5f97acf2
chore: remove locust dependency (#3513)
Remove it so we don't have flask-cors as a dependency because of a vulnerability
2024-08-22 20:44:05 +00:00
Gabriel Luiz Freitas Almeida
091baf7f33
build: Update litellm version to 1.44.1 and content hash in poetry.lock (#3507) 2024-08-22 19:05:53 +00:00
Gabriel Luiz Freitas Almeida
300e79f70c
build: Update langflow-base and langflow versions to 0.0.94 and 1.0.16 respectively. (#3455) 2024-08-21 18:07:32 -07:00
Gabriel Luiz Freitas Almeida
1e7565ee9f
chore: lock boto3 version and update langchain versions (#3448)
* build: Update boto3 version to 1.34.162.

* ci(langchain-aws): Bump version to ^0.1.16.

* build: Update langchain-anthropic and langchain-openai versions.

* chore: set new lock file
2024-08-20 06:20:28 -07:00
Gabriel Luiz Freitas Almeida
9035f1194f
ci: Update pytest configuration and add pytest-flakefinder. (#3330) 2024-08-14 14:29:03 +00:00
Jordan Frazier
120786fe38
dep: lock psycopg to 3.1.19 (#3292) 2024-08-13 12:29:36 -07:00
William Espegren
7a36cc9ebf
feat: add Spider Web Scraper & Crawler (#2439)
* spider files

* rebuild required

* add spider-client here

* Feat: Spider Web Crawler & Scraper

* Feat: spider integration

* new input not working

* [autofix.ci] apply automated fixes

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

* fix: add outputs and configure build method

* style: run ruff

* Refactor SpiderTool to use 'crawl' instead of 'build' for generating Markdown content

* chore: add type ignore

* chore: new lock

* chore: Update mem0ai dependency to version 0.0.5

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-08-08 05:53:05 -07:00
Gabriel Luiz Freitas Almeida
a2c98b90c1
chore: bump version to 1.0.15 and update langflow-base version to 0.0.93 (#3233)
* bump: update langflow-base version to 0.0.93 in pyproject.toml

* chore: bump version to 1.0.15 in pyproject.toml
2024-08-07 14:39:29 -07:00
Gabriel Luiz Freitas Almeida
be87c9e43e
refactor(graph): add prepare method in Graph (#3124)
* 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 BaseInputMixin to handle invalid field types gracefully

The `BaseInputMixin` class in `input_mixin.py` has been updated to handle invalid field types gracefully. Instead of raising an exception, it now returns `FieldTypes.OTHER` for any invalid field type. This change improves the robustness and reliability of the codebase.

* refactor: update file_types field alias in FileMixin

The `file_types` field in the `FileMixin` class of `input_mixin.py` has been updated to use the `alias` parameter instead of `serialization_alias`. This change ensures consistency and improves the clarity of the codebase.

* refactor(inputs): update field_type declarations in various input classes to use SerializableFieldTypes enum for better type safety and clarity

* refactor(inputs): convert dict to Message object in _validate_value method

* refactor(inputs): convert dict to Message object in _validate_value method

* refactor(inputs): update model_config in BaseInputMixin to enable populating by name

The `model_config` attribute in the `BaseInputMixin` class of `input_mixin.py` has been updated to include the `populate_by_name=True` parameter. This change allows the model configuration to be populated by name, improving the flexibility and usability 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(component): add get_input and get_output methods for easier access to input and output values

The `Component` class in `component.py` has been updated to include the `get_input` and `get_output` methods. These methods allow for easier retrieval of input and output values by name, improving the usability and readability of the codebase.

* refactor(vertex): add get_input and get_output methods for easier access to input and output values

* refactor(component): add set_output_value method for easier modification of output values

The `Component` class in `component.py` has been updated to include the `set_output_value` method. This method allows for easier modification of output values by name, improving the usability and flexibility of the codebase.

* feat: add run_until_complete and run_in_thread functions for handling asyncio tasks

The `async_helpers.py` file in the `src/backend/base/langflow/utils` directory has been added. This file includes the `run_until_complete` and `run_in_thread` functions, which provide a way to handle asyncio tasks in different scenarios. The `run_until_complete` function checks if an event loop is already running and either runs the coroutine in a separate event loop in a new thread or creates a new event loop and runs the coroutine. The `run_in_thread` function runs the coroutine in a separate thread and returns the result or raises an exception if one occurs. These functions improve the flexibility and usability of the codebase.

* refactor(component): add _edges attribute to Component class for managing edges

The `Component` class in `component.py` has been updated to include the `_edges` attribute. This attribute is a list of `EdgeData` objects and is used for managing edges in the component. This change improves the functionality and organization of the codebase.

* fix(component.py): fix conditional statement to check if self._vertex is not None before accessing its attributes

* refactor(component): add _get_fallback_input method for handling fallback input

The `Component` class in `component.py` has been updated to include the `_get_fallback_input` method. This method returns an `Input` object with the provided keyword arguments, which is used as a fallback input when needed. This change improves the flexibility and readability of the codebase.

* refactor(component): add TYPE_CHECKING import for Vertex in component.py

* refactor(component): add _map_parameters_on_frontend_node and _map_parameters_on_template and other methods

The `Component` class in `component.py` has been refactored to include the `_map_parameters_on_frontend_node` and `_map_parameters_on_template` methods. These methods are responsible for mapping the parameters of the component onto the frontend node and template, respectively. This change improves the organization and maintainability of the codebase.

* refactor(component): Add map_inputs and map_outputs methods for mapping inputs and outputs

The `Component` class in `component.py` has been updated to include the `map_inputs` and `map_outputs` methods. These methods allow for mapping the given inputs and outputs to the component, improving the functionality and organization of the codebase.

* refactor(component): Add Input, Output, and ComponentFrontendNode imports and run_until_complete function

This commit refactors the `component.py` file in the `src/backend/base/langflow/custom/custom_component` directory. It adds the `Input`, `Output`, and `ComponentFrontendNode` imports, as well as the `run_until_complete` function from the `async_helpers.py` file. These changes improve the functionality and organization of the codebase.

* refactor(component): Add map_inputs and map_outputs methods for mapping inputs and outputs

* refactor(component): Add _process_connection_or_parameter method for handling connections and parameters

The `Component` class in `component.py` has been updated to include the `_process_connection_or_parameter` method. This method is responsible for handling connections and parameters based on the provided key and value. It checks if the value is callable and connects it to the component, otherwise it sets the parameter or attribute. This change improves the functionality and organization of the codebase.

* refactor(frontend_node): Add set_field_value_in_template method for updating field values

The `FrontendNode` class in `base.py` has been updated to include the `set_field_value_in_template` method. This method allows for updating the value of a specific field in the template of the frontend node. It iterates through the fields and sets the value of the field with the provided name. This change improves the flexibility and functionality of the codebase.

* refactor(inputs): Add DefaultPromptField class for default prompt inputs

The `inputs.py` file in the `src/backend/base/langflow/inputs` directory has been refactored to include the `DefaultPromptField` class. This class represents a default prompt input with customizable properties such as name, display name, field type, advanced flag, multiline flag, input types, and value. This change improves the flexibility and functionality of the codebase.

* feat: Add Template.from_dict method for creating Template objects from dictionaries

This commit adds the `from_dict` class method to the `Template` class in `base.py`. This method allows for creating `Template` objects from dictionaries by converting the dictionary keys and values into the appropriate `Template` attributes. This change improves the flexibility and functionality of the codebase.

* refactor(frontend_node): Add from_dict method for creating FrontendNode objects from dictionaries

* 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(graph): Add EdgeData import and update add_nodes_and_edges method signature

The `Graph` class in `base.py` has been updated to include the `EdgeData` import and modify the signature of the `add_nodes_and_edges` method. The `add_nodes_and_edges` method now accepts a list of dictionaries representing `EdgeData` objects instead of a list of dictionaries with string keys and values. This change improves the type safety and clarity of the codebase.

* refactor(graph): Add first_layer property to Graph class

The `Graph` class in `base.py` has been updated to include the `first_layer` property. This property returns the first layer of the graph and throws a `ValueError` if the graph is not prepared. This change improves the functionality and organization of the codebase.

* refactor(graph): Update Graph class instantiation in base.py

The `Graph` class in `base.py` has been updated to use keyword arguments when instantiating the class. This change improves the readability and maintainability of the codebase.

* refactor(graph): Add prepare method to Graph class

The `Graph` class in `base.py` has been updated to include the `prepare` method. This method prepares the graph for execution by validating the stream, building edges, and sorting vertices. It also adds the first layer of vertices to the run manager and sets the run queue. This change improves the functionality and organization of the codebase.

* refactor(graph): Improve graph preparation in retrieve_vertices_order function

The `retrieve_vertices_order` function in `chat.py` has been updated to improve the graph preparation process. Instead of manually sorting vertices and adding them to the run manager, the function now calls the `prepare` method of the `Graph` class. This method validates the stream, builds edges, and sets the first layer of vertices. This change improves the functionality and organization of the codebase.

* 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

* refactor(graph): update ContractEdge to use EdgeData for raw_edge parameter, enhancing type consistency across edges

* refactor(graph): update add_edge method to use EdgeData type, improving type safety and consistency in graph edges

* chore(dependencies): bump mypy version from 1.10.0 to 1.11.0 for improved type checking capabilities

* refactor: update Edge class to use EdgeData type for raw_edge parameter

The Edge class in base.py has been updated to use the EdgeData type for the raw_edge parameter in the __init__ method. This change improves type safety and consistency in graph edges.

* refactor: update follow_imports to "skip" in mypy configuration

* fix: add type ignore comment for return data in SelfQueryRetriever.py to resolve mypy warning

* chore: update mypy configuration to include namespace_packages and ignore missing imports in pyproject.toml files

* fix: add type ignore comment for target_param in base.py to resolve mypy warning about split method usage

* fix: add type ignore comments for various classes to resolve mypy warnings in input_mixin, database models, and cache service files

* refactor: add first layer attribute to Graph class

The Graph class in base.py has been updated to include a new attribute called `_first_layer`. This attribute is a list of strings and is initialized as an empty list. This change enhances the functionality of the Graph class by providing a way to store and access the first layer of vertices in the graph.

* refactor: store first layer in Graph class with _first_layer attribute for improved access to vertices being run

* fix: add type ignore comments to database model classes to resolve mypy type checking warnings

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-08-02 19:51:47 +00:00
Rogério Chaves
a421a7dfcc
chore: bump langwatch to v0.1.16 (#3147) 2024-08-01 19:08:04 +00:00
Rogério Chaves
916fca4051
feat: improve LangWatch integration by introducing langchain callbacks on the tracing service, and component and workflow span types (#3094)
* Improve LangWatch integration by introducing langchain callbacks on the tracing service, and component and workflow span types. Bump LangWatch to v0.1.14

* [autofix.ci] apply automated fixes

* Fix type checks

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-08-01 06:28:40 -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
Gabriel Luiz Freitas Almeida
709b90fe0e
chore: update langflow-base dependency path in pyproject.toml (#3091) 2024-07-30 13:09:21 -07: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
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
9afc6a2d4d
chore(pyproject): update version 1.0.14 and 0.0.90 for langflow and langflow-base packages (#3025)
* feat(pyproject.toml): add langchain-core dependency version 0.2.23 to the project

* feat(pyproject.toml): update version 1.0.14 and 0.0.90 for langflow and langflow-base packages
2024-07-29 12:46:53 +00:00
Gabriel Luiz Freitas Almeida
9ce12c8598
chore: bump langflow and langflow-base versions to 1.0.13 and 0.0.89 respectively (#2956)
* feat(Makefile): add 'patch' target to bump the version in langflow and langflow-base

* chore: bump langflow and langflow-base versions to 1.0.13 and 0.0.89 respectively
2024-07-25 17:18:02 +00:00
Gabriel Luiz Freitas Almeida
a4d6f4ff5b
chore: bump langflow and langflow-base to 1.0.12 and 0.88 (#2874)
chore: update dependencies in poetry.lock and pyproject.toml

Update the versions of various dependencies in the poetry.lock and pyproject.toml files to their latest versions. This ensures compatibility and incorporates bug fixes and improvements provided by the updated dependencies.
2024-07-22 17:33:57 +00:00
Sebastián Estévez
0d5228d681
Astra Assistants Support (#2041)
* ruff

* revert config.yaml

* add build_config

* ruff

* add build_config
2024-07-22 10:26:30 -07:00
Gabriel Luiz Freitas Almeida
decc979e99
refactor: disable type-var error code (#2868)
* fix: disable error code "type-var" in mypy configuration

* refactor(VertexAiModel.py): restructure the return statement to improve readability and maintainability by using type casting for LanguageModel
2024-07-22 15:03:36 +00:00
Gabriel Luiz Freitas Almeida
8b37069fcd
chore: update package versions in pyproject.toml and poetry.lock (#2816) 2024-07-18 17:01:13 -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
d4f5d149a8
chore: Update langwatch to 0.1.10 (#2770)
feat: Update langwatch to 0.1.10
2024-07-17 21:21:00 +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
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
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
Gabriel Luiz Freitas Almeida
50dc1e87d1
refactor: move tracers to respective files (#2734)
* refactor: move Tracers to respective files

* feat(pyproject.toml): update langwatch version to 0.1.9 and add langsmith dependency at version 0.1.86
2024-07-16 19:02:16 +00:00
Rogério Chaves
89f2f62041
Add LangWatch Integration (#2608)
* First implementation of LangWatch tracer

* Update to langwatch 0.1.4 to use root span for better control of the all-wrapping trace, workaround for llm not being used for an actual call and better ids on langwatch ui

* Remove dependency from backend base internal and add langwatch docs

* [autofix.ci] apply automated fixes

* Fix using session id for metadata, except if the same as flow_id

* Fix wrong error variable and support for python <3.10 is not necessary given langflow pyproject restrictions

* Bump langwatch to v0.1.4

* [autofix.ci] apply automated fixes

* Remove extra line the popped up

* Fix missing log parameter on method

* Fix mypy issues

* Bump langwatch to v0.1.7 to truncate large documents

* Move docs to the right folder

* chore: update lock

* chore: Update clarifai-grpc to version 10.6.4, cohere to version 5.6.1, langwatch to version 0.1.3, and litellm to version 1.41.23

---------

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-16 10:28:57 -07: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