Class StabilityAiImageModel
java.lang.Object
org.springframework.ai.stabilityai.StabilityAiImageModel
- All Implemented Interfaces:
ImageModel,Model<ImagePrompt,ImageResponse>
StabilityAiImageModel is a class that implements the ImageModel interface. It provides
a client for calling the StabilityAI image generation API.
-
Constructor Summary
ConstructorsConstructorDescriptionStabilityAiImageModel(StabilityAiApi stabilityAiApi) StabilityAiImageModel(StabilityAiApi stabilityAiApi, StabilityAiImageOptions options) StabilityAiImageModel(StabilityAiApi stabilityAiApi, StabilityAiImageOptions options, io.micrometer.observation.ObservationRegistry observationRegistry) Creates a model that reports its calls to the given observation registry. -
Method Summary
Modifier and TypeMethodDescriptioncall(ImagePrompt imagePrompt) Calls the StabilityAiImageModel with the given StabilityAiImagePrompt and returns the ImageResponse.voidsetObservationConvention(ImageModelObservationConvention observationConvention) Use the provided convention for reporting observation data.
-
Constructor Details
-
StabilityAiImageModel
-
StabilityAiImageModel
-
StabilityAiImageModel
public StabilityAiImageModel(StabilityAiApi stabilityAiApi, StabilityAiImageOptions options, io.micrometer.observation.ObservationRegistry observationRegistry) Creates a model that reports its calls to the given observation registry.- Parameters:
stabilityAiApi- the Stability AI API clientoptions- the default optionsobservationRegistry- the observation registry,ObservationRegistry.NOOPfor none- Since:
- 2.0.2
-
-
Method Details
-
setObservationConvention
Use the provided convention for reporting observation data.- Parameters:
observationConvention- the provided convention- Since:
- 2.0.2
-
getOptions
-
call
Calls the StabilityAiImageModel with the given StabilityAiImagePrompt and returns the ImageResponse. This overloaded call method lets you pass the full set of Prompt instructions that StabilityAI supports.- Specified by:
callin interfaceImageModel- Specified by:
callin interfaceModel<ImagePrompt,ImageResponse> - Parameters:
imagePrompt- the StabilityAiImagePrompt containing the prompt and image model options- Returns:
- the ImageResponse generated by the StabilityAiImageModel
-