AI interface

An instance of the Firebase AI SDK.

Do not create this instance directly. Instead, usegetAI().

Signature:

exportinterfaceAI

Properties

PropertyTypeDescription
appFirebaseAppTheFirebaseApp thisAI instance is associated with.
backendBackendABackend instance that specifies the configuration for the target backend, either the Gemini Developer API (usingGoogleAIBackend) or the Vertex AI Gemini API (usingVertexAIBackend).
locationstring
optionsAIOptionsOptions applied to thisAI instance.

AI.app

TheFirebaseApp thisAI instance is associated with.

Signature:

app:FirebaseApp;

AI.backend

ABackend instance that specifies the configuration for the target backend, either the Gemini Developer API (usingGoogleAIBackend) or the Vertex AI Gemini API (usingVertexAIBackend).

Signature:

backend:Backend;

AI.location

Warning: This API is now obsolete.

useAI.backend.location instead.

The location configured for this AI service instance, relevant for Vertex AI backends.

Signature:

location:string;

AI.options

Options applied to thisAI instance.

Signature:

options?:AIOptions;

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-08-28 UTC.