Add missing fields to OutputImageGenerationToolCall#742
Merged
iBotPeaches merged 2 commits intoopenai-php:mainfrom Feb 25, 2026
Merged
Add missing fields to OutputImageGenerationToolCall#742iBotPeaches merged 2 commits intoopenai-php:mainfrom
OutputImageGenerationToolCall#742iBotPeaches merged 2 commits intoopenai-php:mainfrom
Conversation
Add missing fields (`action`, `background`, `output_format`, `quality`, `revised_prompt`, `size`) to `OutputImageGenerationToolCall` (available via the official Python SDK).
Example Request:
```python3
import openai
response = openai.responses.create(
model="gpt-5",
input="Generate an image of gray tabby cat hugging an otter with an orange scarf",
tools=[{"type": "image_generation"}],
)
image_generation_call = next(output for output in response.output if output.type == "image_generation_call")
print(image_generation_call)
```
Example Response:
```python3
ImageGenerationCall(
id='ig_123',
result='...',
status='completed',
type='image_generation_call',
action='generate',
background='opaque',
output_format='webp',
quality='high',
revised_prompt='A gray tabby cat hugging an otter. The otter is wearing an orange scarf. Both animals are cute and friendly, depicted in a warm, heartwarming style.',
size='1536x1024'
)
```
Collaborator
|
Could we augment a test and assert on these new properties? |
8ab23d1 to
ca4434a
Compare
Collaborator
|
thanks! This looks good, I'll run a quick sample with my test code to confirm before merging. I think I could probably replicate this with my stream image response test - https://github.com/iBotPeaches/openai-php-laravel-test/blob/master/app/Console/Commands/ResponsesStreamImageGenerationTest.php |
iBotPeaches
approved these changes
Feb 25, 2026
Collaborator
iBotPeaches
left a comment
There was a problem hiding this comment.
MIRMokNFiAEYBEiBQgEYAnZCGy72QapYGElpI1tSSFZSDISQsKACbCFwZAhC2xIA9hGkGBJpgQWBiSTGMBEkRIZDJKFExGYRAIkwGDkBka2hDFI\/wiQ0TTXPI5WGgAAAABJRU5ErkJggg==","status":"generating","type":"image_generation_call","action":"generate","background":"opaque","output_format":"png","quality":"low","revised_prompt":"A simple black dot on a white background","size":"1024x1024"},{"content":[{"annotations":[],"text":"Here is a simple black dot on a white background. Let me know if you need any changes!","type":"output_text"}],"id":"msg_01a62a0054dc69db00699f20a0a1c48199bc2581a676d75a24","role":"assistant","status":"completed","type":"message"}],"parallel_tool_calls":true,"previous_response_id":null,"prompt":null,"prompt_cache_key":null,"safety_identifier":null,"service_tier":"default","reasoning":{"effort":null,"generate_summary":null,"summary":null},"store":true,"temperature":1,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[{"type":"image_generation","background":"auto","input_image_mask":null,"model":"gpt-image-1","moderation":"auto","output_compression":100,"output_format":"png","partial_images":0,"quality":"low","size":"1024x1024"}],"top_logprobs":0,"top_p":1,"truncation":"disabled","usage":{"input_tokens":3624,"input_tokens_details":{"cached_tokens":0},"output_tokens":45,"output_tokens_details":{"reasoning_tokens":0},"total_tokens":3669},"user":null,"verbosity":null,"output_text":"Here is a simple black dot on a white background. Let me know if you need any changes!"},"sequence_number":33}}" // app/Console/Commands/ResponsesStreamImageGenerationTest.php:30
Confirmed working with a real test.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What:
Description:
Add missing fields (
action,background,output_format,quality,revised_prompt,size) toOutputImageGenerationToolCall(available in the official Python SDK).Example Request:
Example Response: