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 -CreateImageHttpExecutor,EditImageHttpExecutorandImageVariationHttpExecutorrespectively,
HttpExecutorContext,SdkAuthor leave it todefaults().
Further configuration happens on multiple bypassable stages, whatever is important for specific needs.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <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>>simply(SdkAuth auth)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 Detail
-
throughHttp
public static CreatingActionTypeStage throughHttp(CreateImageHttpExecutor createExecutor)
- Parameters:
createExecutor- ConfiguredCreateImageHttpExecutorwith manually setHttpExecutorContext,OkHttpClientand/orObjectMapper.- Returns:
CreatingActionTypeStageto mark the only possible action in this case - creating
-
throughHttp
public static EditingActionTypeStage throughHttp(EditImageHttpExecutor editExecutor)
- Parameters:
editExecutor- ConfiguredEditImageHttpExecutorwith manually setHttpExecutorContext,OkHttpClientand/orObjectMapper.- Returns:
EditingActionTypeStageto mark the only possible action - editing in this case
-
throughHttp
public static VariatingActionTypeStage throughHttp(ImageVariationHttpExecutor variationExecutor)
- 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:
HttpBuilderso 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:
HttpBuilderso 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:
HttpBuilderso timeouts can be reconfigured and possiblyObjectMapperis supplied.
-
-