Class OpenAiImageApi
java.lang.Object
org.springframework.ai.openai.api.OpenAiImageApi
OpenAI Image API.
- Author:
- lambochen, Filip Hrisafov
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Builder to constructOpenAiImageApi
instance.static final record
static enum
OpenAI Image API model.static final record
static final record
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionOpenAiImageApi
(String baseUrl, ApiKey apiKey, org.springframework.util.MultiValueMap<String, String> headers, String imagesPath, org.springframework.web.client.RestClient.Builder restClientBuilder, org.springframework.web.client.ResponseErrorHandler responseErrorHandler) Create a new OpenAI Image API with the provided base URL. -
Method Summary
Modifier and TypeMethodDescriptionstatic OpenAiImageApi.Builder
builder()
org.springframework.http.ResponseEntity<OpenAiImageApi.OpenAiImageResponse>
createImage
(OpenAiImageApi.OpenAiImageRequest openAiImageRequest)
-
Field Details
-
DEFAULT_IMAGE_MODEL
-
-
Constructor Details
-
OpenAiImageApi
public OpenAiImageApi(String baseUrl, ApiKey apiKey, org.springframework.util.MultiValueMap<String, String> headers, String imagesPath, org.springframework.web.client.RestClient.Builder restClientBuilder, org.springframework.web.client.ResponseErrorHandler responseErrorHandler) Create a new OpenAI Image API with the provided base URL.- Parameters:
baseUrl
- the base URL for the OpenAI API.apiKey
- OpenAI apiKey.headers
- the http headers to use.imagesPath
- the images path to use.restClientBuilder
- the rest client builder to use.responseErrorHandler
- the response error handler to use.
-
-
Method Details
-
createImage
public org.springframework.http.ResponseEntity<OpenAiImageApi.OpenAiImageResponse> createImage(OpenAiImageApi.OpenAiImageRequest openAiImageRequest) -
builder
-