From 6266d2201cbdff20bcff927363ef03ea67f9a6c8 Mon Sep 17 00:00:00 2001 From: ogabrielluiz Date: Tue, 18 Jun 2024 19:20:45 -0300 Subject: [PATCH] refactor: Update typing imports in inputs.py The code changes in `inputs.py` update the typing imports to include `AsyncIterator` and `Iterator` in the `typing` module. This ensures that the correct types are used for certain variables in the code. The commit message follows the established convention of using a prefix to indicate the type of change. --- src/backend/base/langflow/inputs/inputs.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/backend/base/langflow/inputs/inputs.py b/src/backend/base/langflow/inputs/inputs.py index 735dd8d0b..5f1fc5bde 100644 --- a/src/backend/base/langflow/inputs/inputs.py +++ b/src/backend/base/langflow/inputs/inputs.py @@ -1,4 +1,4 @@ -from typing import Any, Callable, Optional, Union +from typing import Any, AsyncIterator, Callable, Iterator, Optional, Union from pydantic import Field, field_validator @@ -153,6 +153,8 @@ class TextInput(StrInput): f"The input to '{input_name}' must contain the key '{v.text_key}'." f"You can set `text_key` to one of the following keys: {keys} or set the value using another Component." ) + elif isinstance(v, (AsyncIterator, Iterator)): + value = v else: raise ValueError(f"Invalid value type {type(v)}") return value