Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

feat(OpenAI) - Add support for Image Generation Tool (Responses) #594

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 3, 2025

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 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Responses] Support Image Generation Tool
1 participant
Morty Proxy This is a proxified and sanitized view of the page, visit original site.