refac
This commit is contained in:
@@ -641,7 +641,10 @@ async def image_generations(
|
|||||||
|
|
||||||
for image in res["data"]:
|
for image in res["data"]:
|
||||||
if image_url := image.get("url", None):
|
if image_url := image.get("url", None):
|
||||||
image_data, content_type = get_image_data(image_url, headers)
|
image_data, content_type = get_image_data(
|
||||||
|
image_url,
|
||||||
|
{k: v for k, v in headers.items() if k != "Content-Type"},
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
image_data, content_type = get_image_data(image["b64_json"])
|
image_data, content_type = get_image_data(image["b64_json"])
|
||||||
|
|
||||||
@@ -993,7 +996,10 @@ async def image_edits(
|
|||||||
images = []
|
images = []
|
||||||
for image in res["data"]:
|
for image in res["data"]:
|
||||||
if image_url := image.get("url", None):
|
if image_url := image.get("url", None):
|
||||||
image_data, content_type = get_image_data(image_url, headers)
|
image_data, content_type = get_image_data(
|
||||||
|
image_url,
|
||||||
|
{k: v for k, v in headers.items() if k != "Content-Type"},
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
image_data, content_type = get_image_data(image["b64_json"])
|
image_data, content_type = get_image_data(image["b64_json"])
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user