Skip to content

Commit 4ab6b4c

Browse files
authored
feat(vertexai): Add Live streaming feature (#16991)
1 parent 4573a4d commit 4ab6b4c

26 files changed

+1987
-114
lines changed

packages/firebase_vertexai/firebase_vertexai/example/lib/main.dart

+12-2
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import 'pages/schema_page.dart';
2626
import 'pages/imagen_page.dart';
2727
import 'pages/document.dart';
2828
import 'pages/video_page.dart';
29+
import 'pages/bidi_page.dart';
2930

3031
// REQUIRED if you want to run on Web
3132
const FirebaseOptions? options = null;
@@ -35,9 +36,9 @@ void main() async {
3536
await Firebase.initializeApp();
3637
await FirebaseAuth.instance.signInAnonymously();
3738

38-
var vertex_instance =
39+
var vertexInstance =
3940
FirebaseVertexAI.instanceFor(auth: FirebaseAuth.instance);
40-
final model = vertex_instance.generativeModel(model: 'gemini-1.5-flash');
41+
final model = vertexInstance.generativeModel(model: 'gemini-1.5-flash');
4142

4243
runApp(GenerativeAISample(model: model));
4344
}
@@ -87,6 +88,7 @@ class _HomeScreenState extends State<HomeScreen> {
8788
SchemaPromptPage(title: 'Schema Prompt', model: widget.model),
8889
DocumentPage(title: 'Document Prompt', model: widget.model),
8990
VideoPage(title: 'Video Prompt', model: widget.model),
91+
BidiPage(title: 'Bidi Stream', model: widget.model),
9092
];
9193

9294
void _onItemTapped(int index) {
@@ -178,6 +180,14 @@ class _HomeScreenState extends State<HomeScreen> {
178180
label: 'Video Prompt',
179181
tooltip: 'Video Prompt',
180182
),
183+
BottomNavigationBarItem(
184+
icon: Icon(
185+
Icons.stream,
186+
color: Theme.of(context).colorScheme.primary,
187+
),
188+
label: 'Bidi Stream',
189+
tooltip: 'Bidi Stream',
190+
),
181191
],
182192
currentIndex: _selectedIndex,
183193
onTap: _onItemTapped,

0 commit comments

Comments
 (0)