GenerationConfig interface

Config options for content-related requests

Signature:

exportinterfaceGenerationConfig

Properties

PropertyTypeDescription
candidateCountnumber
frequencyPenaltynumber
maxOutputTokensnumber
presencePenaltynumber
responseMimeTypestringOutput response MIME type of the generated candidate text. Supported MIME types are text/plain (default, text output), application/json (JSON response in the candidates), and text/x.enum.
responseSchemaTypedSchema | SchemaRequestOutput response schema of the generated candidate text. This value can be a class generated with a Schema static method like Schema.string() or Schema.object() or it can be a plain JS object matching the SchemaRequest interface.
Note: This only applies when the specified responseMIMEType supports a schema; currently this is limited to application/json and text/x.enum.
stopSequencesstring[]
temperaturenumber
topKnumber
topPnumber

GenerationConfig.candidateCount

Signature:

candidateCount?:number;

GenerationConfig.frequencyPenalty

Signature:

frequencyPenalty?:number;

GenerationConfig.maxOutputTokens

Signature:

maxOutputTokens?:number;

GenerationConfig.presencePenalty

Signature:

presencePenalty?:number;

GenerationConfig.responseMimeType

Output response MIME type of the generated candidate text. Supported MIME types are text/plain (default, text output), application/json (JSON response in the candidates), and text/x.enum.

Signature:

responseMimeType?:string;

GenerationConfig.responseSchema

Output response schema of the generated candidate text. This value can be a class generated with a Schema static method like Schema.string() or Schema.object() or it can be a plain JS object matching the SchemaRequest interface.
Note: This only applies when the specified responseMIMEType supports a schema; currently this is limited to application/json and text/x.enum.

Signature:

responseSchema?:TypedSchema|SchemaRequest;

GenerationConfig.stopSequences

Signature:

stopSequences?:string[];

GenerationConfig.temperature

Signature:

temperature?:number;

GenerationConfig.topK

Signature:

topK?:number;

GenerationConfig.topP

Signature:

topP?:number;