diff --git a/firebase-ai/app/src/main/java/com/google/firebase/example/ailogic/kotlin/GoogleAISnippets.kt b/firebase-ai/app/src/main/java/com/google/firebase/example/ailogic/kotlin/GoogleAISnippets.kt index bbff4aa6..fb08602e 100644 --- a/firebase-ai/app/src/main/java/com/google/firebase/example/ailogic/kotlin/GoogleAISnippets.kt +++ b/firebase-ai/app/src/main/java/com/google/firebase/example/ailogic/kotlin/GoogleAISnippets.kt @@ -55,7 +55,9 @@ class GoogleAISnippets : ViewModel() { // Specify the config as part of creating the `GenerativeModel` instance val model = Firebase.ai(backend = GenerativeBackend.googleAI()) - .generativeModel(modelName = "gemini-2.5-flash", generationConfig = config) + .generativeModel( + modelName = "gemini-2.5-flash", + generationConfig = config) // ... // [END model_parameters_general] @@ -79,7 +81,9 @@ class GoogleAISnippets : ViewModel() { // Specify the config as part of creating the `GenerativeModel` instance val model = Firebase.ai(backend = GenerativeBackend.vertexAI()) - .imagenModel(modelName = "imagen-4.0-generate-001", generationConfig = config) + .imagenModel( + modelName = "imagen-4.0-generate-001", + generationConfig = config) // ... // [END model_parameters_imagen] @@ -104,7 +108,9 @@ class GoogleAISnippets : ViewModel() { // Specify the config as part of creating the `LiveModel` instance val model = Firebase.ai(backend = GenerativeBackend.googleAI()) - .liveModel(modelName = "gemini-2.5-flash", generationConfig = config) + .liveModel( + modelName = "gemini-2.5-flash", + generationConfig = config) // ... // [END model_parameters_live] @@ -165,10 +171,11 @@ class GoogleAISnippets : ViewModel() { fun systemInstructions_general() { // [START system_instructions_general] // Specify the system instructions as part of creating the `GenerativeModel` instance - val model = Firebase.ai(backend = GenerativeBackend.googleAI()).generativeModel( - modelName = "gemini-2.5-flash", - systemInstruction = content { text("You are a cat. Your name is Neko.") } - ) + val model = Firebase.ai(backend = GenerativeBackend.googleAI()) + .generativeModel( + modelName = "gemini-2.5-flash", + systemInstruction = content { text("You are a cat. Your name is Neko.") } + ) // [END system_instructions_general] } @@ -176,10 +183,11 @@ class GoogleAISnippets : ViewModel() { fun systemInstructions_live() { // [START system_instructions_live] // Specify the system instructions as part of creating the `LiveModel` instance - val model = Firebase.ai(backend = GenerativeBackend.googleAI()).liveModel( - modelName = "gemini-2.5-flash", - systemInstruction = content { text("You are a cat. Your name is Neko.") } - ) + val model = Firebase.ai(backend = GenerativeBackend.googleAI()) + .liveModel( + modelName = "gemini-2.5-flash", + systemInstruction = content { text("You are a cat. Your name is Neko.") } + ) // [END system_instructions_live] } } \ No newline at end of file diff --git a/firebase-ai/app/src/main/java/com/google/firebase/example/ailogic/kotlin/VertexAISnippets.kt b/firebase-ai/app/src/main/java/com/google/firebase/example/ailogic/kotlin/VertexAISnippets.kt index 069bed49..bf060c43 100644 --- a/firebase-ai/app/src/main/java/com/google/firebase/example/ailogic/kotlin/VertexAISnippets.kt +++ b/firebase-ai/app/src/main/java/com/google/firebase/example/ailogic/kotlin/VertexAISnippets.kt @@ -56,7 +56,9 @@ class VertexAISnippets : ViewModel() { // Specify the config as part of creating the `GenerativeModel` instance val model = Firebase.ai(backend = GenerativeBackend.vertexAI()) - .generativeModel(modelName = "gemini-2.5-flash", generationConfig = config) + .generativeModel( + modelName = "gemini-2.5-flash", + generationConfig = config) // ... // [END model_parameters_general] @@ -80,7 +82,9 @@ class VertexAISnippets : ViewModel() { // Specify the config as part of creating the `GenerativeModel` instance val model = Firebase.ai(backend = GenerativeBackend.vertexAI()) - .imagenModel(modelName = "imagen-4.0-generate-001", generationConfig = config) + .imagenModel( + modelName = "imagen-4.0-generate-001", + generationConfig = config) // ... // [END model_parameters_imagen] @@ -105,7 +109,9 @@ class VertexAISnippets : ViewModel() { // Specify the config as part of creating the `LiveModel` instance val model = Firebase.ai(backend = GenerativeBackend.vertexAI()) - .liveModel(modelName = "gemini-2.5-flash", generationConfig = config) + .liveModel( + modelName = "gemini-2.5-flash", + generationConfig = config) // ... // [END model_parameters_live] @@ -166,10 +172,11 @@ class VertexAISnippets : ViewModel() { fun systemInstructions_general() { // [START system_instructions_general] // Specify the system instructions as part of creating the `GenerativeModel` instance - val model = Firebase.ai(backend = GenerativeBackend.vertexAI()).generativeModel( - modelName = "gemini-2.5-flash", - systemInstruction = content { text("You are a cat. Your name is Neko.") } - ) + val model = Firebase.ai(backend = GenerativeBackend.vertexAI()) + .generativeModel( + modelName = "gemini-2.5-flash", + systemInstruction = content { text("You are a cat. Your name is Neko.") } + ) // [END system_instructions_general] } @@ -177,10 +184,11 @@ class VertexAISnippets : ViewModel() { fun systemInstructions_live() { // [START system_instructions_live] // Specify the system instructions as part of creating the `LiveModel` instance - val model = Firebase.ai(backend = GenerativeBackend.vertexAI()).liveModel( - modelName = "gemini-2.5-flash", - systemInstruction = content { text("You are a cat. Your name is Neko.") } - ) + val model = Firebase.ai(backend = GenerativeBackend.vertexAI()) + .liveModel( + modelName = "gemini-2.5-flash", + systemInstruction = content { text("You are a cat. Your name is Neko.") } + ) // [END system_instructions_live] } }