Back to Firebase Js Sdk

CountTokensRequest interface

docs-devsite/ai.counttokensrequest.md

12.12.11.9 KB
Original Source

Project: /docs/reference/js/_project.yaml Book: /docs/reference/_book.yaml page_type: reference

{% comment %} DO NOT EDIT THIS FILE! This is generated by the JS SDK team, and any local changes will be overwritten. Changes should be made in the source code at https://github.com/firebase/firebase-js-sdk {% endcomment %}

CountTokensRequest interface

Params for calling GenerativeModel.countTokens()

<b>Signature:</b>

typescript
export interface CountTokensRequest 

Properties

PropertyTypeDescription
contentsContent<!-- -->[]
generationConfigGenerationConfigConfiguration options that control how the model generates a response.
systemInstructionstring | Part | ContentInstructions that direct the model to behave a certain way.
toolsTool<!-- -->[]Tool configuration.

CountTokensRequest.contents

<b>Signature:</b>

typescript
contents: Content[];

CountTokensRequest.generationConfig

Configuration options that control how the model generates a response.

<b>Signature:</b>

typescript
generationConfig?: GenerationConfig;

CountTokensRequest.systemInstruction

Instructions that direct the model to behave a certain way.

<b>Signature:</b>

typescript
systemInstruction?: string | Part | Content;

CountTokensRequest.tools

Tool configuration.

<b>Signature:</b>

typescript
tools?: Tool[];