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.
This commit is contained in:
parent
c51e311aa5
commit
6266d2201c
1 changed files with 3 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue