Commit graph

13,977 commits

Author SHA1 Message Date
Jordan Frazier
7fe478e4b1
fix: set folder id on flows imported on startup (#4018)
* set folder id on flows imported on startup
---------

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-10-04 17:19:08 +00:00
Marcelo Nunes Alves
b7aed91ad9
feat: Add Redis Chat Memory (#3832)
* feat: Add Redis Chat Memory

* [autofix.ci] apply automated fixes

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

* Refactor password handling in RedisIndexChatMemory to use a local variable

---------

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-10-04 17:06:47 +00:00
Christophe Bornet
63beae1833
ref: Add ruff rules RUF (#4001)
Add ruff rules RUF
2024-10-04 15:01:56 +00:00
Christophe Bornet
e2d907f3c5
Add ruff rules for TYPE_CHECKING (TCH) (#3999) 2024-10-04 16:00:09 +02:00
anovazzi1
99cdaaf073
feature: Add cursor highlight feature in canvas page (#4007)
* added a color change in cursor to help user find the cursor in the canvas page

* [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 <cristhian.lousa@gmail.com>
2024-10-04 13:59:56 +00:00
Ítalo Johnny
0298596b64
fix: add user_id to component parameters to fix build (#4016) 2024-10-03 17:55:23 -03:00
Gabriel Luiz Freitas Almeida
b6546e456e
feat: add 'tags' column to 'flow' table and update models (#3986)
* Add 'tags' column to 'flow' table and update models

- Added migration script to include 'tags' column in 'flow' table.
- Updated `Flow` model to include `tags` field.
- Introduced `Tags` enum in `schema.py` for predefined tag values.

* Update `tags` column to use JSON type in Flow model

* Add conditional checks for 'tags' column in Alembic migration script

* Make 'tags' field nullable in Flow model

* Add default value for 'tags' field in Flow model

* Update default values for 'tags' field in Flow model
2024-10-03 11:20:38 -07:00
Gabriel Luiz Freitas Almeida
e395cb7f4b
chore: Add type annotation for 'status' and format multiline string in TavilyAISearch tool (#4011)
* Format multiline string in TavilySearchToolComponent description

* Add type annotation for 'status' and import 'Any' in TavilyAISearch tool
2024-10-03 17:59:57 +00:00
namastex888
350189c88d
feat(tools): add TavilyAI search tool for enhanced LLM search results (#3774)
* add tavily new icon

* feat(tools): add TavilyAI search tool for enhanced LLM search results

* [autofix.ci] apply automated fixes

* add tavily icon

* [autofix.ci] apply automated fixes

---------

Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
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-10-03 17:38:44 +00:00
Gabriel Luiz Freitas Almeida
4d6fe61e71
chore: Update zep-python dependency to stable version 2.0.0 in pyproject.toml (#4009)
Update zep-python dependency to stable version 2.0.0 in pyproject.toml
2024-10-03 10:25:26 -07:00
Swastik-Swarup-Dash
8a84299a47
fix: modified QdrantVectorStoreComponent to use server_kwargs correctly (#3751)
* resolveQdrant Vector Store doesnt' use the advanced fields when ingesting documents #3749

* resolveQdrant Vector Store doesnt' use the advanced fields when ingesting documents #3749

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-10-03 10:25:03 -07:00
Gabriel Luiz Freitas Almeida
4519f9ffa8
chore: Add 'types' field to pre-commit hooks for ruff check and format (#4006) 2024-10-03 09:53:58 -07:00
Ítalo Johnny
ed7ec6a332
feat: improve CLI parameter handling and cleanup unused code (#4002)
* chore: remove envvar parameter from CLI option

* chore: add show_default=False flag to CLI option

* chore: update argument type to accept None

* feat: add missing Settings to CLI options

* feat: add default path value for components

* chore: rename CLI parameters to match Settings

* feat: update function to enforce parameter hierarchy

CLI > specific env_file > default env_file

* fix: adjust CLI parameter code to pass unit tests

* fix: mypy error arg-type

* fix: little ajustments
2024-10-03 16:10:04 +00:00
Cezar Vasconcelos
b8e7a77d78
feat: Add new Data utility components for CSV/JSON parsing, routing, and filtering (#3776)
* feat: Add CurrentDateComponent for timezone-based date

* feat: Add DataConditionalRouter component

* feat: Add DataFilterComponent for filtering data

* feat(components): Add beta and name attributes to components

* feat: Add JSON to Data component

* feat: Add CSV to Data component

* feat(helpers): Add ExtractKey component for key extraction

* feat: Add list processing to DataConditionalRouter

* [autofix.ci] apply automated fixes

* feat: add MessageToData component

* feat(CSVtoData, JSONtoData): Add file input support

* [autofix.ci] apply automated fixes

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

* Refactor error messages and improve code readability in data components utilities

---------

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-10-03 15:48:57 +00:00
Edwin Jose
461238aa0e
fix: Add session_id Parameter to run_flow_from_json Function (#3989)
This pull request fixes the `run_flow_from_json` function by adding  `session_id` parameter. This update ensures that session management is properly handled during flow execution.

Changes include:
- Added `session_id` as an optional input parameter.
- Updated function documentation to reflect the inclusion of the new parameter.
- Added unit test for run_flow_from_json input parameters

This fix enhances the function's usability by allowing for better tracking of individual sessions.
2024-10-03 15:43:31 +00:00
João
75ffe0b11b
feat: Add Elasticsearch VectorStore Component with Ingest and Advanced Search Capabilities (#3899)
* feat: adding Elasticsearch  VectorStore component code

* update: adding langchain-elasticsearch dependency

* update: adding langchain-elasticsearch dependency (ruff format fix)

* Add `langchain-elasticsearch` dependency to pyproject.toml

* Refactor type hints to use PEP 585 syntax in Elasticsearch vector store component

* Refactor ElasticsearchVectorStoreComponent for improved readability and error handling

- Consolidated import statements and removed unused imports.
- Reformatted long strings for better readability.
- Enhanced error messages with variable assignment for clarity.
- Removed redundant else clause in search_documents method.

---------

Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-10-03 15:41:30 +00:00
namastex888
11283655fe
feat(YahooFinanceTool): enhance tool with new inputs for data retrieval methods (#3738)
* feat(YahooFinanceTool): enhance tool with new inputs for data retrieval methods

* test: fix test

* test: fix test units

* test: fix import

* fix: rename component

* Fix instantiation of YfinanceToolComponent in complex_agent.py

---------

Co-authored-by: italojohnny <italojohnnydosanjos@gmail.com>
Co-authored-by: Gabriel Luiz Freitas Almeida <gabriel@langflow.org>
2024-10-03 08:33:28 -07:00
Christophe Bornet
b591d7105e
ref: Add ruff rules for builtins (A) (#4004)
Add ruff rules for builtins (A)
2024-10-03 14:26:27 +00:00
Christophe Bornet
528e676e56
ref: Add ruff rules for datetime (DTZ) (#4003)
Add ruff rules for datetime (DTZ)
2024-10-03 14:22:25 +00:00
Christophe Bornet
a3a950c290
ref: Add more ruff rules (#3994)
Add more ruff rules
2024-10-03 08:55:49 +00:00
Yuqi Tang
91e5ae797d
fix: make streaming work in JS code example (#3891)
* fix js code

* fix js code

* fix js code

* fix js code

* update js code

* update js code
2024-10-02 23:34:05 +00:00
anovazzi1
0d796db02c
feat: add integrations category in the sidebar (#3843)
* feat: Add skipFallback parameter to ForwardedIconComponent

This commit adds a new skipFallback parameter to the ForwardedIconComponent in the genericIconComponent module. The skipFallback parameter allows developers to skip rendering the fallback component when using Suspense. This can be useful in cases where the fallback component is not needed or should be handled differently.

* feat: Add skipFallback parameter to IconComponentProps

* feat: Add skipFallback parameter to IconComponentProps and ForwardedIconComponent

This commit adds the skipFallback parameter to the IconComponentProps and ForwardedIconComponent. This parameter allows skipping the fallback icon rendering when the specified icon is not found. The skipFallback parameter is used in the ParentDisclosureComponent to conditionally render the chevron-down or chevron-right icon based on the component's state.

The commit also updates the defaultOpen value in the ParentDisclosureComponent in the ExtraSidebarComponent. The defaultOpen value is set to true, ensuring that the "Integrations" section is always expanded when the component is rendered.

* refactor: Update ExtraSidebarComponent layout and styling

* [autofix.ci] apply automated fixes

* move file

* move file

* move file

* move file

* move file

* Update NotionLogo size

* Update size of AssemblyAI logo

* Update colors and names for AssemblyAI in styleUtils.ts

* Update BUNDLES_SIDEBAR_FOLDER_NAMES in constants.ts

* [autofix.ci] apply automated fixes

* add changes from pr #3934

* chore: add cache.db to .gitignore

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-10-02 12:07:57 -07:00
sa411022
0fc4c4781e
fix: message list order (#3987)
Fix message list order

The system message should be inserted into the first position of the message list instead of being appended at the last position.
2024-10-02 12:06:48 -07:00
Gabriel Luiz Freitas Almeida
4221fa40e6
refactor: deactivate caching if a component is part of a cycle (#3694)
* Set `_has_cycle_edges` to `True` for source and target vertices in cycle edges

* feat: Add `has_cycle_edges` method to Vertex class

The `has_cycle_edges` method is added to the `Vertex` class to check if the vertex has any cycle edges. Additionally, the `instantiate_component` method is updated to use the `initialize.loading.instantiate_class` function for custom component instantiation.

* Add `apply_on_outputs` method to Vertex for applying functions to outputs

* Add utility to find vertices in cycles within a directed graph

- Implement `find_cycle_vertices` function to identify all vertices that are part of cycles in a directed graph.
- Utilize depth-first search (DFS) to detect cycles and collect vertices involved in those cycles.

* Add unit tests for `find_cycle_vertices` utility function in graph module

* Add method to set cache for vertices in cycle

- Introduced `_set_cache_to_vertices_in_cycle` method to enable caching for vertices involved in cycles.
- Added `find_cycle_vertices` import to support the new method.
- Refactored vertex instantiation into `_instantiate_components_in_vertices` method for better code organization.

* refactor: Update caching logic for vertices in cycles

Refactor the `_set_cache_to_vertices_in_cycle` method to improve caching logic for vertices involved in cycles. Instead of setting the `cache` attribute to `True`, it is now set to `False` for better clarity and consistency. This change ensures that the cache is properly handled for vertices in cycles.

* Refactor `find_cycle_vertices` to use NetworkX for cycle detection

* Refactor `find_cycle_vertices` tests to remove entry point parameter and add new test case

- Removed the `entry_point` parameter from all test cases for `find_cycle_vertices`.
- Added a new parameterized test case `test_handle_two_inputs_in_cycle` to verify handling of cycles with two inputs.

* Disable cache in cycle: Update `apply_on_outputs` to handle empty outputs in `base.py`

* Add unit test to ensure output cache is disabled in graph cycles

* Add unit test for graph cyclicity with prompt components and OpenAI integration

- Introduce `test_updated_graph_with_prompts` to validate graph cyclicity and execution.
- Integrate `PromptComponent`, `OpenAIModelComponent`, and `ConditionalRouterComponent` in the test.
- Ensure graph execution with a maximum of 20 iterations and cache disabled.
- Validate the presence of expected output vertices in the results.

* Convert `_instantiate_components_in_vertices` to async and disable cache in cycle vertices

* Add default value handling for cycle edges in vertex component

- Introduced `default_value` to handle cases where edges are cycles and target parameters are present.
- Ensured that `default_value` is returned if defined, preventing errors when the component is not built.

* Switch from os.environ to os.getenv for API key retrieval in test_cycles.py

* Add __repr__ method to Edge class to indicate cycle edges with a symbol

* Refactor test_cycles.py to streamline component initialization and update assertions

- Simplified component initialization using method chaining.
- Corrected router input and message parameters to use openai_component_1.
- Updated assertions to check for correct output IDs.

* Refactor test_cycles.py to streamline component initialization and update assertions

* Refactor test to use custom serialization method instead of pickle

* Add cycle_vertices property to optimize cycle detection in graph

- Introduced `_cycle_vertices` attribute to store vertices involved in cycles.
- Added `cycle_vertices` property to compute and cache cycle vertices.
- Updated edge creation logic to use `cycle_vertices` for cycle detection.

* Enhance error message in `types.py` to include component ID for better debugging

* Refactor test_cycles.py to update graph configuration and assertions

- Changed router operator from "equals" to "contains".
- Consolidated chat output to a single component.
- Updated graph construction to use a single chat output.
- Replaced `_snapshot` with `get_snapshot` for graph state capture.
- Adjusted assertions to reflect the updated graph structure and outputs.

* Add api_key_required marker to test_updated_graph_with_prompts test

* Add validation to require max_iterations for cyclic graphs

* run ruff

- Refactored error message handling in `base.py` for cyclic graphs.
- Optimized cycle vertex extraction in `utils.py` by using set comprehension.

* Comment out tests for loading flow from JSON in test_loading.py

* Refactor test fixture for webhook flow creation in conftest.py

* Update unit tests to reflect new webhook flow structure in vertices endpoints

* Temporarily disable tests for loading Langchain objects with and without cached sessions

* Disable caching in vector store and OpenAI model components
2024-10-02 18:05:20 +00:00
Gabriel Luiz Freitas Almeida
6febae599b
tests: update tests to use httpx.AsyncClient (#3984)
* Add async support and dependencies to pyproject.toml files

- Added `asgi-lifespan>=2.1.0` to dependencies.
- Configured `asyncio_mode` and `asyncio_default_fixture_loop_scope` for pytest.
- Updated `tool.uv` section with `asgi-lifespan` in dev-dependencies.

* Convert test fixtures to async and use AsyncClient for HTTP requests

* Handle 'ImportFrom' nodes in AST validation to support module attribute imports

* Convert test cases to use async HTTP client

- Updated test cases in `test_database.py`, `test_endpoints.py`, `test_user.py`, `test_variable.py`, `test_files.py`, `test_chat_endpoint.py`, `test_misc.py`, `test_messages_endpoints.py`, `test_api_key.py`, `test_webhook.py`, and `test_login.py` to use `httpx.AsyncClient` instead of `fastapi.TestClient`.
- Modified test functions to be asynchronous and use `await` for HTTP requests.
- Adjusted fixtures and helper functions to support asynchronous operations.
- Ensured consistency in endpoint paths and request methods across all test cases.

* Refactor string concatenation to f-string in test_chat_endpoint.py

* [autofix.ci] apply automated fixes

* Refactor import validation to use pattern matching for AST nodes

* Set `startup_timeout` and `shutdown_timeout` to `None` in `LifespanManager` for test files.

* Convert test functions to async in `test_messages_endpoints.py`

* Add `api_key_required` marker to assistant component tests

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-10-02 10:21:52 -07:00
Christophe Bornet
7e3d470845
ref: Add ruff rules for bugbear (B) (#3983)
Add ruff rules for bugbear (B)
2024-10-02 18:55:51 +02:00
Jordan Frazier
06eebb5ca8
ci: small nightly fixes (#3993)
* Add back correct checkout steps

* fix directory
2024-10-02 16:36:55 +00:00
Yuqi Tang
06239ea63a
Fix: change note node horizontal padding (#3991)
* fix notes style

* fix notes style

* adding ghost node

* [autofix.ci] apply automated fixes

* change cursor position

* update notes related test

* [autofix.ci] apply automated fixes

* adjust shadow block width

* move cursor to middle:

* [autofix.ci] apply automated fixes

* fix padding

* change note node horizontal padding

* [autofix.ci] apply automated fixes

---------

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-10-02 10:56:36 -05:00
Christophe Bornet
426719607b
ref: Add some postponed annotations evaluations (#3990)
Add some postponed annotations evaluations
2024-10-02 14:27:11 +00:00
Christophe Bornet
942c8dca36
feat: Add ruff rules SIM (#3979)
Add ruff rules SIM
2024-10-02 05:45:41 -07:00
Yuqi Tang
e58b27062c
feat: improve notes design (#3938)
* fix notes style

* fix notes style

* adding ghost node

* [autofix.ci] apply automated fixes

* change cursor position

* update notes related test

* [autofix.ci] apply automated fixes

* adjust shadow block width

* move cursor to middle:

* [autofix.ci] apply automated fixes

* fix padding

---------

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-10-02 05:45:19 -07:00
Jordan Frazier
e19d90bd6c
ci: fix releases with uv (#3971)
* Update scripts

* update the base dep in uv deps

* update nightly scripts

* Add uv creds for publish

* skip tests for now

* fix version

* only build the wheel

* try again

* add uv to python run

* [autofix.ci] apply automated fixes

* use uv cache

* more version fixe

* fixing versions

* fix base version

* Try no frozen?

* skip everything to try docker build

* tag

* frozen

* separate script for updating uv dep

* [autofix.ci] apply automated fixes

* hardcoded versions

* hardcoded versions

* add version to editable package

* build project before docker file runs

* try again

* fix uv patht o build

* don't know why this would mkae a difference

* debug statements

* debug statements

* debug statements

* change path to whl 🤷

* manually move the wheel...

* make dir

* try no sources

* add back tests

* refactor uv to action

* add uv action

* Update nightly build workflow to include uv lock files in version update commit

* Update lint-py workflow to use specific ref for setup-uv action

* Add checkout step to style-check-py GitHub Actions workflow

* Remove redundant GitHub ref syntax in lint-py.yml workflow

* Update lint-py.yml to use specific ref for setup-uv action

* Update action.yml: standardize quotes and remove redundant checkout step

* Add checkout step to GitHub Actions workflows for specific ref handling

- Introduced `actions/checkout@v4` step to multiple workflows to ensure code is checked out at a specific ref.
- Updated `.github/workflows/docker-build.yml`, `.github/workflows/release_nightly.yml`, `.github/workflows/lint-py.yml`, and `.github/workflows/style-check-py.yml` to include the new checkout step.
- Ensured credentials are persisted during the checkout process.

* Add checkout step to Python test workflow with specific ref

---------

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-10-02 05:37:04 -07:00
João
b9bcb09e63
feat: Add OpenSearch VectorStore Component with Ingest and Search Capabilities (#3799)
* update: adding opensearch-py dependency

* feat: adding OpenSearch icon

* feat: adding OpenSearch VectorStore code

* fix: removing unused methods and adding hybrid search capabilities using search method

* update: poetry lock with recent hash added

* fix: removing unused methods and adding hybrid search capabilities using search method

* fix: default value of search_input to an empty string

* fix: adapting code to match make format script
2024-10-01 21:42:55 +00:00
Gabriel Luiz Freitas Almeida
e882f08549
feat: add 'gradient' column to Flow model and database schema (#3944)
Add 'gradient' column to Flow model and database schema
2024-10-01 21:06:19 +00:00
Gabriel Luiz Freitas Almeida
270f609fe7
refactor: enhance tool creation logic and add FeatureFlags (#3662)
* Add `required_inputs` field to `Output` model in `base.py`

* Refactor ComponentTool to ComponentToolkit and enhance tool creation logic

- Replaced `ComponentTool` with `ComponentToolkit` to better encapsulate component-related tools.
- Introduced `build_description` and `_build_output_function` helper functions for dynamic tool creation.
- Updated tool initialization to handle multiple outputs and required inputs using `StructuredTool`.
- Improved schema creation for tool arguments based on component inputs.

* Refactor `to_tool` method to `to_toolkit` to use `ComponentToolkit` instead of `ComponentTool`

* Refactor `ComponentTool` to `ComponentToolkit` in unit tests

- Updated import statements to reflect the new `ComponentToolkit` class.
- Modified test logic to use `ComponentToolkit` for retrieving tools.
- Adjusted assertions to match the new structure and output format.
- Ensured compatibility with `Message` schema for output validation.

* Refactor `test_component_to_tool` to validate `ComponentToolkit` and tool properties

* Refactor `build_description` to include input types in the output format

* Add method to set required inputs for outputs based on method analysis

- Introduced `_set_output_required_inputs` method to determine and set required inputs for each output by analyzing the method's source code.
- Added necessary imports (`ast` and `dedent`) to support the new functionality.

* Update test to assert full tool description in test_component_to_tool.py

* Add unit tests for verifying required inputs of various components

- Added tests to ensure that required inputs for outputs are present in the inputs of `ChatInput`, `ChatOutput`, `SequentialTaskComponent`, `ToolCallingAgentComponent`, and `OpenAIModelComponent`.
- Included helper functions to check if required inputs are in inputs and to assert that all outputs have different required inputs.

* Add RequiredInputsVisitor to identify required inputs in AST nodes

- Introduced RequiredInputsVisitor class to traverse AST nodes and collect required inputs.
- The visitor checks for 'self' attributes matching the provided inputs and adds them to the required_inputs set.

* Refactor required inputs extraction using `RequiredInputsVisitor`

* Add feature flags configuration for toolkit output in settings

* Add toolkit output handling based on feature flag in custom component utils

* Add method to append 'component_as_tool' output in custom component

* Add unit test for toolkit output feature flag in custom component

* Add utility functions for lazy loading and instantiating input types in langflow

- Introduced `get_InputTypesMap` for lazy loading of `InputTypesMap`.
- Added `instantiate_input` function to create instances of input types dynamically.
- Included type checking and error handling for invalid input types.

* Refactor input instantiation logic and update imports

- Removed `instantiate_input` function from `inputs.py` and moved it to `utils.py`.
- Updated imports in `base.py` to reflect the new location of `instantiate_input`.
- Added missing import for `Callable` in `base.py`.

* Refactor import statement to use `instantiate_input` from `langflow.inputs.utils` in test_inputs.py

* Add TOOL_OUTPUT_NAME constant to tools module

* Add type checking and TOOL_OUTPUT_NAME filter in ComponentToolkit

- Introduced `TYPE_CHECKING` for type hints to avoid circular imports.
- Added `TOOL_OUTPUT_NAME` constant to filter specific outputs in `ComponentToolkit`.
- Updated type annotations to use forward references.

* Refactor component toolkit import to avoid circular dependency and use constant for tool output name

* Refactor `ComponentToolkit` class to remove inheritance from `BaseToolkit` and add an initializer for `component`

* Add unit test for ComponentToolkit in test_component_to_tool

- Added `test_component_to_tool_has_no_component_as_tool` to verify that `ComponentToolkit` correctly initializes with a `ChatInput` component and returns the expected tools.

* Refactor toolkit output handling to `custom_component` module

* fix: mypy errors union-attr and arg-type

* Add 'OTHER' field type to schema in langflow/io/schema.py

* Add tool name formatting to ComponentToolkit to ensure valid characters

* Refactor toolkit output handling and add type hint for `to_toolkit` method

* Add `is_interface_component` attribute to vertex types and update import order

* Add tests for ToolCallingAgentComponent and ChatOutput with API key handling

- Updated `test_component_tool` to reflect new description format.
- Added `test_component_tool_with_api_key` to test `ToolCallingAgentComponent` with `ChatOutput` and OpenAI API key.
- Enabled `add_toolkit_output` feature flag for testing.

* Refactor `_find_matching_output_method` to accept `input_name` parameter for more precise input-output matching

* Replace ValueError with warning in build_description function

* use chat_output component directly in set

* [autofix.ci] apply automated fixes

* [autofix.ci] apply automated fixes

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

* Refactor: Reorder method calls in `__init__` for logical consistency

Moved `set_class_code` method call to ensure output types and required inputs are set before class code initialization.

* Update _format_tool_name to allow '.' in tool names

* Refactor `_format_tool_name` to remove non-alphanumeric characters

* Update test assertions for component tool name and output mapping

* Handle case where 'required_inputs' is empty in 'component_tool.py'

* Refactor import statements for better readability in `base.py`

* [autofix.ci] apply automated fixes

* Add noqa comment to suppress import warning and re-add Any import in base.py

---------

Co-authored-by: italojohnny <italojohnnydosanjos@gmail.com>
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-10-01 20:58:51 +00:00
Gabriel Luiz Freitas Almeida
df792cb19d
feat: add endpoint and tests for updating session ID in messages (#3946)
* Add endpoint to update session ID for messages in monitor API

* Add tests for updating session ID in messages endpoint

- Added test to successfully update session ID for all messages with the old session ID.
- Added test to handle case where no messages are found with the given session ID.

---------

Co-authored-by: anovazzi1 <otavio2204@gmail.com>
2024-10-01 12:35:46 -07:00
Cristhian Zanforlin Lousa
7f10a2a201
fix: playground img not working (#3980)
* 🐛 (model.py): fix issue where message.files was not being updated correctly when image_paths is empty in MessageBase class

* 🐛 (model.py): simplify condition for checking if image_paths is not empty to improve readability and maintainability

* [autofix.ci] apply automated fixes

* 🔧 (OutputParser.py): refactor error message handling for unsupported or missing parser to improve readability and maintainability

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-10-01 18:54:11 +00:00
Gabriel Luiz Freitas Almeida
e710b457c3
chore: Refactor error handling in OutputParser for improved readability (#3985)
Refactor: improve readability of error handling in OutputParser
2024-10-01 18:38:22 +00:00
dependabot[bot]
0d2a03920d
build(deps):(deps): bump peter-evans/create-pull-request from 6 to 7 (#3976)
Bumps [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) from 6 to 7.
- [Release notes](https://github.com/peter-evans/create-pull-request/releases)
- [Commits](https://github.com/peter-evans/create-pull-request/compare/v6...v7)

---
updated-dependencies:
- dependency-name: peter-evans/create-pull-request
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-01 18:31:30 +00:00
dependabot[bot]
a47a089fec
build(deps):(deps): bump install-pinned/ruff from 826c99bfba88282a5506ab737c92253a106c070e to f5afd2b0fca6556debe3e07025fc90e04fb3c44c (#3977)
build(deps):(deps): bump install-pinned/ruff

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

---
updated-dependencies:
- dependency-name: install-pinned/ruff
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-01 18:31:05 +00:00
Christophe Bornet
7b7e5cd1b4
feat: Add ruff rules for return (RET) (#3981)
Add ruff rules for return (RET)
2024-10-01 19:46:48 +02:00
Jordan Frazier
a5bd766626
ref: refactor csv output parser to dynamic single component (#3963)
* refactor csv output parser to dynamic single component

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-10-01 17:05:35 +00:00
Mendon Kissling
34f18185c5
docs: add notes to flows (#3861)
* add-note

* notes

* vector-store-rag-notes

* vector-store-rag-notes

* comma

* comma

* revert

* add-notes

* another-way

* revert

* revert

* fix

* descriptions

* lightbulb

* deployed-size

* size

* size

* resizing-is-true

* targethandle

* double

* set-components

* pin

* notes

* fix

* dont-change-code

* cleanup

* update example

* fix postion on example

* fix-descriptions

* swap-link

* newline-and-lightbulb

* another-docs-link

* play-button

* remove-double

* update NODE_FORMAT_ATTRIBUTES to prevent description updates on examples

* Update AstraDB documentation link

* update documentation on code

*  (chatInputOutputUser-shard-0.spec.ts): update the test to click on the last element with the text "Playground" to ensure correct element is clicked

* 🐛 (Basic Prompting.spec.ts): fix clicking on "Playground" element by selecting the last occurrence to ensure correct element is clicked

*  (Blog Writer.spec.ts): update test to click on the last element with text "Playground" to ensure correct element is clicked on the page

*  (Dynamic Agent.spec.ts): update test to click on the last element with text "Playground" to ensure correct element is clicked on the page

* 🐛 (decisionFlow.spec.ts): fix clicking on "Playground" button by selecting the last element with the text "Playground" to ensure correct element is clicked

* 🐛 (generalBugs-shard-3.spec.ts): fix clicking on "Playground" button by selecting the last occurrence to prevent ambiguity

* 🐛 (generalBugs-shard-0.spec.ts): fix clicking on "Playground" button by selecting the last element with the text "Playground" to ensure correct element is clicked

* 🐛 (general-bugs-shard-3836.spec.ts): fix clicking on "Playground" button by selecting the last element with the text "Playground" to ensure correct element is clicked

*  (chatInputOutputUser-shard-2.spec.ts): update test to click on the last element with text "Playground" to ensure correct interaction with chat input/output feature

*  (stop-button-playground.spec.ts): update test to click on the last occurrence of the text "Playground" to ensure correct element is clicked

* 🐛 (limit-file-size-upload.spec.ts): fix selector to click on the last element with text "Playground" instead of the first one

*  (fileUploadComponent.spec.ts): update test to click on the last element with text "Playground" to ensure correct element is clicked on the page

*  (chatInputOutput.spec.ts): update test to click on the last occurrence of the "Playground" text to ensure correct element is clicked

* 🐛 (generalBugs-shard-9.spec.ts): fix clicking on "Playground" element by selecting the last occurrence to prevent flakiness in tests

* 🐛 (Document QA.spec.ts): fix clicking on "Playground" element by selecting the last occurrence to ensure correct element is clicked

*  (similarity.spec.ts): update click method to target the last occurrence of "Playground" text to ensure correct element is clicked

* 🐛 (Simple Agent.spec.ts): fix clicking on "Playground" button by selecting the last element with the text to avoid ambiguity

*  (textInputOutput.spec.ts): update test script to target the last occurrence of the "Playground" text element to ensure correct interaction with the UI.

*  (Travel Planning Agent.spec.ts): Update the selector for the "Playground" text to ensure the correct element is clicked on the page.

* 🐛 (Vector Store.spec.ts): fix clicking on "Playground" element by selecting the last one to avoid ambiguity

*  (generalBugs-shard-9.spec.ts): add click action on the last element with test id "title-Prompt" to improve test coverage and interaction with the page

---------

Co-authored-by: anovazzi1 <otavio2204@gmail.com>
Co-authored-by: cristhianzl <cristhian.lousa@gmail.com>
2024-10-01 16:26:18 +00:00
Christophe Bornet
1668c91433
feat: Add ruff rules for error messages (EM) (#3978)
Add ruff rules for error messages (EM)
2024-10-01 15:38:32 +00:00
Mike Fortman
e63c377283
fix: Only show error state on components w/ errors for node validation (#3968)
* Only show error state on components w/ errors for node validation

* [autofix.ci] apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2024-10-01 10:22:31 -05:00
Patrick Loeber
d19c16462b
fix: enhancements for the AssemblyAI component (#3934)
Enhancements for AssemblyAI component

Co-authored-by: Patrick Loeber <98830383+ploeber@users.noreply.github.com>
2024-10-01 14:28:18 +00:00
Christophe Bornet
d92b3cb12b
feat: Add various ruff rules (#3974)
Add various ruff rules
2024-10-01 05:28:19 -07:00
Cristhian Zanforlin Lousa
2505836e51
fix: consider remove_example_flows param on query on GET flows endpoint (#3967)
🐛 (flows.py): fix logic to remove example flows based on condition to improve data consistency and prevent errors
2024-10-01 09:18:02 -03:00
Christophe Bornet
db9787c086
feat: Add ruff rules for pycodestyle Errors (E) (#3947)
Add ruff rules for pycodestyle Errors (E)
2024-10-01 13:41:30 +02:00
Christophe Bornet
b11207bef3
feat: Add pre-commit hook for ruff (#3960)
Add pre-commit hook
2024-10-01 12:50:19 +02:00