diff options
author | H Lohaus <hlohaus@users.noreply.github.com> | 2024-05-19 17:45:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-19 17:45:57 +0200 |
commit | 370ac539433de93aae9656d29111f50224ec6d5b (patch) | |
tree | a81fc7a8d68e3ace268ef0c58d9594c90d6653dd /g4f/client | |
parent | Merge pull request #1981 from hlohaus/leech (diff) | |
download | gpt4free-370ac539433de93aae9656d29111f50224ec6d5b.tar gpt4free-370ac539433de93aae9656d29111f50224ec6d5b.tar.gz gpt4free-370ac539433de93aae9656d29111f50224ec6d5b.tar.bz2 gpt4free-370ac539433de93aae9656d29111f50224ec6d5b.tar.lz gpt4free-370ac539433de93aae9656d29111f50224ec6d5b.tar.xz gpt4free-370ac539433de93aae9656d29111f50224ec6d5b.tar.zst gpt4free-370ac539433de93aae9656d29111f50224ec6d5b.zip |
Diffstat (limited to '')
-rw-r--r-- | g4f/client/async_client.py | 5 |
1 files changed, 3 insertions, 2 deletions
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}], |