summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH Lohaus <hlohaus@users.noreply.github.com>2024-05-19 17:49:06 +0200
committerGitHub <noreply@github.com>2024-05-19 17:49:06 +0200
commitfea056dd49a2939cb4f0d87ba0b663cc3bf19d57 (patch)
treed4f7751e0e7a0093f6110ddae29befadd8c98dfe
parentUpdate async_client.py (diff)
downloadgpt4free-fea056dd49a2939cb4f0d87ba0b663cc3bf19d57.tar
gpt4free-fea056dd49a2939cb4f0d87ba0b663cc3bf19d57.tar.gz
gpt4free-fea056dd49a2939cb4f0d87ba0b663cc3bf19d57.tar.bz2
gpt4free-fea056dd49a2939cb4f0d87ba0b663cc3bf19d57.tar.lz
gpt4free-fea056dd49a2939cb4f0d87ba0b663cc3bf19d57.tar.xz
gpt4free-fea056dd49a2939cb4f0d87ba0b663cc3bf19d57.tar.zst
gpt4free-fea056dd49a2939cb4f0d87ba0b663cc3bf19d57.zip
-rw-r--r--g4f/client/client.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/g4f/client/client.py b/g4f/client/client.py
index 1b090981..acf53c70 100644
--- a/g4f/client/client.py
+++ b/g4f/client/client.py
@@ -125,9 +125,12 @@ def iter_image_response(response: Iterator) -> Union[ImagesResponse, None]:
return ImagesResponse([Image(image) for image in chunk.get_list()])
def create_image(client: Client, provider: ProviderType, prompt: str, model: str = "", **kwargs) -> Iterator:
- 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_completion(
model,
[{"role": "user", "content": prompt}],