summaryrefslogtreecommitdiffstats
path: root/g4f/typing.py
diff options
context:
space:
mode:
authorH Lohaus <hlohaus@users.noreply.github.com>2024-02-28 09:48:57 +0100
committerGitHub <noreply@github.com>2024-02-28 09:48:57 +0100
commit96db520ff030cd0beae8b469876013b8f18b793a (patch)
tree0d2d6cf85371cc454279bd454ae851ca0fee930a /g4f/typing.py
parentMerge pull request #1635 from hlohaus/flow (diff)
parentAdd websocket support in OpenaiChat (diff)
downloadgpt4free-96db520ff030cd0beae8b469876013b8f18b793a.tar
gpt4free-96db520ff030cd0beae8b469876013b8f18b793a.tar.gz
gpt4free-96db520ff030cd0beae8b469876013b8f18b793a.tar.bz2
gpt4free-96db520ff030cd0beae8b469876013b8f18b793a.tar.lz
gpt4free-96db520ff030cd0beae8b469876013b8f18b793a.tar.xz
gpt4free-96db520ff030cd0beae8b469876013b8f18b793a.tar.zst
gpt4free-96db520ff030cd0beae8b469876013b8f18b793a.zip
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',