From 370ac539433de93aae9656d29111f50224ec6d5b Mon Sep 17 00:00:00 2001 From: H Lohaus Date: Sun, 19 May 2024 17:45:57 +0200 Subject: Update async_client.py --- g4f/client/async_client.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'g4f/client') diff --git a/g4f/client/async_client.py b/g4f/client/async_client.py index 1508e566..9849c565 100644 --- a/g4f/client/async_client.py +++ b/g4f/client/async_client.py @@ -183,9 +183,10 @@ async def iter_image_response( return ImagesResponse([Image(None, image, chunk.alt) for image in chunk.get_list()], int(time.time())) def create_image(provider: ProviderType, prompt: str, model: str = "", **kwargs) -> AsyncIterator: - prompt = f"create a image with: {prompt}" - if provider.__name__ == "You": + if isinstance(provider, type) and provider.__name__ == "You": kwargs["chat_mode"] = "create" + else: + prompt = f"create a image with: {prompt}" return provider.create_async_generator( model, [{"role": "user", "content": prompt}], -- cgit v1.2.3