From 25f04f27d086d66da3bb556180b8497bd49a7730 Mon Sep 17 00:00:00 2001 From: Jack Quincy Date: Fri, 23 Oct 2026 11:04:01 -0700 Subject: [PATCH] INF-2366: update image generation examples to GPT Image 2 --- README.md | 2 +- examples/inference/image_generation.py | 2 +- tests/integration/test_inference.py | 2 +- tests/mocked/test_inference.py | 8 ++++---- tests/mocked/test_inference_namespace.py | 2 +- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index f7cb4fc0..648cbeb0 100644 --- a/README.md +++ b/README.md @@ -180,7 +180,7 @@ from pydo.inference import Client client = Client(token=os.environ["DIGITALOCEAN_TOKEN"]) # PAT with full access scope result = client.images.generate( - model="openai-gpt-image-1", + model="openai-gpt-image-2", prompt="A friendly cartoon shark typing on a laptop at a sunny beach", n=1, ) diff --git a/examples/inference/image_generation.py b/examples/inference/image_generation.py index b9120184..f99049a9 100644 --- a/examples/inference/image_generation.py +++ b/examples/inference/image_generation.py @@ -19,7 +19,7 @@ def main() -> None: client = Client(token=os.environ["DIGITALOCEAN_TOKEN"]) result = client.images.generate( - model="openai-gpt-image-1", + model="openai-gpt-image-2", prompt="A friendly shark typing on a laptop at a sunny beach", n=1, ) diff --git a/tests/integration/test_inference.py b/tests/integration/test_inference.py index c46176f4..114bf790 100644 --- a/tests/integration/test_inference.py +++ b/tests/integration/test_inference.py @@ -182,7 +182,7 @@ class TestImagesGenerate: @pytest.mark.real_billing def test_images_generate(self, inference_client): resp = inference_client.images.generate( - model="openai-gpt-image-1", + model="openai-gpt-image-2", prompt="A simple red circle on white background", n=1, ) diff --git a/tests/mocked/test_inference.py b/tests/mocked/test_inference.py index b182b16c..9540c7b4 100644 --- a/tests/mocked/test_inference.py +++ b/tests/mocked/test_inference.py @@ -220,7 +220,7 @@ def test_models_list(mock_client: Client, mock_client_url): "owned_by": "minimax", }, { - "id": "openai-gpt-image-1", + "id": "openai-gpt-image-2", "object": "model", "created": 1699000200, "owned_by": "openai", @@ -292,7 +292,7 @@ def test_images_generate(mock_client: Client, mock_client_url): ) resp = mock_client.images.generate( - model="openai-gpt-image-1", + model="openai-gpt-image-2", prompt="A futuristic cityscape at sunset", n=1, ) @@ -327,7 +327,7 @@ def test_images_generate_multiple(mock_client: Client, mock_client_url): ) resp = mock_client.images.generate( - model="openai-gpt-image-1", + model="openai-gpt-image-2", prompt="A red rose", n=2, ) @@ -850,7 +850,7 @@ def test_images_generate_422(mock_client: Client, mock_client_url): with pytest.raises(Exception, match="Invalid prompt"): mock_client.images.generate( - model="openai-gpt-image-1", + model="openai-gpt-image-2", prompt="", ) diff --git a/tests/mocked/test_inference_namespace.py b/tests/mocked/test_inference_namespace.py index 82b3d98e..750a1fca 100644 --- a/tests/mocked/test_inference_namespace.py +++ b/tests/mocked/test_inference_namespace.py @@ -181,7 +181,7 @@ def test_namespace_images_generate(): status=200, ) - resp = client.images.generate(model="openai-gpt-image-1", prompt="A sunset", n=1) + resp = client.images.generate(model="openai-gpt-image-2", prompt="A sunset", n=1) assert resp.data[0].b64_json == "abc=="