summaryrefslogtreecommitdiffstats
path: root/g4f/client
diff options
context:
space:
mode:
authorH Lohaus <hlohaus@users.noreply.github.com>2024-11-21 05:00:08 +0100
committerGitHub <noreply@github.com>2024-11-21 05:00:08 +0100
commiteae317a1665f94ada0c34875a0aec09df89b138b (patch)
tree179028357182327909cb7bd4f53977e8ae4d9122 /g4f/client
parentImprove download of generated images, serve images in the api (#2391) (diff)
downloadgpt4free-0.3.5.5.tar
gpt4free-0.3.5.5.tar.gz
gpt4free-0.3.5.5.tar.bz2
gpt4free-0.3.5.5.tar.lz
gpt4free-0.3.5.5.tar.xz
gpt4free-0.3.5.5.tar.zst
gpt4free-0.3.5.5.zip
Diffstat (limited to 'g4f/client')
-rw-r--r--g4f/client/__init__.py6
1 files changed, 5 insertions, 1 deletions
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