Class Images<R extends bg.codexio.ai.openai.api.payload.images.request.ImageRequest>
java.lang.Object
bg.codexio.ai.openai.api.sdk.images.Images<R>
public final class Images<R extends bg.codexio.ai.openai.api.payload.images.request.ImageRequest>
extends Object
Entrypoint for Images API, supporting
Creating,
Editing/a>,
and
Variating.
The interaction starts by configuring the HTTP connection
either by providing a preconfigured http client -
Further configuration happens on multiple bypassable stages, whatever is important for specific needs.
The interaction starts by configuring the HTTP connection
either by providing a preconfigured http client -
CreateImageHttpExecutor, EditImageHttpExecutor and
ImageVariationHttpExecutor respectively,HttpExecutorContext, SdkAuth or leave it to
defaults(). Further configuration happens on multiple bypassable stages, whatever is important for specific needs.
-
Method Summary
Modifier and TypeMethodDescriptionstatic <R extends bg.codexio.ai.openai.api.payload.images.request.ImageRequest>
HttpBuilder<ActionTypeStage<R>> authenticate(HttpExecutorContext context) static <R extends bg.codexio.ai.openai.api.payload.images.request.ImageRequest>
HttpBuilder<ActionTypeStage<R>> authenticate(SdkAuth auth) Authenticates against OpenAI API with an implementation ofSdkAuth.static <R extends bg.codexio.ai.openai.api.payload.images.request.ImageRequest>
HttpBuilder<ActionTypeStage<R>> defaults()Authenticates against OpenAPI with the first success fromFromEnvironmentandFromJson
authentication methods.static <R extends bg.codexio.ai.openai.api.payload.images.request.ImageRequest>
SimplifiedStage<bg.codexio.ai.openai.api.payload.images.request.CreateImageRequest, PromptfulImagesRuntimeSelectionStage<bg.codexio.ai.openai.api.payload.images.request.CreateImageRequest>> simply()Authenticates against OpenAPI with the first success fromFromEnvironmentandFromJson
authentication methods.static <R extends bg.codexio.ai.openai.api.payload.images.request.ImageRequest>
SimplifiedStage<R, PromptfulImagesRuntimeSelectionStage<bg.codexio.ai.openai.api.payload.images.request.CreateImageRequest>> Authenticates against OpenAI API with an implementation ofSdkAuthand preconfigures simpleDallE30powered instance for creating images.static CreatingActionTypeStagethroughHttp(CreateImageHttpExecutor createExecutor) static EditingActionTypeStagethroughHttp(EditImageHttpExecutor editExecutor) static VariatingActionTypeStagethroughHttp(ImageVariationHttpExecutor variationExecutor)
-
Method Details
-
throughHttp
- Parameters:
createExecutor- ConfiguredCreateImageHttpExecutorwith manually setHttpExecutorContext,OkHttpClientand/orObjectMapper.- Returns:
CreatingActionTypeStageto mark the only possible action in this case - creating
-
throughHttp
- Parameters:
editExecutor- ConfiguredEditImageHttpExecutorwith manually setHttpExecutorContext,OkHttpClientand/orObjectMapper.- Returns:
EditingActionTypeStageto mark the only possible action - editing in this case
-
throughHttp
- Parameters:
variationExecutor- ConfiguredImageVariationHttpExecutorwith manually setHttpExecutorContext,OkHttpClientand/orObjectMapper.- Returns:
VariatingActionTypeStageto to mark the only possible action in this case - variating
-
authenticate
public static <R extends bg.codexio.ai.openai.api.payload.images.request.ImageRequest> HttpBuilder<ActionTypeStage<R>> authenticate(HttpExecutorContext context) Authenticates against OpenAI API with manually supplied
ApiCredentialsandHttpTimeouts. Mostly used if credentials
are fetched from external source.- Parameters:
context-HttpExecutorContext- Returns:
HttpBuilder<ActionTypeStage>so timeouts can be reconfigured and possiblyObjectMapperis supplied.
-
authenticate
public static <R extends bg.codexio.ai.openai.api.payload.images.request.ImageRequest> HttpBuilder<ActionTypeStage<R>> authenticate(SdkAuth auth) Authenticates against OpenAI API with an implementation ofSdkAuth.- Parameters:
auth- of typeSdkAuth
Allows you to choose from one of the default authentication methods
Options:FromDeveloper,FromJson,FromEnvironment- Returns:
HttpBuilder<ActionTypeStage>so timeouts can be reconfigured and possiblyObjectMapperis supplied.
-
simply
public static <R extends bg.codexio.ai.openai.api.payload.images.request.ImageRequest> SimplifiedStage<R,PromptfulImagesRuntimeSelectionStage<bg.codexio.ai.openai.api.payload.images.request.CreateImageRequest>> simply(SdkAuth auth) Authenticates against OpenAI API with an implementation ofSdkAuthand preconfigures simpleDallE30powered instance for creating images.- Parameters:
auth- of typeSdkAuth
Allows you to choose from one of the default authentication methods
Options:FromDeveloper,FromJson,FromEnvironment- Returns:
ImmediateContextStage
-
simply
public static <R extends bg.codexio.ai.openai.api.payload.images.request.ImageRequest> SimplifiedStage<bg.codexio.ai.openai.api.payload.images.request.CreateImageRequest,PromptfulImagesRuntimeSelectionStage<bg.codexio.ai.openai.api.payload.images.request.CreateImageRequest>> simply()Authenticates against OpenAPI with the first success fromFromEnvironmentandFromJson
authentication methods. Preconfigures simpleDallE30powered instance for creating images.- Returns:
ImmediateContextStage
-
defaults
public static <R extends bg.codexio.ai.openai.api.payload.images.request.ImageRequest> HttpBuilder<ActionTypeStage<R>> defaults()Authenticates against OpenAPI with the first success fromFromEnvironmentandFromJson
authentication methods. All other configurations can be manually customized- Returns:
HttpBuilder<ActionTypeStage>so timeouts can be reconfigured and possiblyObjectMapperis supplied.
-