AIOptions interface
Stay organized with collections
Save and categorize content based on your preferences.
Options for initializing the AI service using getAI(). This allows specifying which backend to use (Vertex AI Gemini API or Gemini Developer API) and configuring its specific options (like location for Vertex AI).
Signature:
export interface AIOptions
Properties
AIOptions.backend
The backend configuration to use for the AI service instance. Defaults to the Gemini Developer API backend (GoogleAIBackend).
Signature:
backend?: Backend;
AIOptions.useLimitedUseAppCheckTokens
Whether to use App Check limited use tokens. Defaults to false.
Signature:
useLimitedUseAppCheckTokens?: boolean;
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-28 UTC.
[null,null,["Last updated 2025-08-28 UTC."],[],[],null,["Options for initializing the AI service using [getAI()](./ai.md#getai_a94a413). This allows specifying which backend to use (Vertex AI Gemini API or Gemini Developer API) and configuring its specific options (like location for Vertex AI).\n\n**Signature:** \n\n export interface AIOptions \n\nProperties\n\n| Property | Type | Description |\n|---------------------------------------------------------------------------------------|------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| [backend](./ai.aioptions.md#aioptionsbackend) | [Backend](./ai.backend.md#backend_class) | The backend configuration to use for the AI service instance. Defaults to the Gemini Developer API backend ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)). |\n| [useLimitedUseAppCheckTokens](./ai.aioptions.md#aioptionsuselimiteduseappchecktokens) | boolean | Whether to use App Check limited use tokens. Defaults to false. |\n\nAIOptions.backend\n\nThe backend configuration to use for the AI service instance. Defaults to the Gemini Developer API backend ([GoogleAIBackend](./ai.googleaibackend.md#googleaibackend_class)).\n\n**Signature:** \n\n backend?: Backend;\n\nAIOptions.useLimitedUseAppCheckTokens\n\nWhether to use App Check limited use tokens. Defaults to false.\n\n**Signature:** \n\n useLimitedUseAppCheckTokens?: boolean;"]]