Class ImageGenStreamEvent
-
- All Implemented Interfaces:
public final class ImageGenStreamEventEmitted when a partial image is available during image generation streaming.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public interfaceImageGenStreamEvent.VisitorAn interface that defines how to map each variant of ImageGenStreamEvent to a value of type T.
-
Method Summary
Modifier and Type Method Description final Optional<ImageGenPartialImageEvent>generationPartialImage()Emitted when a partial image is available during image generation streaming. final Optional<ImageGenCompletedEvent>generationCompleted()Emitted when image generation has completed and the final image is available. final BooleanisGenerationPartialImage()final BooleanisGenerationCompleted()final ImageGenPartialImageEventasGenerationPartialImage()Emitted when a partial image is available during image generation streaming. final ImageGenCompletedEventasGenerationCompleted()Emitted when image generation has completed and the final image is available. final Optional<JsonValue>_json()final <T extends Any> Taccept(ImageGenStreamEvent.Visitor<T> visitor)Maps this instance's current variant to a value of type T using the given visitor. final ImageGenStreamEventvalidate()Validates that the types of all values in this object match their expected types recursively. final BooleanisValid()Booleanequals(Object other)IntegerhashCode()StringtoString()final static ImageGenStreamEventofGenerationPartialImage(ImageGenPartialImageEvent generationPartialImage)Emitted when a partial image is available during image generation streaming. final static ImageGenStreamEventofGenerationCompleted(ImageGenCompletedEvent generationCompleted)Emitted when image generation has completed and the final image is available. -
-
Method Detail
-
generationPartialImage
final Optional<ImageGenPartialImageEvent> generationPartialImage()
Emitted when a partial image is available during image generation streaming.
-
generationCompleted
final Optional<ImageGenCompletedEvent> generationCompleted()
Emitted when image generation has completed and the final image is available.
-
isGenerationPartialImage
final Boolean isGenerationPartialImage()
-
isGenerationCompleted
final Boolean isGenerationCompleted()
-
asGenerationPartialImage
final ImageGenPartialImageEvent asGenerationPartialImage()
Emitted when a partial image is available during image generation streaming.
-
asGenerationCompleted
final ImageGenCompletedEvent asGenerationCompleted()
Emitted when image generation has completed and the final image is available.
-
accept
final <T extends Any> T accept(ImageGenStreamEvent.Visitor<T> visitor)
Maps this instance's current variant to a value of type T using the given visitor.
Note that this method is not forwards compatible with new variants from the API, unless visitor overrides Visitor.unknown. To handle variants not known to this version of the SDK gracefully, consider overriding Visitor.unknown:
import com.openai.core.JsonValue; import java.util.Optional; Optional<String> result = imageGenStreamEvent.accept(new ImageGenStreamEvent.Visitor<Optional<String>>() { @Override public Optional<String> visitGenerationPartialImage(ImageGenPartialImageEvent generationPartialImage) { return Optional.of(generationPartialImage.toString()); } // ... @Override public Optional<String> unknown(JsonValue json) { // Or inspect the `json`. return Optional.empty(); } });
-
validate
final ImageGenStreamEvent validate()
Validates that the types of all values in this object match their expected types recursively.
This method is not forwards compatible with new types from the API for existing fields.
-
ofGenerationPartialImage
final static ImageGenStreamEvent ofGenerationPartialImage(ImageGenPartialImageEvent generationPartialImage)
Emitted when a partial image is available during image generation streaming.
-
ofGenerationCompleted
final static ImageGenStreamEvent ofGenerationCompleted(ImageGenCompletedEvent generationCompleted)
Emitted when image generation has completed and the final image is available.
-
-
-
-