@@ -55,7 +55,9 @@ class GoogleAISnippets : ViewModel() {
5555 // Specify the config as part of creating the `GenerativeModel` instance
5656 val model =
5757 Firebase .ai(backend = GenerativeBackend .googleAI())
58- .generativeModel(modelName = " gemini-2.5-flash" , generationConfig = config)
58+ .generativeModel(
59+ modelName = " gemini-2.5-flash" ,
60+ generationConfig = config)
5961
6062 // ...
6163 // [END model_parameters_general]
@@ -79,7 +81,9 @@ class GoogleAISnippets : ViewModel() {
7981 // Specify the config as part of creating the `GenerativeModel` instance
8082 val model =
8183 Firebase .ai(backend = GenerativeBackend .vertexAI())
82- .imagenModel(modelName = " imagen-4.0-generate-001" , generationConfig = config)
84+ .imagenModel(
85+ modelName = " imagen-4.0-generate-001" ,
86+ generationConfig = config)
8387
8488 // ...
8589 // [END model_parameters_imagen]
@@ -104,7 +108,9 @@ class GoogleAISnippets : ViewModel() {
104108 // Specify the config as part of creating the `LiveModel` instance
105109 val model =
106110 Firebase .ai(backend = GenerativeBackend .googleAI())
107- .liveModel(modelName = " gemini-2.5-flash" , generationConfig = config)
111+ .liveModel(
112+ modelName = " gemini-2.5-flash" ,
113+ generationConfig = config)
108114
109115 // ...
110116 // [END model_parameters_live]
@@ -165,21 +171,23 @@ class GoogleAISnippets : ViewModel() {
165171 fun systemInstructions_general () {
166172 // [START system_instructions_general]
167173 // Specify the system instructions as part of creating the `GenerativeModel` instance
168- val model = Firebase .ai(backend = GenerativeBackend .googleAI()).generativeModel(
169- modelName = " gemini-2.5-flash" ,
170- systemInstruction = content { text(" You are a cat. Your name is Neko." ) }
171- )
174+ val model = Firebase .ai(backend = GenerativeBackend .googleAI())
175+ .generativeModel(
176+ modelName = " gemini-2.5-flash" ,
177+ systemInstruction = content { text(" You are a cat. Your name is Neko." ) }
178+ )
172179 // [END system_instructions_general]
173180 }
174181
175182 @OptIn(PublicPreviewAPI ::class )
176183 fun systemInstructions_live () {
177184 // [START system_instructions_live]
178185 // Specify the system instructions as part of creating the `LiveModel` instance
179- val model = Firebase .ai(backend = GenerativeBackend .googleAI()).liveModel(
180- modelName = " gemini-2.5-flash" ,
181- systemInstruction = content { text(" You are a cat. Your name is Neko." ) }
182- )
186+ val model = Firebase .ai(backend = GenerativeBackend .googleAI())
187+ .liveModel(
188+ modelName = " gemini-2.5-flash" ,
189+ systemInstruction = content { text(" You are a cat. Your name is Neko." ) }
190+ )
183191 // [END system_instructions_live]
184192 }
185193}
0 commit comments