Skip to content

Conversation

@iBotPeaches
Copy link
Collaborator

What:

  • Bug Fix
  • New Feature

Description:

Types responses from Responses API that contain image_generation tool usage.

Related:

fixes: #585

@iBotPeaches iBotPeaches requested a review from Copilot June 2, 2025 22:03
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Add support for the image_generation tool in response parsing, serialization, and fixtures

  • Introduces ImageGenerationTool and ImageGenerationInputImageMask classes with parsing and toArray() implementations
  • Updates CreateResponse and RetrieveResponse to recognize the new tool type
  • Adds fixtures and tests for toolImageGeneration() and adjusts existing test expectations

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/Responses/Responses/Tool/ImageGenerationTool.php Add tests for parsing/serializing the image_generation tool
tests/Responses/Responses/RetrieveResponse.php Update expected tool count to include the new image generation
tests/Fixtures/Responses.php Add toolImageGeneration() fixture and include it in responses
src/Responses/Responses/Tool/ImageGenerationTool.php Implement ImageGenerationTool::from() and toArray()
src/Responses/Responses/Tool/ImageGenerationInputImageMask.php Implement ImageGenerationInputImageMask::from() and toArray()
src/Responses/Responses/RetrieveResponse.php Register ImageGenerationTool in parsing and serialization
src/Responses/Responses/CreateResponse.php Register ImageGenerationTool in parsing and serialization
Comments suppressed due to low confidence (1)

tests/Responses/Responses/CreateResponse.php:32

  • The CreateResponse test still expects only 2 tools; update this to ->toHaveCount(3) so it covers the newly added image_generation tool.
->tools->toHaveCount(2)

@iBotPeaches iBotPeaches added this to the v0.13.1 milestone Jun 3, 2025
@iBotPeaches iBotPeaches merged commit 4f95624 into main Jun 3, 2025
24 checks passed
@iBotPeaches iBotPeaches deleted the responses-image-generation branch June 9, 2025 21:26
@iBotPeaches iBotPeaches added the enhancement New feature or request label Jun 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Responses] Support Image Generation Tool

2 participants