Skip to content

Commit e0cab31

Browse files
authored
feat: GenAI packages (#840)
1 parent 9644d0a commit e0cab31

159 files changed

Lines changed: 5190 additions & 24 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/code-analysis.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,30 @@ jobs:
9595
working-directory: ./packages/google_mlkit_subject_segmentation
9696
run: flutter pub get
9797

98+
- name: Install dependencies for google_mlkit_genai_summarization
99+
working-directory: ./packages/google_mlkit_genai_summarization
100+
run: flutter pub get
101+
102+
- name: Install dependencies for google_mlkit_genai_proofreading
103+
working-directory: ./packages/google_mlkit_genai_proofreading
104+
run: flutter pub get
105+
106+
- name: Install dependencies for google_mlkit_genai_rewriting
107+
working-directory: ./packages/google_mlkit_genai_rewriting
108+
run: flutter pub get
109+
110+
- name: Install dependencies for google_mlkit_genai_image_description
111+
working-directory: ./packages/google_mlkit_genai_image_description
112+
run: flutter pub get
113+
114+
- name: Install dependencies for google_mlkit_genai_speech_recognition
115+
working-directory: ./packages/google_mlkit_genai_speech_recognition
116+
run: flutter pub get
117+
118+
- name: Install dependencies for google_mlkit_genai_prompt
119+
working-directory: ./packages/google_mlkit_genai_prompt
120+
run: flutter pub get
121+
98122
- name: Install dependencies for example
99123
working-directory: ./packages/example
100124
run: flutter pub get

CHANGELOG.md

Lines changed: 72 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,20 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
1111

1212
Packages with changes:
1313

14-
- [`google_ml_kit` - `v0.20.1`](#google_ml_kit---v0201)
14+
- [`google_ml_kit` - `v0.21.0`](#google_ml_kit---v0210)
1515
- [`google_mlkit_barcode_scanning` - `v0.14.2`](#google_mlkit_barcode_scanning---v0142)
1616
- [`google_mlkit_commons` - `v0.11.1`](#google_mlkit_commons---v0111)
1717
- [`google_mlkit_digital_ink_recognition` - `v0.14.2`](#google_mlkit_digital_ink_recognition---v0142)
1818
- [`google_mlkit_document_scanner` - `v0.4.1`](#google_mlkit_document_scanner---v041)
1919
- [`google_mlkit_entity_extraction` - `v0.15.3`](#google_mlkit_entity_extraction---v0153)
2020
- [`google_mlkit_face_detection` - `v0.13.2`](#google_mlkit_face_detection---v0132)
2121
- [`google_mlkit_face_mesh_detection` - `v0.4.2`](#google_mlkit_face_mesh_detection---v042)
22+
- [`google_mlkit_genai_image_description` - `v0.1.0`](#google_mlkit_genai_image_description---v010)
23+
- [`google_mlkit_genai_proofreading` - `v0.1.0`](#google_mlkit_genai_proofreading---v010)
24+
- [`google_mlkit_genai_prompt` - `v0.1.0`](#google_mlkit_genai_prompt---v010)
25+
- [`google_mlkit_genai_rewriting` - `v0.1.0`](#google_mlkit_genai_rewriting---v010)
26+
- [`google_mlkit_genai_speech_recognition` - `v0.1.0`](#google_mlkit_genai_speech_recognition---v010)
27+
- [`google_mlkit_genai_summarization` - `v0.1.0`](#google_mlkit_genai_summarization---v010)
2228
- [`google_mlkit_image_labeling` - `v0.14.2`](#google_mlkit_image_labeling---v0142)
2329
- [`google_mlkit_language_id` - `v0.13.1`](#google_mlkit_language_id---v0131)
2430
- [`google_mlkit_object_detection` - `v0.15.1`](#google_mlkit_object_detection---v0151)
@@ -31,11 +37,75 @@ Packages with changes:
3137

3238
---
3339

34-
#### `google_ml_kit` - `v0.20.1`
40+
#### `google_ml_kit` - `v0.21.0`
3541

42+
* Add support for Google's ML Kit GenAI APIs:
43+
- `google_mlkit_genai_summarization` - Generate summaries of articles and conversations
44+
- `google_mlkit_genai_proofreading` - Check grammar and spelling
45+
- `google_mlkit_genai_rewriting` - Rewrite text in different styles
46+
- `google_mlkit_genai_image_description` - Generate descriptions for images
47+
- `google_mlkit_genai_speech_recognition` - Transcribe speech to text
48+
- `google_mlkit_genai_prompt` - Generate text content based on custom prompts
3649
* Update all native dependencies to latest versions
3750
* See individual package changelogs for specific version updates
3851

52+
#### `google_mlkit_genai_summarization` - `v0.1.0`
53+
54+
* Initial release of Google's ML Kit GenAI Summarization API for Flutter
55+
* Support for Android platform (API level 26+)
56+
* Features:
57+
- Generate summaries of articles and conversations
58+
- Support for multiple input types (article, conversation)
59+
- Support for multiple output types (1-3 bullet points)
60+
- Support for multiple languages (English, Japanese, Korean)
61+
- Feature status checking and downloading
62+
63+
#### `google_mlkit_genai_proofreading` - `v0.1.0`
64+
65+
* Initial release of Google's ML Kit GenAI Proofreading API for Flutter
66+
* Support for Android platform (API level 26+)
67+
* Features:
68+
- Check grammar and spelling in text
69+
- Support for multiple input types (keyboard, voice)
70+
- Support for multiple languages (English, Japanese, French, German, Italian, Spanish, Korean)
71+
- Feature status checking and downloading
72+
73+
#### `google_mlkit_genai_rewriting` - `v0.1.0`
74+
75+
* Initial release of Google's ML Kit GenAI Rewriting API for Flutter
76+
* Support for Android platform (API level 26+)
77+
* Features:
78+
- Rewrite text in different styles (formal, concise, emoji)
79+
- Support for multiple languages (English, Japanese, Korean)
80+
- Feature status checking and downloading
81+
82+
#### `google_mlkit_genai_image_description` - `v0.1.0`
83+
84+
* Initial release of Google's ML Kit GenAI Image Description API for Flutter
85+
* Support for Android platform (API level 26+)
86+
* Features:
87+
- Generate descriptions for images
88+
- Support for multiple image input formats
89+
- Feature status checking and downloading
90+
91+
#### `google_mlkit_genai_speech_recognition` - `v0.1.0`
92+
93+
* Initial release of Google's ML Kit GenAI Speech Recognition API for Flutter
94+
* Support for Android platform (API level 26+)
95+
* Features:
96+
- Transcribe speech to text in real time
97+
- Streaming recognition support
98+
- Feature status checking
99+
100+
#### `google_mlkit_genai_prompt` - `v0.1.0`
101+
102+
* Initial release of Google's ML Kit GenAI Prompt API for Flutter
103+
* Support for Android platform (API level 26+)
104+
* Features:
105+
- Generate text content based on custom prompts
106+
- Support for text-only and multimodal (image + text) prompts
107+
- Feature status checking and downloading
108+
39109
#### `google_mlkit_barcode_scanning` - `v0.14.2`
40110

41111
* Update Android native library `com.google.mlkit:barcode-scanning` to 17.3.0

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2021 Bharat Biradar and Francisco Bernal.
3+
Copyright (c) 2026 flutter-ml.dev.
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,21 @@ Google's ML Kit for Flutter is a set of [Flutter plugins](https://flutter.io/pla
2929
| [Smart Reply](https://developers.google.com/ml-kit/language/smart-reply) | [google_mlkit_smart_reply](https://pub.dev/packages/google_mlkit_smart_reply) [![Pub Version](https://img.shields.io/pub/v/google_mlkit_smart_reply)](https://pub.dev/packages/google_mlkit_smart_reply) | [![GitHub](https://img.shields.io/badge/github-%23121011.svg?style=for-the-badge&logo=github&logoColor=white)](https://github.com/flutter-ml/google_ml_kit_flutter/tree/master/packages/google_mlkit_smart_reply) |||
3030
| [Entity Extraction (Beta)](https://developers.google.com/ml-kit/language/entity-extraction) | [google_mlkit_entity_extraction](https://pub.dev/packages/google_mlkit_entity_extraction) [![Pub Version](https://img.shields.io/pub/v/google_mlkit_entity_extraction)](https://pub.dev/packages/google_mlkit_entity_extraction) | [![GitHub](https://img.shields.io/badge/github-%23121011.svg?style=for-the-badge&logo=github&logoColor=white)](https://github.com/flutter-ml/google_ml_kit_flutter/tree/master/packages/google_mlkit_entity_extraction) |||
3131

32+
### GenAI APIs
33+
34+
> **⚠️ Important:** GenAI APIs are built on top of AICore and will not support all Android devices. These APIs require devices with AICore support. Please check device compatibility before using these features in production.
35+
>
36+
> **⚠️ Production Disclaimer:** Using GenAI plugins in production is the responsibility of the developers consuming the plugins, not the authors. The authors provide these plugins as-is and are not responsible for any issues, failures, or compatibility problems that may arise from using these plugins in production environments.
37+
38+
| Feature | Plugin | Source Code | Android | iOS |
39+
|---------------------------------------------------------------------------------------------| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | --- |
40+
| [Summarization (Beta)](https://developers.google.com/ml-kit/genai/summarization) | [google_mlkit_genai_summarization](https://pub.dev/packages/google_mlkit_genai_summarization) [![Pub Version](https://img.shields.io/pub/v/google_mlkit_genai_summarization)](https://pub.dev/packages/google_mlkit_genai_summarization) | [![GitHub](https://img.shields.io/badge/github-%23121011.svg?style=for-the-badge&logo=github&logoColor=white)](https://github.com/flutter-ml/google_ml_kit_flutter/tree/master/packages/google_mlkit_genai_summarization) |||
41+
| [Proofreading (Beta)](https://developers.google.com/ml-kit/genai/proofreading) | [google_mlkit_genai_proofreading](https://pub.dev/packages/google_mlkit_genai_proofreading) [![Pub Version](https://img.shields.io/pub/v/google_mlkit_genai_proofreading)](https://pub.dev/packages/google_mlkit_genai_proofreading) | [![GitHub](https://img.shields.io/badge/github-%23121011.svg?style=for-the-badge&logo=github&logoColor=white)](https://github.com/flutter-ml/google_ml_kit_flutter/tree/master/packages/google_mlkit_genai_proofreading) |||
42+
| [Rewriting (Beta)](https://developers.google.com/ml-kit/genai/rewriting) | [google_mlkit_genai_rewriting](https://pub.dev/packages/google_mlkit_genai_rewriting) [![Pub Version](https://img.shields.io/pub/v/google_mlkit_genai_rewriting)](https://pub.dev/packages/google_mlkit_genai_rewriting) | [![GitHub](https://img.shields.io/badge/github-%23121011.svg?style=for-the-badge&logo=github&logoColor=white)](https://github.com/flutter-ml/google_ml_kit_flutter/tree/master/packages/google_mlkit_genai_rewriting) |||
43+
| [Image Description (Beta)](https://developers.google.com/ml-kit/genai/image-description) | [google_mlkit_genai_image_description](https://pub.dev/packages/google_mlkit_genai_image_description) [![Pub Version](https://img.shields.io/pub/v/google_mlkit_genai_image_description)](https://pub.dev/packages/google_mlkit_genai_image_description) | [![GitHub](https://img.shields.io/badge/github-%23121011.svg?style=for-the-badge&logo=github&logoColor=white)](https://github.com/flutter-ml/google_ml_kit_flutter/tree/master/packages/google_mlkit_genai_image_description) |||
44+
| [Speech Recognition (Alpha)](https://developers.google.com/ml-kit/genai/speech-recognition) | [google_mlkit_genai_speech_recognition](https://pub.dev/packages/google_mlkit_genai_speech_recognition) [![Pub Version](https://img.shields.io/pub/v/google_mlkit_genai_speech_recognition)](https://pub.dev/packages/google_mlkit_genai_speech_recognition) | [![GitHub](https://img.shields.io/badge/github-%23121011.svg?style=for-the-badge&logo=github&logoColor=white)](https://github.com/flutter-ml/google_ml_kit_flutter/tree/master/packages/google_mlkit_genai_speech_recognition) |||
45+
| [Prompt (Beta)](https://developers.google.com/ml-kit/genai/prompt) | [google_mlkit_genai_prompt](https://pub.dev/packages/google_mlkit_genai_prompt) [![Pub Version](https://img.shields.io/pub/v/google_mlkit_genai_prompt)](https://pub.dev/packages/google_mlkit_genai_prompt) | [![GitHub](https://img.shields.io/badge/github-%23121011.svg?style=for-the-badge&logo=github&logoColor=white)](https://github.com/flutter-ml/google_ml_kit_flutter/tree/master/packages/google_mlkit_genai_prompt) |||
46+
3247
**PLEASE READ THIS** before continuing or posting a [new issue](https://github.com/flutter-ml/google_ml_kit_flutter/issues):
3348

3449
- [Google's ML Kit](https://developers.google.com/ml-kit) was build only for mobile platforms: iOS and Android apps. Web or any other platform is not supported, you can request support for those platform to Google in [their repo](https://github.com/googlesamples/mlkit/issues).

packages/example/ios/Podfile.lock

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,18 @@ PODS:
2424
- google_mlkit_face_mesh_detection (0.4.2):
2525
- Flutter
2626
- google_mlkit_commons
27+
- google_mlkit_genai_image_description (0.1.0):
28+
- Flutter
29+
- google_mlkit_genai_prompt (0.1.0):
30+
- Flutter
31+
- google_mlkit_genai_proofreading (0.1.0):
32+
- Flutter
33+
- google_mlkit_genai_rewriting (0.1.0):
34+
- Flutter
35+
- google_mlkit_genai_speech_recognition (0.1.0):
36+
- Flutter
37+
- google_mlkit_genai_summarization (0.1.0):
38+
- Flutter
2739
- google_mlkit_image_labeling (0.14.2):
2840
- Flutter
2941
- google_mlkit_commons
@@ -272,6 +284,12 @@ DEPENDENCIES:
272284
- google_mlkit_entity_extraction (from `.symlinks/plugins/google_mlkit_entity_extraction/ios`)
273285
- google_mlkit_face_detection (from `.symlinks/plugins/google_mlkit_face_detection/ios`)
274286
- google_mlkit_face_mesh_detection (from `.symlinks/plugins/google_mlkit_face_mesh_detection/ios`)
287+
- google_mlkit_genai_image_description (from `.symlinks/plugins/google_mlkit_genai_image_description/ios`)
288+
- google_mlkit_genai_prompt (from `.symlinks/plugins/google_mlkit_genai_prompt/ios`)
289+
- google_mlkit_genai_proofreading (from `.symlinks/plugins/google_mlkit_genai_proofreading/ios`)
290+
- google_mlkit_genai_rewriting (from `.symlinks/plugins/google_mlkit_genai_rewriting/ios`)
291+
- google_mlkit_genai_speech_recognition (from `.symlinks/plugins/google_mlkit_genai_speech_recognition/ios`)
292+
- google_mlkit_genai_summarization (from `.symlinks/plugins/google_mlkit_genai_summarization/ios`)
275293
- google_mlkit_image_labeling (from `.symlinks/plugins/google_mlkit_image_labeling/ios`)
276294
- google_mlkit_language_id (from `.symlinks/plugins/google_mlkit_language_id/ios`)
277295
- google_mlkit_object_detection (from `.symlinks/plugins/google_mlkit_object_detection/ios`)
@@ -345,6 +363,18 @@ EXTERNAL SOURCES:
345363
:path: ".symlinks/plugins/google_mlkit_face_detection/ios"
346364
google_mlkit_face_mesh_detection:
347365
:path: ".symlinks/plugins/google_mlkit_face_mesh_detection/ios"
366+
google_mlkit_genai_image_description:
367+
:path: ".symlinks/plugins/google_mlkit_genai_image_description/ios"
368+
google_mlkit_genai_prompt:
369+
:path: ".symlinks/plugins/google_mlkit_genai_prompt/ios"
370+
google_mlkit_genai_proofreading:
371+
:path: ".symlinks/plugins/google_mlkit_genai_proofreading/ios"
372+
google_mlkit_genai_rewriting:
373+
:path: ".symlinks/plugins/google_mlkit_genai_rewriting/ios"
374+
google_mlkit_genai_speech_recognition:
375+
:path: ".symlinks/plugins/google_mlkit_genai_speech_recognition/ios"
376+
google_mlkit_genai_summarization:
377+
:path: ".symlinks/plugins/google_mlkit_genai_summarization/ios"
348378
google_mlkit_image_labeling:
349379
:path: ".symlinks/plugins/google_mlkit_image_labeling/ios"
350380
google_mlkit_language_id:
@@ -373,6 +403,12 @@ SPEC CHECKSUMS:
373403
google_mlkit_entity_extraction: 45de8519319089085569ef9e10e2500b8d0d55a0
374404
google_mlkit_face_detection: ee4b72cfae062b4c972204be955d83055a4bfd36
375405
google_mlkit_face_mesh_detection: 644aad01e609e0962bc38495d1d807e2ae9f5e1b
406+
google_mlkit_genai_image_description: 84e90c2ad87ae5e2f05cc4d5f1924059c799fc12
407+
google_mlkit_genai_prompt: f4a41c9548172a86c6723e5c83c1c3295b6ad299
408+
google_mlkit_genai_proofreading: 09ca9edfaa66e58ff165d2047286c10ba0a831ca
409+
google_mlkit_genai_rewriting: 7a647b345cf7d9fe8fda004142ca980abbba9724
410+
google_mlkit_genai_speech_recognition: 783fd846946877dc812a81d629c676b41973ce72
411+
google_mlkit_genai_summarization: 8d750cfca622746aef09d6521bf2e764e8647ded
376412
google_mlkit_image_labeling: 6f6fdb11c14600e01898e59a8c4413b255ede272
377413
google_mlkit_language_id: de6f5cc02967420549c3c3a1624b359217442db9
378414
google_mlkit_object_detection: 6a81b32faf7a9b700bed7a2caa67254818553257

packages/example/lib/main.dart

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,26 @@ class Home extends StatelessWidget {
8585
CustomCard('Entity Extraction', EntityExtractionView()),
8686
],
8787
),
88+
SizedBox(
89+
height: 20,
90+
),
91+
if (Platform.isAndroid)
92+
ExpansionTile(
93+
title: const Text('GenAI APIs'),
94+
children: [
95+
CustomCard('Summarization',
96+
_GenAIPlaceholderView('Summarization')),
97+
CustomCard('Proofreading',
98+
_GenAIPlaceholderView('Proofreading')),
99+
CustomCard(
100+
'Rewriting', _GenAIPlaceholderView('Rewriting')),
101+
CustomCard('Image Description',
102+
_GenAIPlaceholderView('Image Description')),
103+
CustomCard('Speech Recognition',
104+
_GenAIPlaceholderView('Speech Recognition')),
105+
CustomCard('Prompt', _GenAIPlaceholderView('Prompt')),
106+
],
107+
),
88108
],
89109
),
90110
),
@@ -95,6 +115,55 @@ class Home extends StatelessWidget {
95115
}
96116
}
97117

118+
class _GenAIPlaceholderView extends StatelessWidget {
119+
final String featureName;
120+
121+
const _GenAIPlaceholderView(this.featureName);
122+
123+
@override
124+
Widget build(BuildContext context) {
125+
return Scaffold(
126+
appBar: AppBar(
127+
title: Text('$featureName (GenAI)'),
128+
),
129+
body: Center(
130+
child: Padding(
131+
padding: const EdgeInsets.all(16.0),
132+
child: Column(
133+
mainAxisAlignment: MainAxisAlignment.center,
134+
children: [
135+
Icon(
136+
Icons.info_outline,
137+
size: 64,
138+
color: Colors.blue,
139+
),
140+
SizedBox(height: 16),
141+
Text(
142+
'$featureName API',
143+
style: Theme.of(context).textTheme.headlineSmall,
144+
),
145+
SizedBox(height: 16),
146+
Text(
147+
'This GenAI feature is available on Android devices with API level 26 or higher.',
148+
textAlign: TextAlign.center,
149+
style: Theme.of(context).textTheme.bodyMedium,
150+
),
151+
SizedBox(height: 8),
152+
Text(
153+
'Implementation coming soon.',
154+
textAlign: TextAlign.center,
155+
style: Theme.of(context).textTheme.bodySmall?.copyWith(
156+
fontStyle: FontStyle.italic,
157+
),
158+
),
159+
],
160+
),
161+
),
162+
),
163+
);
164+
}
165+
}
166+
98167
class CustomCard extends StatelessWidget {
99168
final String _label;
100169
final Widget _viewPage;

0 commit comments

Comments
 (0)