mirror of
https://github.com/xtekky/gpt4free.git
synced 2024-11-10 19:11:01 +00:00
Update client.py
This commit is contained in:
parent
370ac53943
commit
fea056dd49
@ -125,9 +125,12 @@ def iter_image_response(response: Iterator) -> Union[ImagesResponse, None]:
|
|||||||
return ImagesResponse([Image(image) for image in chunk.get_list()])
|
return ImagesResponse([Image(image) for image in chunk.get_list()])
|
||||||
|
|
||||||
def create_image(client: Client, provider: ProviderType, prompt: str, model: str = "", **kwargs) -> Iterator:
|
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"
|
kwargs["chat_mode"] = "create"
|
||||||
|
else:
|
||||||
|
prompt = f"create a image with: {prompt}"
|
||||||
return provider.create_completion(
|
return provider.create_completion(
|
||||||
model,
|
model,
|
||||||
[{"role": "user", "content": prompt}],
|
[{"role": "user", "content": prompt}],
|
||||||
|
Loading…
Reference in New Issue
Block a user