Skip to content

Commit

Permalink
feat(g4f/api/__init__.py): Update image generation response format
Browse files Browse the repository at this point in the history
  • Loading branch information
kqlio67 committed Nov 9, 2024
1 parent c1e6276 commit b2b978c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion g4f/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ async def generate_image(config: ImageGenerationConfig):
response_format=config.response_format
)
# Convert Image objects to dictionaries
response_data = [image.to_dict() for image in response.data]
response_data = [{"url": image.url, "b64_json": image.b64_json} for image in response.data]
return JSONResponse({"data": response_data})
except Exception as e:
logging.exception(e)
Expand Down

0 comments on commit b2b978c

Please sign in to comment.