TemplateRequest interface

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.

Request parameters for using a server prompt template with `TemplateGenerativeModel.generateContent()` and `TemplateGenerativeModel.generateContentStream()`.

Signature:

export interface TemplateRequest 

Properties

Property Type Description
templateId string (Public Preview) The ID of the server prompt template to use.
templateVariables Record<string, unknown> (Public Preview) A key-value map of variables to populate the template with.
toolConfig TemplateToolConfig (Public Preview) Optional tool configuration for this request. Only retrieval/grounding configs are supported for server prompt templates with unary and streaming generateContent.

TemplateRequest.templateId

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.

The ID of the server prompt template to use.

Signature:

templateId: string;

TemplateRequest.templateVariables

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.

A key-value map of variables to populate the template with.

Signature:

templateVariables: Record<string, unknown>;

TemplateRequest.toolConfig

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.

Optional tool configuration for this request. Only retrieval/grounding configs are supported for server prompt templates with unary and streaming generateContent.

Signature:

toolConfig?: TemplateToolConfig;