summaryrefslogtreecommitdiffstats
path: root/g4f/typing.py
diff options
context:
space:
mode:
Diffstat (limited to 'g4f/typing.py')
-rw-r--r--g4f/typing.py8
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',