Skip to content

Update image generation parameters and usage tracking #722

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

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

kayhantolga
Copy link
Member

Modified ImageTestHelper to adjust parameters for the CreateImage method, setting the model to "gpt-image-1" and changing the size to Size256.

Added a new Usage property in ImageCreateResponse to track token usage, along with a nested UsageModel class that includes total, input, and output token counts. Introduced InputTokensDetailsModel for detailed input token tracking.

Modified `ImageTestHelper` to adjust parameters for the `CreateImage` method, setting the model to "gpt-image-1" and changing the size to `Size256`.

Added a new `Usage` property in `ImageCreateResponse` to track token usage, along with a nested `UsageModel` class that includes total, input, and output token counts. Introduced `InputTokensDetailsModel` for detailed input token tracking.
@kayhantolga kayhantolga requested a review from Copilot June 5, 2025 17:38
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

This PR updates the image generation parameters and adds token usage tracking for the "gpt-image-1" image model. Key changes include updating the model and image size in the image creation test and introducing new usage tracking classes in the response model.

Reviewed Changes

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

File Description
OpenAI.SDK/ObjectModels/ResponseModels/ImageResponseModel/ImageCreateResponse.cs Added a Usage property with associated UsageModel and InputTokensDetailsModel classes to capture detailed token usage.
OpenAI.Playground/TestHelpers/ImageTestHelper.cs Modified the image creation test to use model "gpt-image-1" and a size adjustment from Size1024 to Size256, with a commented-out ResponseFormat property.
Comments suppressed due to low confidence (1)

OpenAI.SDK/ObjectModels/ResponseModels/ImageResponseModel/ImageCreateResponse.cs:16

  • [nitpick] Consider consolidating the duplicated documentation for token usage information between the property and the UsageModel class to reduce redundancy.
///     For <c>gpt-image-1</c> only, the token usage information for the image generation.

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.

1 participant