@@ -39,9 +39,9 @@ void functionCalling(FunctionDeclaration fetchWeatherTool) {
3939 GenerativeModelFutures .from (
4040 FirebaseAI .getInstance (GenerativeBackend .vertexAI ("global" ))
4141 .generativeModel (
42- "gemini-2.5-flash" ,
43- null ,
44- null ,
42+ /* modelName */ "gemini-2.5-flash" ,
43+ /* generationConfig (optional) */ null ,
44+ /* safetySettings (optional) */ null ,
4545 // Provide the function declaration to the model.
4646 List .of (Tool .functionDeclarations (List .of (fetchWeatherTool )))));
4747 // [END function_calling_specify_declaration_during_init]
@@ -65,7 +65,9 @@ public void modelConfiguration_model_parameters_general() {
6565 GenerativeModelFutures model =
6666 GenerativeModelFutures .from (
6767 FirebaseAI .getInstance (GenerativeBackend .vertexAI ())
68- .generativeModel ("gemini-2.5-flash" , config ));
68+ .generativeModel (
69+ /* modelName */ "gemini-2.5-flash" ,
70+ /* generationConfig (optional) */ null ));
6971
7072 // ...
7173 // [END model_parameters_general]
@@ -89,7 +91,9 @@ public void modelConfiguration_model_parameters_imagen() {
8991 // Specify the config as part of creating the `ImagenModel` instance
9092 ImagenModelFutures model =
9193 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 ));
9397
9498 // ...
9599 // [END model_parameters_imagen]
@@ -117,7 +121,9 @@ public void modelConfiguration_model_parameters_live() {
117121 LiveModelFutures model =
118122 LiveModelFutures .from (
119123 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 ));
121127
122128 // ...
123129 // [END model_parameters_live]
@@ -130,7 +136,9 @@ public void modelConfiguration_safety_settings_imagen() {
130136 ImagenModelFutures model =
131137 ImagenModelFutures .from (
132138 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 ));
134142
135143 // ...
136144 // [END safety_settings_imagen]
@@ -151,7 +159,7 @@ public void modelConfiguration_safety_settings_multiple() {
151159 .generativeModel (
152160 /* modelName */ "gemini-2.5-flash" ,
153161 /* generationConfig is optional */ null ,
154- List .of (harassmentSafety , hateSpeechSafety )));
162+ /* safetySettings */ List .of (harassmentSafety , hateSpeechSafety )));
155163
156164 // ...
157165 // [END safety_settings_multiple]
@@ -169,7 +177,7 @@ public void modelConfiguration_safety_settings_single() {
169177 .generativeModel (
170178 /* modelName */ "gemini-2.5-flash" ,
171179 /* generationConfig is optional */ null ,
172- Collections .singletonList (harassmentSafety )));
180+ /* safetySettings */ Collections .singletonList (harassmentSafety )));
173181
174182 // ...
175183 // [END safety_settings_single]
@@ -185,7 +193,9 @@ public void systemInstructions_general() {
185193 /* safetySettings (optional) */ null ,
186194 /* tools (optional) */ null ,
187195 /* 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 ()
189199 );
190200
191201 GenerativeModelFutures model = GenerativeModelFutures .from (ai );
@@ -198,10 +208,12 @@ public void systemInstructions_live() {
198208 // Specify the system instructions as part of creating the `LiveModel` instance
199209 LiveGenerativeModel ai = FirebaseAI .getInstance (GenerativeBackend .vertexAI ())
200210 .liveModel (
201- /* modelName */ "gemini-2.5 -flash" ,
211+ /* modelName */ "gemini-2.0 -flash-live-preview-04-09 " ,
202212 /* generationConfig (optional) */ null ,
203213 /* 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 ()
205217 );
206218
207219 LiveModelFutures model = LiveModelFutures .from (ai );
0 commit comments