Interface GenerateContentConfig

Optional model configuration parameters.

For more information, see Content generation parameters <https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/content-generation-parameters>_.

interface GenerateContentConfig {
    audioTimestamp?: boolean;
    cachedContent?: string;
    candidateCount?: number;
    frequencyPenalty?: number;
    httpOptions?: HttpOptions;
    labels?: Record<string, string>;
    logprobs?: number;
    maxOutputTokens?: number;
    mediaResolution?: MediaResolution;
    presencePenalty?: number;
    responseLogprobs?: boolean;
    responseMimeType?: string;
    responseModalities?: string[];
    responseSchema?: Schema;
    routingConfig?: GenerationConfigRoutingConfig;
    safetySettings?: SafetySetting[];
    seed?: number;
    speechConfig?: SpeechConfigUnion;
    stopSequences?: string[];
    systemInstruction?: ContentUnion;
    temperature?: number;
    thinkingConfig?: ThinkingConfig;
    toolConfig?: ToolConfig;
    tools?: ToolListUnion;
    topK?: number;
    topP?: number;
}

Properties

audioTimestamp?: boolean

If enabled, audio timestamp will be included in the request to the model.

cachedContent?: string

Resource name of a context cache that can be used in subsequent requests.

candidateCount?: number

Number of response variations to return.

frequencyPenalty?: number

Positive values penalize tokens that repeatedly appear in the generated text, increasing the probability of generating more diverse content.

httpOptions?: HttpOptions

Used to override HTTP request options.

labels?: Record<string, string>

Labels with user-defined metadata to break down billed charges.

logprobs?: number

Number of top candidate tokens to return the log probabilities for at each generation step.

maxOutputTokens?: number

Maximum number of tokens that can be generated in the response.

mediaResolution?: MediaResolution

If specified, the media resolution specified will be used.

presencePenalty?: number

Positive values penalize tokens that already appear in the generated text, increasing the probability of generating more diverse content.

responseLogprobs?: boolean

Whether to return the log probabilities of the tokens that were chosen by the model at each step.

responseMimeType?: string

Output response media type of the generated candidate text.

responseModalities?: string[]

The requested modalities of the response. Represents the set of modalities that the model can return.

responseSchema?: Schema

Schema that the generated candidate text must adhere to.

Configuration for model router requests.

safetySettings?: SafetySetting[]

Safety settings in the request to block unsafe content in the response.

seed?: number

When seed is fixed to a specific number, the model makes a best effort to provide the same response for repeated requests. By default, a random number is used.

speechConfig?: SpeechConfigUnion

The speech generation configuration.

stopSequences?: string[]

List of strings that tells the model to stop generating text if one of the strings is encountered in the response.

systemInstruction?: ContentUnion

Instructions for the model to steer it toward better performance. For example, "Answer as concisely as possible" or "Don't use technical terms in your response".

temperature?: number

Value that controls the degree of randomness in token selection. Lower temperatures are good for prompts that require a less open-ended or creative response, while higher temperatures can lead to more diverse or creative results.

thinkingConfig?: ThinkingConfig

The thinking features configuration.

toolConfig?: ToolConfig

Associates model output to a specific function call.

Code that enables the system to interact with external systems to perform an action outside of the knowledge and scope of the model.

topK?: number

For each token selection step, the top_k tokens with the highest probabilities are sampled. Then tokens are further filtered based on top_p with the final token selected using temperature sampling. Use a lower number for less random responses and a higher number for more random responses.

topP?: number

Tokens are selected from the most to least probable until the sum of their probabilities equals this value. Use a lower value for less random responses and a higher value for more random responses.

MMNEPVFCICPMFPCPTTAAATR