summaryrefslogtreecommitdiffstats
path: root/g4f/client/async_client.py
diff options
context:
space:
mode:
authorH Lohaus <hlohaus@users.noreply.github.com>2024-05-22 20:18:42 +0200
committerGitHub <noreply@github.com>2024-05-22 20:18:42 +0200
commit6830dfcc6439562af805c8ea72e6e45bba5da401 (patch)
tree30609eb68c513387bd616a14f9cec3b82db6eaff /g4f/client/async_client.py
parentImprove readme (diff)
parentFix image vision in You.com provider (diff)
downloadgpt4free-6830dfcc6439562af805c8ea72e6e45bba5da401.tar
gpt4free-6830dfcc6439562af805c8ea72e6e45bba5da401.tar.gz
gpt4free-6830dfcc6439562af805c8ea72e6e45bba5da401.tar.bz2
gpt4free-6830dfcc6439562af805c8ea72e6e45bba5da401.tar.lz
gpt4free-6830dfcc6439562af805c8ea72e6e45bba5da401.tar.xz
gpt4free-6830dfcc6439562af805c8ea72e6e45bba5da401.tar.zst
gpt4free-6830dfcc6439562af805c8ea72e6e45bba5da401.zip
Diffstat (limited to 'g4f/client/async_client.py')
-rw-r--r--g4f/client/async_client.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/g4f/client/async_client.py b/g4f/client/async_client.py
index dbfa6b70..2fe4640b 100644
--- a/g4f/client/async_client.py
+++ b/g4f/client/async_client.py
@@ -18,6 +18,7 @@ from ..Provider import ProviderUtils
from ..typing import Union, Messages, AsyncIterator, ImageType
from ..errors import NoImageResponseError, ProviderNotFoundError
from ..requests.aiohttp import get_connector
+from ..providers.conversation import BaseConversation
from ..image import ImageResponse as ImageProviderResponse, ImageDataResponse
try:
@@ -42,6 +43,9 @@ async def iter_response(
if isinstance(chunk, FinishReason):
finish_reason = chunk.reason
break
+ elif isinstance(chunk, BaseConversation):
+ yield chunk
+ continue
content += str(chunk)
count += 1
if max_tokens is not None and count >= max_tokens: