From 75da8e9ce719a33c12c3be6be54281d9abf88606 Mon Sep 17 00:00:00 2001 From: Rosario Fernandes Date: Wed, 12 Nov 2025 20:40:41 +0000 Subject: [PATCH 1/3] feat: add gemini-2.5-pro and use nanobanana ga --- .../lib/demos/chat/models/gemini_model.dart | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/firebase_ai_logic_showcase/lib/demos/chat/models/gemini_model.dart b/firebase_ai_logic_showcase/lib/demos/chat/models/gemini_model.dart index 8b892af..91d9c86 100644 --- a/firebase_ai_logic_showcase/lib/demos/chat/models/gemini_model.dart +++ b/firebase_ai_logic_showcase/lib/demos/chat/models/gemini_model.dart @@ -18,7 +18,7 @@ class GeminiModel { } class GeminiModels { - String selectedModelName = 'gemini-2.5-flash-image-preview'; + String selectedModelName = 'gemini-2.5-flash-image'; GeminiModel get selectedModel => models[selectedModelName]!; /// A map of Gemini models that can be used in the Chat Demo. @@ -38,12 +38,12 @@ class GeminiModels { ), defaultPrompt: 'Hey Gemini! Can you set the app color to purple?', ), - 'gemini-2.5-flash-image-preview': GeminiModel( - name: 'gemini-2.5-flash-image-preview', + 'gemini-2.5-flash-image': GeminiModel( + name: 'gemini-2.5-flash-image', description: 'Our standard Flash model upgraded for rapid creative workflows with image generation and conversational, multi-turn editing capabilities.', model: FirebaseAI.googleAI().generativeModel( - model: 'gemini-2.5-flash-image-preview', + model: 'gemini-2.5-flash-image', generationConfig: GenerationConfig( responseModalities: [ ResponseModalities.text, @@ -55,6 +55,21 @@ class GeminiModels { 'Hot air balloons rising over the San Francisco Bay at golden hour ' 'with a view of the Golden Gate Bridge. Make it anime style.', ), + 'gemini-2.5-pro': GeminiModel( + name: 'gemini-2.5-pro', + description: + 'Our state-of-the-art thinking model, capable of reasoning over complex problems in code, math, and STEM, as well as analyzing large datasets, codebases, and documents using long context.', + model: FirebaseAI.googleAI().generativeModel( + model: 'gemini-2.5-pro', + tools: [ + Tool.functionDeclarations([setAppColorTool, generateImageTool]), + ], + generationConfig: GenerationConfig( + responseModalities: [ResponseModalities.text], + ), + ), + defaultPrompt: 'If you roll 2 dices, what are the odds that you roll "7" ?', + ), }; GeminiModel selectModel(String modelName) { From 85b9eec0db37433ef24c45c9c83e8c1cadef6336 Mon Sep 17 00:00:00 2001 From: Khanh Nguyen Date: Wed, 19 Nov 2025 00:10:54 -0800 Subject: [PATCH 2/3] set the GA nano banana model in Nano Banana demo --- .../lib/demos/chat_nano/chat_nano_demo.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/firebase_ai_logic_showcase/lib/demos/chat_nano/chat_nano_demo.dart b/firebase_ai_logic_showcase/lib/demos/chat_nano/chat_nano_demo.dart index 1ebabb3..82c399e 100644 --- a/firebase_ai_logic_showcase/lib/demos/chat_nano/chat_nano_demo.dart +++ b/firebase_ai_logic_showcase/lib/demos/chat_nano/chat_nano_demo.dart @@ -53,7 +53,7 @@ class ChatDemoNanoState extends ConsumerState { void initState() { super.initState(); _chatService = ChatService(ref); - geminiModels.selectModel('gemini-2.5-flash-image-preview'); + geminiModels.selectModel('gemini-2.5-flash-image'); _chatService.init(); _userTextInputController.text = 'Hot air balloons rising over the San Francisco Bay at golden hour with a view of the Golden Gate Bridge. Make it anime style.'; From 08b4c597f1567e2c0ebaebeee5224d22c3aa94e2 Mon Sep 17 00:00:00 2001 From: Khanh Nguyen Date: Wed, 19 Nov 2025 00:11:16 -0800 Subject: [PATCH 3/3] trailing comma --- firebase_ai_logic_showcase/lib/shared/models/gemini_model.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/firebase_ai_logic_showcase/lib/shared/models/gemini_model.dart b/firebase_ai_logic_showcase/lib/shared/models/gemini_model.dart index 5688b28..7eb36f2 100644 --- a/firebase_ai_logic_showcase/lib/shared/models/gemini_model.dart +++ b/firebase_ai_logic_showcase/lib/shared/models/gemini_model.dart @@ -82,7 +82,8 @@ class GeminiModels { responseModalities: [ResponseModalities.text], ), ), - defaultPrompt: 'If you roll 2 dices, what are the odds that you roll "7" ?', + defaultPrompt: + 'If you roll 2 dices, what are the odds that you roll "7" ?', ), };