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
FieldsModifier and TypeFieldDescriptionfinal org.springframework.retry.support.RetryTemplate -
Constructor Summary
ConstructorsConstructorDescriptionOpenAiImageClient(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:ModelClientExecutes a method call to the AI model.- Specified by:
callin interfaceImageClient- Specified by:
callin interfaceModelClient<ImagePrompt,ImageResponse> - Parameters:
imagePrompt- the request object to be sent to the AI model- Returns:
- the response from the AI model
-