Skip to content

Build AI methods with your coding agent, then run them anywhere: as an MCP for chatbots, as a webapp for people, or via API for your software.

Feature/add new models (#525)

Louis Choquele84aaa001b52
diff --git a/.pipelex/inference/backends/azure_openai.toml b/.pipelex/inference/backends/azure_openai.toml
index 35ccb4820..82d29b202 100644
--- a/.pipelex/inference/backends/azure_openai.toml
+++ b/.pipelex/inference/backends/azure_openai.toml
@@ -135,6 +135,27 @@ outputs = ["text", "structured"]
costs = { input = 1.25, output = 10.0 }
valued_constraints = { fixed_temperature = 1 }
+["gpt-5.1-codex"]
+model_id = "gpt-5.1-codex-2025-11-13"
+inputs = ["text", "images"]
+outputs = ["text", "structured"]
+costs = { input = 1.25, output = 10.0 }
+valued_constraints = { fixed_temperature = 1 }
+
+# --- GPT-5.2 Series -------------------------------------------------------------
+["gpt-5.2"]
+model_id = "gpt-5.2-2025-12-11"
+inputs = ["text", "images"]
+outputs = ["text", "structured"]
+costs = { input = 1.75, output = 14.0 }
+
+["gpt-5.2-chat"]
+model_id = "gpt-5.2-chat-2025-12-11"
+inputs = ["text", "images"]
+outputs = ["text", "structured"]
+costs = { input = 1.25, output = 10.0 }
+valued_constraints = { fixed_temperature = 1 }
+
################################################################################
# IMAGE GENERATION MODELS
################################################################################
@@ -146,4 +167,41 @@ model_type = "img_gen"
model_id = "gpt-image-1-2025-04-15"
inputs = ["text"]
outputs = ["image"]
-costs = { input = 0.04, output = 0.0 }
+costs = { input = 10, output = 40 }
+
+[gpt-image-1.rules]
+num_images = "gpt"
+aspect_ratio = "gpt"
+background = "gpt"
+inference = "gpt"
+safety_checker = "unavailable"
+
+[gpt-image-1-mini]
+sdk = "azure_rest_img_gen"
+model_type = "img_gen"
+model_id = "gpt-image-1-mini-2025-10-06"
+inputs = ["text"]
+outputs = ["image"]
+costs = { input = 2.5, output = 8 }
+
+[gpt-image-1-mini.rules]
+num_images = "gpt"
+aspect_ratio = "gpt"
+background = "gpt"
+inference = "gpt"
+safety_checker = "unavailable"
+
+["gpt-image-1.5"]
+sdk = "azure_rest_img_gen"
+model_type = "img_gen"
+model_id = "gpt-image-1.5-2025-12-16"
+inputs = ["text"]
+outputs = ["image"]
+costs = { input = 8, output = 32 }
+
+["gpt-image-1.5".rules]
+num_images = "gpt"
+aspect_ratio = "gpt"
+background = "gpt"
+inference = "gpt"
+safety_checker = "unavailable"
diff --git a/.pipelex/inference/backends/openai.toml b/.pipelex/inference/backends/openai.toml
index bfb3dd9ff..e61d52eb3 100644
--- a/.pipelex/inference/backends/openai.toml
+++ b/.pipelex/inference/backends/openai.toml
@@ -39,83 +39,72 @@ costs = { input = 0.5, output = 1.5 }
# --- GPT-4 Series -------------------------------------------------------------
[gpt-4]
-model_id = "gpt-4"
+inputs = ["text"]
+outputs = ["text"]
costs = { input = 30.0, output = 60.0 }
[gpt-4-turbo]
-model_id = "gpt-4-turbo"
inputs = ["text"]
outputs = ["text", "structured"]
costs = { input = 10.0, output = 30.0 }
# --- GPT-4o Series ------------------------------------------------------------
[gpt-4o-2024-11-20]
-model_id = "gpt-4o-2024-11-20"
inputs = ["text", "images"]
outputs = ["text", "structured"]
costs = { input = 2.5, output = 10.0 }
[gpt-4o]
-model_id = "gpt-4o"
inputs = ["text", "images"]
outputs = ["text", "structured"]
costs = { input = 2.5, output = 10.0 }
[gpt-4o-mini-2024-07-18]
-model_id = "gpt-4o-mini-2024-07-18"
inputs = ["text", "images"]
outputs = ["text", "structured"]
costs = { input = 0.15, output = 0.6 }
[gpt-4o-mini]
-model_id = "gpt-4o-mini"
inputs = ["text", "images"]
outputs = ["text", "structured"]
costs = { input = 0.15, output = 0.6 }
# --- GPT-4.1 Series -----------------------------------------------------------
["gpt-4.1"]
-model_id = "gpt-4.1"
inputs = ["text", "images"]
outputs = ["text", "structured"]
costs = { input = 2, output = 8 }
["gpt-4.1-mini"]
-model_id = "gpt-4.1-mini"
inputs = ["text", "images"]
outputs = ["text", "structured"]
costs = { input = 0.4, output = 1.6 }
["gpt-4.1-nano"]
-model_id = "gpt-4.1-nano"
inputs = ["text", "images"]
outputs = ["text", "structured"]
costs = { input = 0.1, output = 0.4 }
# --- o Series ----------------------------------------------------------------
[o1]
-model_id = "o1"
inputs = ["text", "images"]
outputs = ["text", "structured"]
costs = { input = 15.0, output = 60.0 }
valued_constraints = { fixed_temperature = 1 }
[o3-mini]
-model_id = "o3-mini"
inputs = ["text"]
outputs = ["text", "structured"]
costs = { input = 1.1, output = 4.4 }
valued_constraints = { fixed_temperature = 1 }
[o3]
-model_id = "o3"
inputs = ["text", "images"]
outputs = ["text", "structured"]
costs = { input = 10.0, output = 40.0 }
valued_constraints = { fixed_temperature = 1 }
[o4-mini]
-model_id = "o4-mini"
inputs = ["text"]
outputs = ["text", "structured"]
costs = { input = 1.1, output = 4.4 }
@@ -123,21 +112,18 @@ valued_constraints = { fixed_temperature = 1 }
# --- GPT-5 Series -------------------------------------------------------------
[gpt-5]
-model_id = "gpt-5"
inputs = ["text", "images"]
outputs = ["text", "structured"]
costs = { input = 1.25, output = 10.0 }
valued_constraints = { fixed_temperature = 1 }
[gpt-5-mini]
-model_id = "gpt-5-mini"
inputs = ["text", "images"]
outputs = ["text", "structured"]
costs = { input = 0.25, output = 2.0 }
valued_constraints = { fixed_temperature = 1 }
[gpt-5-nano]
-model_id = "gpt-5-nano"
inputs = ["text", "images"]
outputs = ["text", "structured"]
costs = { input = 0.05, output = 0.4 }
@@ -150,13 +136,50 @@ outputs = ["text"]
costs = { input = 1.25, output = 10.0 }
valued_constraints = { fixed_temperature = 1 }
+[gpt-5-codex]
+inputs = ["text", "images"]
+outputs = ["text", "structured"]
+costs = { input = 1.25, output = 10.0 }
+valued_constraints = { fixed_temperature = 1 }
+
# --- GPT-5.1 Series -------------------------------------------------------------
["gpt-5.1"]
-model_id = "gpt-5.1"
inputs = ["text", "images"]
outputs = ["text", "structured"]
costs = { input = 1.25, output = 10.0 }
+["gpt-5.1-chat"]
+model_id = "gpt-5.1-chat-latest"
+inputs = ["text", "images"]
+outputs = ["text", "structured"]
+costs = { input = 1.25, output = 10.0 }
+valued_constraints = { fixed_temperature = 1 }
+
+["gpt-5.1-codex"]
+inputs = ["text", "images"]
+outputs = ["text", "structured"]
+costs = { input = 1.25, output = 10.0 }
+valued_constraints = { fixed_temperature = 1 }
+
+["gpt-5.1-codex-max"]
+inputs = ["text", "images"]
+outputs = ["text", "structured"]
+costs = { input = 1.25, output = 10.0 }
+valued_constraints = { fixed_temperature = 1 }
+
+# --- GPT-5.2 Series -------------------------------------------------------------
+["gpt-5.2"]
+inputs = ["text", "images"]
+outputs = ["text", "structured"]
+costs = { input = 1.75, output = 14.0 }
+
+["gpt-5.2-chat"]
+model_id = "gpt-5.2-chat-latest"
+inputs = ["text", "images"]
+outputs = ["text", "structured"]
+costs = { input = 1.75, output = 14.0 }
+valued_constraints = { fixed_temperature = 1 }
+
################################################################################
# IMAGE GENERATION MODELS
################################################################################
@@ -165,7 +188,21 @@ costs = { input = 1.25, output = 10.0 }
[gpt-image-1]
sdk = "openai_img_gen"
model_type = "img_gen"
-model_id = "gpt-image-1"
inputs = ["text"]
outputs = ["image"]
-costs = { input = 0.04, output = 0.0 }
+costs = { input = 10, output = 40 }
+
+[gpt-image-1-mini]
+sdk = "openai_img_gen"
+model_type = "img_gen"
+inputs = ["text"]
+outputs = ["image"]
+costs = { input = 2.5, output = 8 }
+
+["gpt-image-1.5"]
+sdk = "openai_img_gen"
+model_type = "img_gen"
+model_id = "gpt-image-1.5"
+inputs = ["text"]
+outputs = ["image"]
+costs = { input = 8, output = 32 }
diff --git a/pipelex/kit/configs/inference/backends/azure_openai.toml b/pipelex/kit/configs/inference/backends/azure_openai.toml
index 35ccb4820..82d29b202 100644
--- a/pipelex/kit/configs/inference/backends/azure_openai.toml
+++ b/pipelex/kit/configs/inference/backends/azure_openai.toml
@@ -135,6 +135,27 @@ outputs = ["text", "structured"]
costs = { input = 1.25, output = 10.0 }
valued_constraints = { fixed_temperature = 1 }
+["gpt-5.1-codex"]
+model_id = "gpt-5.1-codex-2025-11-13"
+inputs = ["text", "images"]
+outputs = ["text", "structured"]
+costs = { input = 1.25, output = 10.0 }
+valued_constraints = { fixed_temperature = 1 }
+
+# --- GPT-5.2 Series -------------------------------------------------------------
+["gpt-5.2"]
+model_id = "gpt-5.2-2025-12-11"
+inputs = ["text", "images"]
+outputs = ["text", "structured"]
+costs = { input = 1.75, output = 14.0 }
+
+["gpt-5.2-chat"]
+model_id = "gpt-5.2-chat-2025-12-11"
+inputs = ["text", "images"]
+outputs = ["text", "structured"]
+costs = { input = 1.25, output = 10.0 }
+valued_constraints = { fixed_temperature = 1 }
+
################################################################################
# IMAGE GENERATION MODELS
################################################################################
@@ -146,4 +167,41 @@ model_type = "img_gen"
model_id = "gpt-image-1-2025-04-15"
inputs = ["text"]
outputs = ["image"]
-costs = { input = 0.04, output = 0.0 }
+costs = { input = 10, output = 40 }
+
+[gpt-image-1.rules]
+num_images = "gpt"
+aspect_ratio = "gpt"
+background = "gpt"
+inference = "gpt"
+safety_checker = "unavailable"
+
+[gpt-image-1-mini]
+sdk = "azure_rest_img_gen"
+model_type = "img_gen"
+model_id = "gpt-image-1-mini-2025-10-06"
+inputs = ["text"]
+outputs = ["image"]
+costs = { input = 2.5, output = 8 }
+
+[gpt-image-1-mini.rules]
+num_images = "gpt"
+aspect_ratio = "gpt"
+background = "gpt"
+inference = "gpt"
+safety_checker = "unavailable"
+
+["gpt-image-1.5"]
+sdk = "azure_rest_img_gen"
+model_type = "img_gen"
+model_id = "gpt-image-1.5-2025-12-16"
+inputs = ["text"]
+outputs = ["image"]
+costs = { input = 8, output = 32 }
+
+["gpt-image-1.5".rules]
+num_images = "gpt"
+aspect_ratio = "gpt"
+background = "gpt"
+inference = "gpt"
+safety_checker = "unavailable"
diff --git a/pipelex/kit/configs/inference/backends/openai.toml b/pipelex/kit/configs/inference/backends/openai.toml
index bfb3dd9ff..e61d52eb3 100644
--- a/pipelex/kit/configs/inference/backends/openai.toml
+++ b/pipelex/kit/configs/inference/backends/openai.toml
@@ -39,83 +39,72 @@ costs = { input = 0.5, output = 1.5 }
# --- GPT-4 Series -------------------------------------------------------------
[gpt-4]
-model_id = "gpt-4"
+inputs = ["text"]
+outputs = ["text"]
costs = { input = 30.0, output = 60.0 }
[gpt-4-turbo]
-model_id = "gpt-4-turbo"
inputs = ["text"]
outputs = ["text", "structured"]
costs = { input = 10.0, output = 30.0 }
# --- GPT-4o Series ------------------------------------------------------------
[gpt-4o-2024-11-20]
-model_id = "gpt-4o-2024-11-20"
inputs = ["text", "images"]
outputs = ["text", "structured"]
costs = { input = 2.5, output = 10.0 }
[gpt-4o]
-model_id = "gpt-4o"
inputs = ["text", "images"]
outputs = ["text", "structured"]
costs = { input = 2.5, output = 10.0 }
[gpt-4o-mini-2024-07-18]
-model_id = "gpt-4o-mini-2024-07-18"
inputs = ["text", "images"]
outputs = ["text", "structured"]
costs = { input = 0.15, output = 0.6 }
[gpt-4o-mini]
-model_id = "gpt-4o-mini"
inputs = ["text", "images"]
outputs = ["text", "structured"]
costs = { input = 0.15, output = 0.6 }
# --- GPT-4.1 Series -----------------------------------------------------------
["gpt-4.1"]
-model_id = "gpt-4.1"
inputs = ["text", "images"]
outputs = ["text", "structured"]
costs = { input = 2, output = 8 }
["gpt-4.1-mini"]
-model_id = "gpt-4.1-mini"
inputs = ["text", "images"]
outputs = ["text", "structured"]
costs = { input = 0.4, output = 1.6 }
["gpt-4.1-nano"]
-model_id = "gpt-4.1-nano"
inputs = ["text", "images"]
outputs = ["text", "structured"]
costs = { input = 0.1, output = 0.4 }
# --- o Series ----------------------------------------------------------------
[o1]
-model_id = "o1"
inputs = ["text", "images"]
outputs = ["text", "structured"]
costs = { input = 15.0, output = 60.0 }
valued_constraints = { fixed_temperature = 1 }
[o3-mini]
-model_id = "o3-mini"
inputs = ["text"]
outputs = ["text", "structured"]
costs = { input = 1.1, output = 4.4 }
valued_constraints = { fixed_temperature = 1 }
[o3]
-model_id = "o3"
inputs = ["text", "images"]
outputs = ["text", "structured"]
costs = { input = 10.0, output = 40.0 }
valued_constraints = { fixed_temperature = 1 }
[o4-mini]
-model_id = "o4-mini"
inputs = ["text"]
outputs = ["text", "structured"]
costs = { input = 1.1, output = 4.4 }
@@ -123,21 +112,18 @@ valued_constraints = { fixed_temperature = 1 }
# --- GPT-5 Series -------------------------------------------------------------
[gpt-5]
-model_id = "gpt-5"
inputs = ["text", "images"]
outputs = ["text", "structured"]
costs = { input = 1.25, output = 10.0 }
valued_constraints = { fixed_temperature = 1 }
[gpt-5-mini]
-model_id = "gpt-5-mini"
inputs = ["text", "images"]
outputs = ["text", "structured"]
costs = { input = 0.25, output = 2.0 }
valued_constraints = { fixed_temperature = 1 }
[gpt-5-nano]
-model_id = "gpt-5-nano"
inputs = ["text", "images"]
outputs = ["text", "structured"]
costs = { input = 0.05, output = 0.4 }
@@ -150,13 +136,50 @@ outputs = ["text"]
costs = { input = 1.25, output = 10.0 }
valued_constraints = { fixed_temperature = 1 }
+[gpt-5-codex]
+inputs = ["text", "images"]
+outputs = ["text", "structured"]
+costs = { input = 1.25, output = 10.0 }
+valued_constraints = { fixed_temperature = 1 }
+
# --- GPT-5.1 Series -------------------------------------------------------------
["gpt-5.1"]
-model_id = "gpt-5.1"
inputs = ["text", "images"]
outputs = ["text", "structured"]
costs = { input = 1.25, output = 10.0 }
+["gpt-5.1-chat"]
+model_id = "gpt-5.1-chat-latest"
+inputs = ["text", "images"]
+outputs = ["text", "structured"]
+costs = { input = 1.25, output = 10.0 }
+valued_constraints = { fixed_temperature = 1 }
+
+["gpt-5.1-codex"]
+inputs = ["text", "images"]
+outputs = ["text", "structured"]
+costs = { input = 1.25, output = 10.0 }
+valued_constraints = { fixed_temperature = 1 }
+
+["gpt-5.1-codex-max"]
+inputs = ["text", "images"]
+outputs = ["text", "structured"]
+costs = { input = 1.25, output = 10.0 }
+valued_constraints = { fixed_temperature = 1 }
+
+# --- GPT-5.2 Series -------------------------------------------------------------
+["gpt-5.2"]
+inputs = ["text", "images"]
+outputs = ["text", "structured"]
+costs = { input = 1.75, output = 14.0 }
+
+["gpt-5.2-chat"]
+model_id = "gpt-5.2-chat-latest"
+inputs = ["text", "images"]
+outputs = ["text", "structured"]
+costs = { input = 1.75, output = 14.0 }
+valued_constraints = { fixed_temperature = 1 }
+
################################################################################
# IMAGE GENERATION MODELS
################################################################################
@@ -165,7 +188,21 @@ costs = { input = 1.25, output = 10.0 }
[gpt-image-1]
sdk = "openai_img_gen"
model_type = "img_gen"
-model_id = "gpt-image-1"
inputs = ["text"]
outputs = ["image"]
-costs = { input = 0.04, output = 0.0 }
+costs = { input = 10, output = 40 }
+
+[gpt-image-1-mini]
+sdk = "openai_img_gen"
+model_type = "img_gen"
+inputs = ["text"]
+outputs = ["image"]
+costs = { input = 2.5, output = 8 }
+
+["gpt-image-1.5"]
+sdk = "openai_img_gen"
+model_type = "img_gen"
+model_id = "gpt-image-1.5"
+inputs = ["text"]
+outputs = ["image"]
+costs = { input = 8, output = 32 }
diff --git a/pipelex/plugins/azure_rest/azure_img_gen_factory.py b/pipelex/plugins/azure_rest/azure_img_gen_factory.py
deleted file mode 100644
index 49e79586a..000000000
--- a/pipelex/plugins/azure_rest/azure_img_gen_factory.py
+++ /dev/null
@@ -1,49 +0,0 @@
-from pipelex.cogt.exceptions import ImgGenParameterError
-from pipelex.cogt.img_gen.img_gen_job_components import AspectRatio, OutputFormat
-from pipelex.types import StrEnum
-
-
-class AzureSize(StrEnum):
- SQUARE = "1024x1024"
- LANDSCAPE_3_2 = "1536x1024"
- PORTRAIT_2_3 = "1024x1536"
-
-
-class AzureOutputFormat(StrEnum):
- PNG = "png"
- JPEG = "jpeg"
- WEBP = "webp"
-
-
-class AzureImgGenFactory:
- @classmethod
- def image_size_for_azure(cls, aspect_ratio: AspectRatio) -> tuple[AzureSize, int, int]:
- """Convert our aspect ratio to Azure image size format."""
- match aspect_ratio:
- case AspectRatio.SQUARE:
- return AzureSize.SQUARE, 1024, 1024
- case AspectRatio.LANDSCAPE_3_2:
- return AzureSize.LANDSCAPE_3_2, 1536, 1024
- case AspectRatio.PORTRAIT_2_3:
- return AzureSize.PORTRAIT_2_3, 1024, 1536
- case (
- AspectRatio.LANDSCAPE_4_3
- | AspectRatio.LANDSCAPE_16_9
- | AspectRatio.LANDSCAPE_21_9
- | AspectRatio.PORTRAIT_3_4
- | AspectRatio.PORTRAIT_9_16
- | AspectRatio.PORTRAIT_9_21
- ):
- msg = f"Aspect ratio '{aspect_ratio}' is not supported by Azure GPT Image model"
- raise ImgGenParameterError(msg)
-
- @classmethod
- def output_format_for_azure(cls, output_format: OutputFormat) -> AzureOutputFormat:
- """Convert our output format to Azure format."""
- match output_format:
- case OutputFormat.PNG:
- return AzureOutputFormat.PNG
- case OutputFormat.JPG:
- return AzureOutputFormat.JPEG
- case OutputFormat.WEBP:
- return AzureOutputFormat.WEBP
diff --git a/pipelex/plugins/azure_rest/azure_img_gen_worker.py b/pipelex/plugins/azure_rest/azure_img_gen_worker.py
index ee61343ee..c6b1dd077 100644
--- a/pipelex/plugins/azure_rest/azure_img_gen_worker.py
+++ b/pipelex/plugins/azure_rest/azure_img_gen_worker.py
@@ -1,26 +1,23 @@
import httpx
from typing_extensions import override
-from pipelex.cogt.exceptions import CogtError
+from pipelex.cogt.exceptions import CogtError, ImgGenGenerationError, ImgGenParameterError
from pipelex.cogt.image.generated_image import GeneratedImage
+from pipelex.cogt.img_gen.img_gen_args_factory import ImgGenArgsFactory
from pipelex.cogt.img_gen.img_gen_job import ImgGenJob
from pipelex.cogt.img_gen.img_gen_worker_abstract import ImgGenWorkerAbstract
from pipelex.cogt.model_backends.model_spec import InferenceModelSpec
from pipelex.hub import get_models_manager
-from pipelex.plugins.azure_rest.azure_img_gen_factory import AzureImgGenFactory
from pipelex.plugins.plugin import Plugin
from pipelex.reporting.reporting_protocol import ReportingProtocol
from pipelex.system.exceptions import CredentialsError
+from pipelex.tools.misc.base_64_utils import prefixed_base64_str_from_base64_str
class AzureCredentialsError(CredentialsError):
pass
-class AzureImgGenConfigError(CogtError):
- pass
-
-
class AzureImgGenWorker(ImgGenWorkerAbstract):
def __init__(
self,
@@ -69,14 +66,17 @@ class AzureImgGenWorker(ImgGenWorkerAbstract):
img_gen_job: ImgGenJob,
nb_images: int,
) -> list[GeneratedImage]:
- """Generate multiple images using Azure OpenAI Image API."""
- # Extract parameters from the job
- img_gen_prompt_text = img_gen_job.img_gen_prompt.positive_text
- job_params = img_gen_job.job_params
+ if self.inference_model.rules is None:
+ msg = f"Model '{self.inference_model.name}' does not have rules configured"
+ raise ImgGenParameterError(msg)
+
+ args_dict = ImgGenArgsFactory.make_args_for_model(
+ model_rules=self.inference_model.rules,
+ img_gen_job=img_gen_job,
+ nb_images=nb_images,
+ )
- # Convert parameters to Azure format
- size, width, height = AzureImgGenFactory.image_size_for_azure(job_params.aspect_ratio)
- output_format = AzureImgGenFactory.output_format_for_azure(job_params.output_format)
+ args_dict["prompt"] = img_gen_job.img_gen_prompt.positive_text
# Get deployment name (model_id from the inference model)
deployment = self.inference_model.model_id
@@ -86,17 +86,6 @@ class AzureImgGenWorker(ImgGenWorkerAbstract):
params = f"?api-version={self.api_version}"
generation_url = f"{self.endpoint}/{base_path}/generations{params}"
- # Build the request body
- generation_body = {
- "prompt": img_gen_prompt_text,
- "n": nb_images,
- "size": size,
- "background": job_params.background,
- "quality": job_params.quality,
- "output_format": output_format,
- }
-
- # Make the async HTTP request
async with httpx.AsyncClient() as client:
response = await client.post(
generation_url,
@@ -104,28 +93,40 @@ class AzureImgGenWorker(ImgGenWorkerAbstract):
"Api-Key": self.api_key,
"Content-Type": "application/json",
},
- json=generation_body,
+ json=args_dict,
timeout=180.0,
)
response.raise_for_status()
- response_data = response.json()
+ response_dict = response.json()
- # Parse the response and create GeneratedImage objects
generated_images: list[GeneratedImage] = []
-
- for item in response_data["data"]:
- # Get base64 image data
- b64_data = item["b64_json"]
-
- # Create data URI for the image (keeps it in memory)
- data_uri = f"data:image/{output_format};base64,{b64_data}"
-
- generated_images.append(
- GeneratedImage(
- url=data_uri,
- width=width,
- height=height,
+ if images := response_dict.get("data"):
+ size = response_dict.get("size")
+ if not isinstance(size, str):
+ msg = f"Size from img gen response is not a string: '{size}'"
+ raise ImgGenGenerationError(msg)
+ size_split = size.split("x")
+ if len(size_split) != 2:
+ msg = f"Size from img gen response is not a valid size: '{size}'"
+ raise ImgGenGenerationError(msg)
+ width_str, height_str = size_split
+ width = int(width_str)
+ height = int(height_str)
+ for image in images:
+ b64_str = image.get("b64_json")
+ if not isinstance(b64_str, str):
+ msg = f"No base64 image data received from model '{self.inference_model.model_id}'"
+ raise ImgGenGenerationError(msg)
+ base64_url = prefixed_base64_str_from_base64_str(b64_str=b64_str)
+ generated_images.append(
+ GeneratedImage(
+ url=base64_url,
+ width=width,
+ height=height,
+ ),
)
- )
+ else:
+ msg = f"Unexpected response from model '{self.inference_model.model_id}' has no 'data' or 'images' key"
+ raise ImgGenGenerationError(msg)
return generated_images
diff --git a/tests/integration/pipelex/cogt/test_extract.py b/tests/integration/pipelex/cogt/test_extract.py
index a0096b273..cb43429e2 100644
--- a/tests/integration/pipelex/cogt/test_extract.py
+++ b/tests/integration/pipelex/cogt/test_extract.py
@@ -91,7 +91,7 @@ class TestExtract:
extract_output = await extract_worker.extract_pages(extract_job=extract_job)
pretty_print(extract_output, title="Extract Output")
directory = get_incremental_directory_path(
- base_path="results/test_ocr_image_save",
+ base_path="results/test_ocr_result_save",
base_name="extract_output",
)
extract_output.save_to_directory(
diff --git a/tests/integration/pipelex/cogt/test_img_gen.py b/tests/integration/pipelex/cogt/test_img_gen.py
index d8d89c5ce..bdced6f6c 100644
--- a/tests/integration/pipelex/cogt/test_img_gen.py
+++ b/tests/integration/pipelex/cogt/test_img_gen.py
@@ -14,7 +14,7 @@ from tests.integration.pipelex.test_data import ImageGenTestCases
@pytest.mark.usefixtures("routing_profile_override")
class TestImageGeneration:
@pytest.mark.parametrize(("topic", "img_gen_prompt_text"), ImageGenTestCases.IMAGE_DESC)
- async def test_img_gen_opaque(self, img_gen_handle: str, img_gen_job_params: ImgGenJobParams, topic: str, img_gen_prompt_text: str):
+ async def test_img_gen_single_opaque(self, img_gen_handle: str, img_gen_job_params: ImgGenJobParams, topic: str, img_gen_prompt_text: str):
img_gen_worker_async = get_img_gen_worker(img_gen_handle=img_gen_handle)
img_gen_job = ImgGenJobFactory.make_img_gen_job_from_prompt_contents(
positive_text=img_gen_prompt_text,
@@ -30,7 +30,7 @@ class TestImageGeneration:
pretty_print(generated_image.url, title="Image URL")
@pytest.mark.parametrize(("topic", "img_gen_prompt_text"), ImageGenTestCases.IMAGE_DESC)
- async def test_img_gen_transparent(self, img_gen_handle: str, topic: str, img_gen_prompt_text: str):
+ async def test_img_gen_single_transparent(self, img_gen_handle: str, topic: str, img_gen_prompt_text: str):
img_gen_worker_async = get_img_gen_worker(img_gen_handle=img_gen_handle)
img_gen_job_params = ImgGenJobParams(
aspect_ratio=AspectRatio.SQUARE,
diff --git a/tests/integration/pipelex/fixtures/img_gen_fixtures.py b/tests/integration/pipelex/fixtures/img_gen_fixtures.py
index fee5d807c..7ed18c122 100644
--- a/tests/integration/pipelex/fixtures/img_gen_fixtures.py
+++ b/tests/integration/pipelex/fixtures/img_gen_fixtures.py
@@ -39,6 +39,8 @@ FAL_IMG_GEN_MODELS = [
# --- OpenAI Models ------------------------------------------------------------------------------
OPENAI_IMG_GEN_MODELS = [
"gpt-image-1",
+ "gpt-image-1-mini",
+ "gpt-image-1.5",
]
# --- Google Models --------------------------------------------------------------------------
diff --git a/tests/integration/pipelex/fixtures/llm_fixtures.py b/tests/integration/pipelex/fixtures/llm_fixtures.py
index 505bd354d..85ef83d01 100644
--- a/tests/integration/pipelex/fixtures/llm_fixtures.py
+++ b/tests/integration/pipelex/fixtures/llm_fixtures.py
@@ -142,9 +142,13 @@ OPENAI_MODELS = [
"gpt-5-mini",
"gpt-5-chat",
"gpt-5",
+ "gpt-5-codex",
+ "gpt-5.1-codex",
+ "gpt-5.1-codex-max",
"gpt-5.1-chat",
"gpt-5.1",
- "gpt-5.1-codex",
+ "gpt-5.2",
+ "gpt-5.2-chat",
]
# --- OpenAI OSS Models --------------------------------------------------------------------------