fix(openai): support image edit accounting and task image responses#2266
Open
Brisbanehuang wants to merge 2 commits intoWei-Shaw:mainfrom
Open
fix(openai): support image edit accounting and task image responses#2266Brisbanehuang wants to merge 2 commits intoWei-Shaw:mainfrom
Brisbanehuang wants to merge 2 commits intoWei-Shaw:mainfrom
Conversation
Contributor
|
All contributors have signed the CLA. ✅ |
Author
|
I have read the CLA Document and I hereby sign the CLA |
Author
|
recheck |
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.
Summary
image_edit.completedSSE events as completed image outputs while continuing to ignore partial edit image events./v1/images/generations: detecttask_id, poll/v1/tasks/{task_id}, download final image URLs, and convert them back to OpenAI Images-compatibleb64_jsonresponses.image_edit.completedaccounting and task-based image generation results.This helps with providers such as APIMart whose
gpt-image-2generation endpoint returns a task object first, with final images available through the task status endpoint. Docs: https://docs.apimart.ai/cn/api-reference/images/gpt-image-2/generationTests
go test ./internal/service -run 'TestOpenAIImageOutputCounter|TestOpenAIGatewayServiceForwardImages_APIKeyGenerationPollsTaskResult|TestOpenAIGatewayServiceForwardImages_APIKeyGenerationUsesConfiguredV1BaseURL|TestOpenAIGatewayServiceForwardImages_APIKeyStreamJSONResponseBillsImage'\n-go test ./internal/service\n