getInstance

Returns the FirebaseAI instance for the provided FirebaseApp and backend.

Parameters

backend

the backend reference to make generative AI requests to.


actual fun getInstance(app: FirebaseApp, backend: GenerativeBackend, useLimitedUseAppCheckTokens: Boolean): FirebaseAI(source)

Returns the FirebaseAI instance for the provided FirebaseApp and backend.

Parameters

backend

the backend reference to make generative AI requests to.

useLimitedUseAppCheckTokens

when sending tokens to the backend, this option enables the usage of App Check's limited-use tokens instead of the standard cached tokens. Learn more about limited-use tokens, including their nuances, when to use them, and best practices for integrating them into your app.

This flag is set to false by default.


The FirebaseAI instance for the provided FirebaseApp using the Google AI Backend.

expect fun getInstance(app: FirebaseApp = Firebase.app, backend: GenerativeBackend): FirebaseAI(source)

Returns the FirebaseAI instance for the provided FirebaseApp and backend.

Parameters

backend

the backend reference to make generative AI requests to.


expect fun getInstance(app: FirebaseApp = Firebase.app, backend: GenerativeBackend, useLimitedUseAppCheckTokens: Boolean): FirebaseAI(source)

Returns the FirebaseAI instance for the provided FirebaseApp and backend.

Parameters

backend

the backend reference to make generative AI requests to.

useLimitedUseAppCheckTokens

when sending tokens to the backend, this option enables the usage of App Check's limited-use tokens instead of the standard cached tokens. Learn more about limited-use tokens, including their nuances, when to use them, and best practices for integrating them into your app.

This flag is set to false by default.


The FirebaseAI instance for the provided FirebaseApp using the Google AI Backend.

Returns the FirebaseAI instance for the provided FirebaseApp and backend.

Parameters

backend

the backend reference to make generative AI requests to.


actual fun getInstance(app: FirebaseApp, backend: GenerativeBackend, useLimitedUseAppCheckTokens: Boolean): FirebaseAI(source)

Returns the FirebaseAI instance for the provided FirebaseApp and backend.

Parameters

backend

the backend reference to make generative AI requests to.

useLimitedUseAppCheckTokens

when sending tokens to the backend, this option enables the usage of App Check's limited-use tokens instead of the standard cached tokens. Learn more about limited-use tokens, including their nuances, when to use them, and best practices for integrating them into your app.

This flag is set to false by default.


The FirebaseAI instance for the provided FirebaseApp using the Google AI Backend.