Package org.springframework.ai.openai
Class OpenAiImageClient
java.lang.Object
org.springframework.ai.openai.OpenAiImageClient
- All Implemented Interfaces:
ImageClient
,ModelClient<ImagePrompt,
ImageResponse>
OpenAiImageClient is a class that implements the ImageClient interface. It provides a
client for calling the OpenAI image generation API.
- Since:
- 0.8.0
- Author:
- Mark Pollack, Christian Tzolov
-
Field Summary
Modifier and TypeFieldDescriptionfinal org.springframework.retry.support.RetryTemplate
-
Constructor Summary
ConstructorDescriptionOpenAiImageClient
(OpenAiImageApi openAiImageApi) OpenAiImageClient
(OpenAiImageApi openAiImageApi, OpenAiImageOptions defaultOptions, org.springframework.retry.support.RetryTemplate retryTemplate) -
Method Summary
Modifier and TypeMethodDescriptioncall
(ImagePrompt imagePrompt) Executes a method call to the AI model.
-
Field Details
-
retryTemplate
public final org.springframework.retry.support.RetryTemplate retryTemplate
-
-
Constructor Details
-
OpenAiImageClient
-
OpenAiImageClient
public OpenAiImageClient(OpenAiImageApi openAiImageApi, OpenAiImageOptions defaultOptions, org.springframework.retry.support.RetryTemplate retryTemplate)
-
-
Method Details
-
getDefaultOptions
-
call
Description copied from interface:ModelClient
Executes a method call to the AI model.- Specified by:
call
in interfaceImageClient
- Specified by:
call
in interfaceModelClient<ImagePrompt,
ImageResponse> - Parameters:
imagePrompt
- the request object to be sent to the AI model- Returns:
- the response from the AI model
-