From 84812b9632cae2dc4811222a2f31d42cb807a221 Mon Sep 17 00:00:00 2001 From: Heiner Lohaus Date: Tue, 27 Feb 2024 11:55:40 +0100 Subject: Update some providers Improve read access_token in OpenaiChat Add IterProvider Add system message support in FlowGpt Filter none values in new Client --- g4f/typing.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'g4f/typing.py') 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', -- cgit v1.2.3