make image gen size configurable
Build and Push Container / build-and-push (push) Successful in 1m29s

This commit is contained in:
2026-08-17 10:42:46 -04:00
parent fb8f40398c
commit 2c61a04bcc
3 changed files with 6 additions and 1 deletions
+3 -1
View File
@@ -295,6 +295,7 @@ def image_generation(
openai_api_key: str,
model: str = "gen",
n: int = 1,
size: str = "1024x1024",
) -> str:
"""Generate an image using the given prompt.
@@ -304,6 +305,7 @@ def image_generation(
openai_api_key: The API key for authentication.
model: The model to use for image generation.
n: Number of images to generate.
size: The size of the generated image, e.g. "1024x1024".
Returns:
The base64 encoded image data. Decode and write to a file.
@@ -318,7 +320,7 @@ def image_generation(
response = client.images.generate(
prompt=prompt,
n=n,
size="768x768",
size=size,
model=model,
timeout=120.0,
)