Class GoogleGenAiImageModel
java.lang.Object
org.springframework.ai.google.genai.image.GoogleGenAiImageModel
- All Implemented Interfaces:
ImageModel,Model<ImagePrompt,ImageResponse>
A class representing an Image Model using the new Google Gen AI SDK.
- Since:
- 2.0.1
- Author:
- Olivier Le Quellec
-
Constructor Summary
ConstructorsConstructorDescriptionGoogleGenAiImageModel(GoogleGenAiImageConnectionDetails connectionDetails, GoogleGenAiImageOptions defaultImageOptions) GoogleGenAiImageModel(GoogleGenAiImageConnectionDetails connectionDetails, GoogleGenAiImageOptions defaultImageOptions, org.springframework.core.retry.RetryTemplate retryTemplate) GoogleGenAiImageModel(GoogleGenAiImageConnectionDetails connectionDetails, GoogleGenAiImageOptions defaultImageOptions, org.springframework.core.retry.RetryTemplate retryTemplate, io.micrometer.observation.ObservationRegistry observationRegistry) -
Method Summary
Modifier and TypeMethodDescriptioncall(ImagePrompt prompt) Executes a method call to the AI model.voidsetObservationConvention(@Nullable ImageModelObservationConvention observationConvention)
-
Constructor Details
-
GoogleGenAiImageModel
public GoogleGenAiImageModel(GoogleGenAiImageConnectionDetails connectionDetails, GoogleGenAiImageOptions defaultImageOptions) -
GoogleGenAiImageModel
public GoogleGenAiImageModel(GoogleGenAiImageConnectionDetails connectionDetails, GoogleGenAiImageOptions defaultImageOptions, org.springframework.core.retry.RetryTemplate retryTemplate) -
GoogleGenAiImageModel
public GoogleGenAiImageModel(GoogleGenAiImageConnectionDetails connectionDetails, GoogleGenAiImageOptions defaultImageOptions, org.springframework.core.retry.RetryTemplate retryTemplate, io.micrometer.observation.ObservationRegistry observationRegistry)
-
-
Method Details
-
call
Description copied from interface:ModelExecutes a method call to the AI model.- Specified by:
callin interfaceImageModel- Specified by:
callin interfaceModel<ImagePrompt,ImageResponse> - Parameters:
prompt- the request object to be sent to the AI model- Returns:
- the response from the AI model
-
setObservationConvention
public void setObservationConvention(@Nullable ImageModelObservationConvention observationConvention)
-