Package org.springframework.ai.qianfan
Class QianFanImageModel
java.lang.Object
org.springframework.ai.qianfan.QianFanImageModel
- All Implemented Interfaces:
ImageModel
,Model<ImagePrompt,
ImageResponse>
QianFanImageModel is a class that implements the ImageModel interface. It provides a
client for calling the QianFan image generation API.
- Since:
- 1.0
- Author:
- Geng Rong
-
Constructor Summary
ConstructorDescriptionQianFanImageModel
(QianFanImageApi qianFanImageApi) Creates an instance of the QianFanImageModel.QianFanImageModel
(QianFanImageApi qianFanImageApi, QianFanImageOptions options) Creates an instance of the QianFanImageModel.QianFanImageModel
(QianFanImageApi qianFanImageApi, QianFanImageOptions options, org.springframework.retry.support.RetryTemplate retryTemplate) Creates an instance of the QianFanImageModel.QianFanImageModel
(QianFanImageApi qianFanImageApi, QianFanImageOptions options, org.springframework.retry.support.RetryTemplate retryTemplate, io.micrometer.observation.ObservationRegistry observationRegistry) Initializes a new instance of the QianFanImageModel. -
Method Summary
Modifier and TypeMethodDescriptioncall
(ImagePrompt imagePrompt) Executes a method call to the AI model.void
setObservationConvention
(ImageModelObservationConvention observationConvention)
-
Constructor Details
-
QianFanImageModel
Creates an instance of the QianFanImageModel.- Parameters:
qianFanImageApi
- The QianFanImageApi instance to be used for interacting with the QianFan Image API.- Throws:
IllegalArgumentException
- if qianFanImageApi is null
-
QianFanImageModel
Creates an instance of the QianFanImageModel.- Parameters:
qianFanImageApi
- The QianFanImageApi instance to be used for interacting with the QianFan Image API.options
- The QianFanImageOptions to configure the image model.- Throws:
IllegalArgumentException
- if qianFanImageApi is null
-
QianFanImageModel
public QianFanImageModel(QianFanImageApi qianFanImageApi, QianFanImageOptions options, org.springframework.retry.support.RetryTemplate retryTemplate) Creates an instance of the QianFanImageModel.- Parameters:
qianFanImageApi
- The QianFanImageApi instance to be used for interacting with the QianFan Image API.options
- The QianFanImageOptions to configure the image model.retryTemplate
- The retry template.- Throws:
IllegalArgumentException
- if qianFanImageApi is null
-
QianFanImageModel
public QianFanImageModel(QianFanImageApi qianFanImageApi, QianFanImageOptions options, org.springframework.retry.support.RetryTemplate retryTemplate, io.micrometer.observation.ObservationRegistry observationRegistry) Initializes a new instance of the QianFanImageModel.- Parameters:
qianFanImageApi
- The QianFanImageApi instance to be used for interacting with the QianFan Image API.options
- The QianFanImageOptions to configure the image model.retryTemplate
- The retry template.observationRegistry
- The ObservationRegistry used for instrumentation.
-
-
Method Details
-
call
Description copied from interface:Model
Executes a method call to the AI model.- Specified by:
call
in interfaceImageModel
- Specified by:
call
in interfaceModel<ImagePrompt,
ImageResponse> - Parameters:
imagePrompt
- the request object to be sent to the AI model- Returns:
- the response from the AI model
-
setObservationConvention
-