From eae317a1665f94ada0c34875a0aec09df89b138b Mon Sep 17 00:00:00 2001 From: H Lohaus Date: Thu, 21 Nov 2024 05:00:08 +0100 Subject: Support synthesize in Openai generator (#2394) * 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 * Support speech synthesize in Openai generator --- g4f/client/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'g4f/client/__init__.py') diff --git a/g4f/client/__init__.py b/g4f/client/__init__.py index dea19a60..38269cf6 100644 --- a/g4f/client/__init__.py +++ b/g4f/client/__init__.py @@ -13,7 +13,7 @@ from ..providers.base_provider import AsyncGeneratorProvider from ..image import ImageResponse, copy_images, images_dir from ..typing import Messages, Image, ImageType from ..providers.types import ProviderType -from ..providers.response import ResponseType, FinishReason, BaseConversation +from ..providers.response import ResponseType, FinishReason, BaseConversation, SynthesizeData from ..errors import NoImageResponseError, ModelNotFoundError from ..providers.retry_provider import IterListProvider from ..providers.base_provider import get_running_loop @@ -60,6 +60,8 @@ def iter_response( elif isinstance(chunk, BaseConversation): yield chunk continue + elif isinstance(chunk, SynthesizeData): + continue chunk = str(chunk) content += chunk @@ -121,6 +123,8 @@ async def async_iter_response( elif isinstance(chunk, BaseConversation): yield chunk continue + elif isinstance(chunk, SynthesizeData): + continue chunk = str(chunk) content += chunk -- cgit v1.2.3