gpt4free/g4f/typing.py

43 lines
875 B
Python
Raw Normal View History

import sys
from typing import Any, AsyncGenerator, Generator, AsyncIterator, Iterator, NewType, Tuple, Union, List, Dict, Type, IO, Optional
try:
from PIL.Image import Image
except ImportError:
from typing import Type as Image
if sys.version_info >= (3, 8):
from typing import TypedDict
else:
from typing_extensions import TypedDict
2023-06-24 01:47:00 +00:00
2023-08-27 15:37:44 +00:00
SHA256 = NewType('sha_256_hash', str)
CreateResult = Iterator[str]
AsyncResult = AsyncIterator[str]
Messages = List[Dict[str, str]]
Cookies = Dict[str, str]
ImageType = Union[str, bytes, IO, Image, None]
2023-07-28 10:07:17 +00:00
__all__ = [
2023-08-27 15:37:44 +00:00
'Any',
'AsyncGenerator',
'Generator',
'AsyncIterator',
'Iterator'
2023-08-27 15:37:44 +00:00
'Tuple',
2024-01-21 01:20:23 +00:00
'Union',
'List',
'Dict',
'Type',
2024-01-23 23:46:35 +00:00
'IO',
'Optional',
2023-08-27 15:37:44 +00:00
'TypedDict',
2023-09-17 21:23:54 +00:00
'SHA256',
'CreateResult',
2024-01-21 01:20:23 +00:00
'AsyncResult',
'Messages',
'Cookies',
'Image',
2024-01-21 01:20:23 +00:00
'ImageType'
]