mirror of
https://github.com/xtekky/gpt4free.git
synced 2024-11-23 00:22:09 +03:00
84812b9632
Improve read access_token in OpenaiChat Add IterProvider Add system message support in FlowGpt Filter none values in new Client
43 lines
875 B
Python
43 lines
875 B
Python
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
|
|
|
|
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]
|
|
|
|
__all__ = [
|
|
'Any',
|
|
'AsyncGenerator',
|
|
'Generator',
|
|
'AsyncIterator',
|
|
'Iterator'
|
|
'Tuple',
|
|
'Union',
|
|
'List',
|
|
'Dict',
|
|
'Type',
|
|
'IO',
|
|
'Optional',
|
|
'TypedDict',
|
|
'SHA256',
|
|
'CreateResult',
|
|
'AsyncResult',
|
|
'Messages',
|
|
'Cookies',
|
|
'Image',
|
|
'ImageType'
|
|
]
|