Interface CountTokensConfig

Config for the count_tokens method.

interface CountTokensConfig {
    abortSignal?: AbortSignal;
    generationConfig?: GenerationConfig;
    httpOptions?: HttpOptions;
    systemInstruction?: ContentUnion;
    tools?: Tool[];
}

Properties

abortSignal?: AbortSignal

Abort signal which can be used to cancel the request.

NOTE: AbortSignal is a client-only operation. Using it to cancel an operation will not cancel the request in the service. You will still be charged usage for any applicable operations.

generationConfig?: GenerationConfig

Configuration that the model uses to generate the response. Not supported by the Gemini Developer API.

httpOptions?: HttpOptions

Used to override HTTP request options.

systemInstruction?: ContentUnion

Instructions for the model to steer it toward better performance.

tools?: Tool[]

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