From ffb4b0d162cc29b1caa4539d854de37206804225 Mon Sep 17 00:00:00 2001 From: H Lohaus Date: Wed, 20 Nov 2024 19:58:16 +0100 Subject: Improve download of generated images, serve images in the api (#2391) * Improve download of generated images, serve images in the api Add support for conversation handling in the api * Add orginal prompt to image response * Add download images option in gui, fix loading model list in Airforce * Add download images option in gui, fix loading model list in Airforce --- 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 710fde4b..1bc71141 100644 --- a/g4f/typing.py +++ b/g4f/typing.py @@ -10,11 +10,13 @@ if sys.version_info >= (3, 8): from typing import TypedDict else: from typing_extensions import TypedDict + +from .providers.response import ResponseType SHA256 = NewType('sha_256_hash', str) -CreateResult = Iterator[str] -AsyncResult = AsyncIterator[str] -Messages = List[Dict[str, Union[str,List[Dict[str,Union[str,Dict[str,str]]]]]]] +CreateResult = Iterator[Union[str, ResponseType]] +AsyncResult = AsyncIterator[Union[str, ResponseType]] +Messages = List[Dict[str, Union[str, List[Dict[str, Union[str, Dict[str, str]]]]]]] Cookies = Dict[str, str] ImageType = Union[str, bytes, IO, Image, None] -- cgit v1.2.3