diff options
author | Heiner Lohaus <hlohaus@users.noreply.github.com> | 2024-02-27 11:55:40 +0100 |
---|---|---|
committer | Heiner Lohaus <hlohaus@users.noreply.github.com> | 2024-02-27 11:55:40 +0100 |
commit | 84812b9632cae2dc4811222a2f31d42cb807a221 (patch) | |
tree | f7dda40a968be33ee87e78187a2bf41bb78cf973 /g4f/typing.py | |
parent | Add support for message history and system message in OpenaiChat (diff) | |
download | gpt4free-84812b9632cae2dc4811222a2f31d42cb807a221.tar gpt4free-84812b9632cae2dc4811222a2f31d42cb807a221.tar.gz gpt4free-84812b9632cae2dc4811222a2f31d42cb807a221.tar.bz2 gpt4free-84812b9632cae2dc4811222a2f31d42cb807a221.tar.lz gpt4free-84812b9632cae2dc4811222a2f31d42cb807a221.tar.xz gpt4free-84812b9632cae2dc4811222a2f31d42cb807a221.tar.zst gpt4free-84812b9632cae2dc4811222a2f31d42cb807a221.zip |
Diffstat (limited to 'g4f/typing.py')
-rw-r--r-- | g4f/typing.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/g4f/typing.py b/g4f/typing.py index 386b3dfc..5d1bc959 100644 --- a/g4f/typing.py +++ b/g4f/typing.py @@ -1,5 +1,5 @@ import sys -from typing import Any, AsyncGenerator, Generator, NewType, Tuple, Union, List, Dict, Type, IO, Optional +from typing import Any, AsyncGenerator, Generator, AsyncIterator, Iterator, NewType, Tuple, Union, List, Dict, Type, IO, Optional try: from PIL.Image import Image @@ -12,8 +12,8 @@ else: from typing_extensions import TypedDict SHA256 = NewType('sha_256_hash', str) -CreateResult = Generator[str, None, None] -AsyncResult = AsyncGenerator[str, None] +CreateResult = Iterator[str] +AsyncResult = AsyncIterator[str] Messages = List[Dict[str, str]] Cookies = Dict[str, str] ImageType = Union[str, bytes, IO, Image, None] @@ -22,6 +22,8 @@ __all__ = [ 'Any', 'AsyncGenerator', 'Generator', + 'AsyncIterator', + 'Iterator' 'Tuple', 'Union', 'List', |