Add image streaming support#720
Merged
Merged
Conversation
045e202 to
84dc091
Compare
Collaborator
|
This looks really nice and passes everything. Have a sample code snippet I can use to test this for real? I want to add a new sample to my tests - https://github.com/iBotPeaches/openai-php-laravel-test/blob/master/app/Console/Commands/ImageTest.php |
Contributor
Author
$prompt = 'Blend these two images';
$image1 = fopen('image1.png', 'r');
$image2 = fopen('image2.png', 'r');
$stream = OpenAI::images()->editStreamed([
'model' => 'gpt-image-1',
'prompt' => $prompt,
'image' => [
$image1,
$image2,
],
'partial_images' => 2,
]);
foreach ($stream as $event) {
$item = $event->toArray();
... // Return SSE's for example
} |
iBotPeaches
approved these changes
Dec 4, 2025
Collaborator
iBotPeaches
left a comment
There was a problem hiding this comment.
Reviewed and looks good. Confirmed with real life test here - iBotPeaches/openai-php-laravel-test@66a55e5
Collaborator
|
thanks! |
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:
Adds image streaming support: https://platform.openai.com/docs/api-reference/images-streaming
Related: