Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions misc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,15 @@ dependencies {
implementation(libs.androidx.startup.runtime)
implementation(libs.androidx.window.java)
implementation(libs.appcompat)
// [START firebase_ai_bom]
// Import the BoM for the Firebase platform
implementation(platform("com.google.firebase:firebase-bom:34.3.0"))

// Add the dependency for the Firebase AI Logic library When using the BoM,
// you don't specify versions in Firebase library dependencies
implementation("com.google.firebase:firebase-ai")
// [END firebase_ai_bom]

testImplementation(libs.junit)
testImplementation(kotlin("test"))
androidTestImplementation(libs.androidx.test.ext.junit)
Expand Down
29 changes: 29 additions & 0 deletions misc/src/main/java/com/example/snippets/ai/GenerativeAiSnippets.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/*
* Copyright 2025 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package com.example.snippets.ai

import com.google.firebase.Firebase
import com.google.firebase.ai.ai
import com.google.firebase.ai.type.GenerativeBackend

object GeminiDeveloperApi25FlashModelConfiguration {
// [START firebase_ai_generative_backend_configuration]
// Start by instantiating a GenerativeModel and specifying the model name:
val model = Firebase.ai(backend = GenerativeBackend.googleAI())
.generativeModel("gemini-2.5-flash")
// [END firebase_ai_generative_backend_configuration]
}