diff options
author | H Lohaus <hlohaus@users.noreply.github.com> | 2024-01-29 20:37:59 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-29 20:37:59 +0100 |
commit | 280ddf57b0f54d1805f1ee26aa699469019e731f (patch) | |
tree | cabcbf5fa9a5dbf75a223377dbf032cfeb3e1027 /g4f/typing.py | |
parent | Merge pull request #1523 from u66u/which-webdriver (diff) | |
parent | Improve readme / unittests (diff) | |
download | gpt4free-280ddf57b0f54d1805f1ee26aa699469019e731f.tar gpt4free-280ddf57b0f54d1805f1ee26aa699469019e731f.tar.gz gpt4free-280ddf57b0f54d1805f1ee26aa699469019e731f.tar.bz2 gpt4free-280ddf57b0f54d1805f1ee26aa699469019e731f.tar.lz gpt4free-280ddf57b0f54d1805f1ee26aa699469019e731f.tar.xz gpt4free-280ddf57b0f54d1805f1ee26aa699469019e731f.tar.zst gpt4free-280ddf57b0f54d1805f1ee26aa699469019e731f.zip |
Diffstat (limited to '')
-rw-r--r-- | g4f/typing.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/g4f/typing.py b/g4f/typing.py index c5a981bd..386b3dfc 100644 --- a/g4f/typing.py +++ b/g4f/typing.py @@ -1,9 +1,10 @@ import sys from typing import Any, AsyncGenerator, Generator, NewType, Tuple, Union, List, Dict, Type, IO, Optional + try: from PIL.Image import Image except ImportError: - Image = type + from typing import Type as Image if sys.version_info >= (3, 8): from typing import TypedDict @@ -14,7 +15,7 @@ SHA256 = NewType('sha_256_hash', str) CreateResult = Generator[str, None, None] AsyncResult = AsyncGenerator[str, None] Messages = List[Dict[str, str]] -Cookies = List[Dict[str, str]] +Cookies = Dict[str, str] ImageType = Union[str, bytes, IO, Image, None] __all__ = [ @@ -33,5 +34,7 @@ __all__ = [ 'CreateResult', 'AsyncResult', 'Messages', + 'Cookies', + 'Image', 'ImageType' ] |