CountTokensRequest interface

Params for calling GenerativeModel.countTokens()

Signature:

export interface CountTokensRequest 

Properties

Property Type Description
contents Content[]
generationConfig GenerationConfig Configuration options that control how the model generates a response.
systemInstruction string | Part | Content Instructions that direct the model to behave a certain way.
tools Tool[] Tool configuration.

CountTokensRequest.contents

Signature:

contents: Content[];

CountTokensRequest.generationConfig

Configuration options that control how the model generates a response.

Signature:

generationConfig?: GenerationConfig;

CountTokensRequest.systemInstruction

Instructions that direct the model to behave a certain way.

Signature:

systemInstruction?: string | Part | Content;

CountTokensRequest.tools

Tool configuration.

Signature:

tools?: Tool[];