diff --git a/firebase-ai/CHANGELOG.md b/firebase-ai/CHANGELOG.md index 91e60605fd7..241a23f0f63 100644 --- a/firebase-ai/CHANGELOG.md +++ b/firebase-ai/CHANGELOG.md @@ -1,5 +1,6 @@ # Unreleased +* [fixed] Fixed `FirebaseAI.getInstance` StackOverflowException (#6971) * [fixed] Fixed an issue that was causing the SDK to send empty `FunctionDeclaration` descriptions to the API. # 16.0.0 diff --git a/firebase-ai/src/main/kotlin/com/google/firebase/ai/FirebaseAI.kt b/firebase-ai/src/main/kotlin/com/google/firebase/ai/FirebaseAI.kt index bbce7546eff..86eb8057b1d 100644 --- a/firebase-ai/src/main/kotlin/com/google/firebase/ai/FirebaseAI.kt +++ b/firebase-ai/src/main/kotlin/com/google/firebase/ai/FirebaseAI.kt @@ -220,7 +220,9 @@ internal constructor( } /** The [FirebaseAI] instance for the provided [FirebaseApp] using the Google AI Backend. */ - @JvmStatic public fun getInstance(app: FirebaseApp): FirebaseAI = getInstance(app) + @JvmStatic + public fun getInstance(app: FirebaseApp): FirebaseAI = + getInstance(app, GenerativeBackend.googleAI()) private const val GEMINI_MODEL_NAME_PREFIX = "gemini-"