@@ -39,9 +39,9 @@ void functionCalling(FunctionDeclaration fetchWeatherTool) {
39
39
GenerativeModelFutures .from (
40
40
FirebaseAI .getInstance (GenerativeBackend .vertexAI ("global" ))
41
41
.generativeModel (
42
- "gemini-2.5-flash" ,
43
- null ,
44
- null ,
42
+ /* modelName */ "gemini-2.5-flash" ,
43
+ /* generationConfig (optional) */ null ,
44
+ /* safetySettings (optional) */ null ,
45
45
// Provide the function declaration to the model.
46
46
List .of (Tool .functionDeclarations (List .of (fetchWeatherTool )))));
47
47
// [END function_calling_specify_declaration_during_init]
@@ -65,7 +65,9 @@ public void modelConfiguration_model_parameters_general() {
65
65
GenerativeModelFutures model =
66
66
GenerativeModelFutures .from (
67
67
FirebaseAI .getInstance (GenerativeBackend .vertexAI ())
68
- .generativeModel ("gemini-2.5-flash" , config ));
68
+ .generativeModel (
69
+ /* modelName */ "gemini-2.5-flash" ,
70
+ /* generationConfig (optional) */ null ));
69
71
70
72
// ...
71
73
// [END model_parameters_general]
@@ -89,7 +91,9 @@ public void modelConfiguration_model_parameters_imagen() {
89
91
// Specify the config as part of creating the `ImagenModel` instance
90
92
ImagenModelFutures model =
91
93
ImagenModelFutures .from (
92
- FirebaseAI .getInstance (GenerativeBackend .vertexAI ()).imagenModel ("imagen-4.0-generate-001" , config ));
94
+ FirebaseAI .getInstance (GenerativeBackend .vertexAI ()).imagenModel (
95
+ /* modelName */ "imagen-4.0-generate-001" ,
96
+ /* imagenGenerationConfig (optional) */ config ));
93
97
94
98
// ...
95
99
// [END model_parameters_imagen]
@@ -117,7 +121,9 @@ public void modelConfiguration_model_parameters_live() {
117
121
LiveModelFutures model =
118
122
LiveModelFutures .from (
119
123
FirebaseAI .getInstance (GenerativeBackend .vertexAI ())
120
- .liveModel ("gemini-2.5-flash" , config ));
124
+ .liveModel (
125
+ /* modelName */ "gemini-2.0-flash-live-preview-04-09" ,
126
+ /* liveGenerationConfig (optional) */ config ));
121
127
122
128
// ...
123
129
// [END model_parameters_live]
@@ -130,7 +136,9 @@ public void modelConfiguration_safety_settings_imagen() {
130
136
ImagenModelFutures model =
131
137
ImagenModelFutures .from (
132
138
FirebaseAI .getInstance (GenerativeBackend .vertexAI ())
133
- .imagenModel (/* modelName */ "imagen-4.0-generate-001" , /* imageGenerationConfig */ null ));
139
+ .imagenModel (
140
+ /* modelName */ "imagen-4.0-generate-001" ,
141
+ /* imageGenerationConfig */ null ));
134
142
135
143
// ...
136
144
// [END safety_settings_imagen]
@@ -151,7 +159,7 @@ public void modelConfiguration_safety_settings_multiple() {
151
159
.generativeModel (
152
160
/* modelName */ "gemini-2.5-flash" ,
153
161
/* generationConfig is optional */ null ,
154
- List .of (harassmentSafety , hateSpeechSafety )));
162
+ /* safetySettings */ List .of (harassmentSafety , hateSpeechSafety )));
155
163
156
164
// ...
157
165
// [END safety_settings_multiple]
@@ -169,7 +177,7 @@ public void modelConfiguration_safety_settings_single() {
169
177
.generativeModel (
170
178
/* modelName */ "gemini-2.5-flash" ,
171
179
/* generationConfig is optional */ null ,
172
- Collections .singletonList (harassmentSafety )));
180
+ /* safetySettings */ Collections .singletonList (harassmentSafety )));
173
181
174
182
// ...
175
183
// [END safety_settings_single]
@@ -185,7 +193,9 @@ public void systemInstructions_general() {
185
193
/* safetySettings (optional) */ null ,
186
194
/* tools (optional) */ null ,
187
195
/* toolsConfig (optional) */ null ,
188
- /* systemInstruction (optional) */ new Content .Builder ().addText ("You are a cat. Your name is Neko." ).build ()
196
+ /* systemInstruction (optional) */ new Content .Builder ()
197
+ .addText ("You are a cat. Your name is Neko." )
198
+ .build ()
189
199
);
190
200
191
201
GenerativeModelFutures model = GenerativeModelFutures .from (ai );
@@ -198,10 +208,12 @@ public void systemInstructions_live() {
198
208
// Specify the system instructions as part of creating the `LiveModel` instance
199
209
LiveGenerativeModel ai = FirebaseAI .getInstance (GenerativeBackend .vertexAI ())
200
210
.liveModel (
201
- /* modelName */ "gemini-2.5 -flash" ,
211
+ /* modelName */ "gemini-2.0 -flash-live-preview-04-09 " ,
202
212
/* generationConfig (optional) */ null ,
203
213
/* tools (optional) */ null ,
204
- /* systemInstruction (optional) */ new Content .Builder ().addText ("You are a cat. Your name is Neko." ).build ()
214
+ /* systemInstruction (optional) */ new Content .Builder ()
215
+ .addText ("You are a cat. Your name is Neko." )
216
+ .build ()
205
217
);
206
218
207
219
LiveModelFutures model = LiveModelFutures .from (ai );
0 commit comments