TemplateImagenModel class

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Class for Imagen model APIs that execute on a server-side template.

This class should only be instantiated with getTemplateImagenModel().

Signature:

export declare class TemplateImagenModel 

Constructors

Constructor Modifiers Description
(constructor)(ai, requestOptions) (Public Preview) Constructs a new instance of the TemplateImagenModel class

Properties

Property Modifiers Type Description
requestOptions RequestOptions (Public Preview) Additional options to use when making requests.

Methods

Method Modifiers Description
generateImages(templateId, templateVariables) (Public Preview) Makes a single call to the model and returns an object containing a single ImagenGenerationResponse.

TemplateImagenModel.(constructor)

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Constructs a new instance of the TemplateImagenModel class

Signature:

constructor(ai: AI, requestOptions?: RequestOptions);

Parameters

Parameter Type Description
ai AI
requestOptions RequestOptions

TemplateImagenModel.requestOptions

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Additional options to use when making requests.

Signature:

requestOptions?: RequestOptions;

TemplateImagenModel.generateImages()

This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Makes a single call to the model and returns an object containing a single ImagenGenerationResponse.

Signature:

generateImages(templateId: string, templateVariables: object): Promise<ImagenGenerationResponse<ImagenInlineImage>>;

Parameters

Parameter Type Description
templateId string The ID of the server-side template to execute.
templateVariables object A key-value map of variables to populate the template with.

Returns:

Promise<ImagenGenerationResponse<ImagenInlineImage>>