REST Resource: models

Resource: Model

Information about a Generative Language Model.

JSON representation
{
  "name": string,
  "baseModelId": string,
  "version": string,
  "displayName": string,
  "description": string,
  "inputTokenLimit": integer,
  "outputTokenLimit": integer,
  "supportedGenerationMethods": [
    string
  ],
  "temperature": number,
  "topP": number,
  "topK": integer
}
Fields
name

string

Required. The resource name of the Model.

Format: models/{model} with a {model} naming convention of:

  • "{baseModelId}-{version}"

Examples:

  • models/chat-bison-001
baseModelId

string

Required. The name of the base model, pass this to the generation request.

Examples:

  • chat-bison
version

string

Required. The version number of the model.

This represents the major version

displayName

string

The human-readable name of the model. E.g. "Chat Bison".

The name can be up to 128 characters long and can consist of any UTF-8 characters.

description

string

A short description of the model.

inputTokenLimit

integer

Maximum number of input tokens allowed for this model.

outputTokenLimit

integer

Maximum number of output tokens available for this model.

supportedGenerationMethods[]

string

The model's supported generation methods.

The method names are defined as Pascal case strings, such as generateMessage which correspond to API methods.

temperature

number

Controls the randomness of the output.

Values can range over [0.0,1.0], inclusive. A value closer to 1.0 will produce responses that are more varied, while a value closer to 0.0 will typically result in less surprising responses from the model. This value specifies default to be used by the backend while making the call to the model.

topP

number

For Nucleus sampling.

Nucleus sampling considers the smallest set of tokens whose probability sum is at least topP. This value specifies default to be used by the backend while making the call to the model.

topK

integer

For Top-k sampling.

Top-k sampling considers the set of topK most probable tokens. This value specifies default to be used by the backend while making the call to the model. If empty, indicates the model doesn't use top-k sampling, and topK isn't allowed as a generation parameter.

Methods

batchEmbedContents

Generates multiple embeddings from the model given input text in a synchronous call.

batchEmbedText

Generates multiple embeddings from the model given input text in a synchronous call.

countMessageTokens

Runs a model's tokenizer on a string and returns the token count.

countTextTokens

Runs a model's tokenizer on a text and returns the token count.

countTokens

Runs a model's tokenizer on input content and returns the token count.

embedContent

Generates an embedding from the model given an input Content.

embedText

Generates an embedding from the model given an input message.

generateAnswer

Generates a grounded answer from the model given an input GenerateAnswerRequest.

generateContent

Generates a response from the model given an input GenerateContentRequest.

generateMessage

Generates a response from the model given an input MessagePrompt.

generateText

Generates a response from the model given an input message.

get

Gets information about a specific Model.

list

Lists models available through the API.

streamGenerateContent

Generates a streamed response from the model given an input GenerateContentRequest.