@@ -55,7 +55,9 @@ class GoogleAISnippets : ViewModel() {
55
55
// Specify the config as part of creating the `GenerativeModel` instance
56
56
val model =
57
57
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)
59
61
60
62
// ...
61
63
// [END model_parameters_general]
@@ -79,7 +81,9 @@ class GoogleAISnippets : ViewModel() {
79
81
// Specify the config as part of creating the `GenerativeModel` instance
80
82
val model =
81
83
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)
83
87
84
88
// ...
85
89
// [END model_parameters_imagen]
@@ -104,7 +108,9 @@ class GoogleAISnippets : ViewModel() {
104
108
// Specify the config as part of creating the `LiveModel` instance
105
109
val model =
106
110
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)
108
114
109
115
// ...
110
116
// [END model_parameters_live]
@@ -165,21 +171,23 @@ class GoogleAISnippets : ViewModel() {
165
171
fun systemInstructions_general () {
166
172
// [START system_instructions_general]
167
173
// 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
+ )
172
179
// [END system_instructions_general]
173
180
}
174
181
175
182
@OptIn(PublicPreviewAPI ::class )
176
183
fun systemInstructions_live () {
177
184
// [START system_instructions_live]
178
185
// 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
+ )
183
191
// [END system_instructions_live]
184
192
}
185
193
}
0 commit comments