From cb4740fc6757f93b6fe33927e08c65cb52e1f8d0 Mon Sep 17 00:00:00 2001 From: Greg Spencer Date: Tue, 11 Nov 2025 18:46:56 -0800 Subject: [PATCH 1/4] Adding file lost in merge --- packages/genui/README.md | 489 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 489 insertions(+) create mode 100644 packages/genui/README.md diff --git a/packages/genui/README.md b/packages/genui/README.md new file mode 100644 index 000000000..cecee14d1 --- /dev/null +++ b/packages/genui/README.md @@ -0,0 +1,489 @@ +# genui + +A Flutter package for building dynamic, conversational user interfaces powered by generative AI models. + +`genui` allows you to create applications where the UI is not static or predefined, but is instead constructed by an AI in real-time based on a conversation with the user. This enables highly flexible, context-aware, and interactive user experiences. + +This package provides the core functionality for GenUI. For concrete implementations, see the `genui_firebase_ai` package (for Firebase AI) or the `genui_a2ui` package (for a generic A2UI server). + +## Features + +- **Dynamic UI Generation**: Render Flutter UIs from structured data returned by a generative AI. +- **Simplified Conversation Flow**: A high-level `GenUiConversation` facade manages the interaction loop with the AI. +- **Customizable Widget Catalog**: Define a "vocabulary" of Flutter widgets that the AI can use to build the interface. +- **Extensible Content Generator**: Abstract interface for connecting to different AI model backends. +- **Event Handling**: Capture user interactions (button clicks, text input), update a client-side data model, and send the state back to the AI as context for the next turn in the conversation. +- **Reactive UI**: Widgets automatically rebuild when the data they are bound to changes in the data model. + +## Core Concepts + +The package is built around the following main components: + +1. **`GenUiConversation`**: The primary facade and entry point for the package. It encapsulates the `GenUiManager` and `ContentGenerator`, manages the conversation history, and orchestrates the entire generative UI process. + +2. **`Catalog`**: A collection of `CatalogItem`s that defines the set of widgets the AI is allowed to use. Each `CatalogItem` specifies a widget's name (for the AI to reference), a data schema for its properties, and a builder function to render the Flutter widget. + +3. **`DataModel`**: A centralized, observable store for all dynamic UI state. Widgets are "bound" to data in this model. When data changes, only the widgets that depend on that specific piece of data are rebuilt. + +4. **`ContentGenerator`**: An interface for communicating with a generative AI model. This interface uses streams to send `A2uiMessage` commands, text responses, and errors back to the `GenUiConversation`. + +5. **`A2uiMessage`**: A message sent from the AI (via the `ContentGenerator`) to the UI, instructing it to perform actions like `beginRendering`, `surfaceUpdate`, `dataModelUpdate`, or `deleteSurface`. + +## How It Works + +The `GenUiConversation` manages the interaction cycle: + +1. **User Input**: The user provides a prompt (e.g., through a text field). The app calls `genUiConversation.sendRequest()`. +2. **AI Invocation**: The `GenUiConversation` adds the user's message to its internal conversation history and calls `contentGenerator.sendRequest()`. +3. **AI Response**: The `ContentGenerator` interacts with the AI model. The AI, guided by the widget schemas, sends back responses. +4. **Stream Handling**: The `ContentGenerator` emits `A2uiMessage`s, text responses, or errors on its streams. +5. **UI State Update**: `GenUiConversation` listens to these streams. `A2uiMessage`s are passed to `GenUiManager.handleMessage()`, which updates the UI state and `DataModel`. +6. **UI Rendering**: The `GenUiManager` broadcasts an update, and any `GenUiSurface` widgets listening for that surface ID will rebuild. Widgets are bound to the `DataModel`, so they update automatically when their data changes. +7. **Callbacks**: Text responses and errors trigger the `onTextResponse` and `onError` callbacks on `GenUiConversation`. +8. **User Interaction**: The user interacts with the newly generated UI (e.g., by typing in a text field). This interaction directly updates the `DataModel`. If the interaction is an action (like a button click), the `GenUiSurface` captures the event and forwards it to the `GenUiConversation`'s `GenUiManager`, which automatically creates a new `UserMessage` containing the current state of the data model and restarts the cycle. + +```mermaid +graph TD + subgraph "User" + UserInput("Provide Prompt") + UserInteraction("Interact with UI") + end + + subgraph "GenUI Framework" + GenUiConversation("GenUiConversation") + ContentGenerator("ContentGenerator") + GenUiManager("GenUiManager") + GenUiSurface("GenUiSurface") + end + + UserInput -- "calls sendRequest()" --> GenUiConversation; + GenUiConversation -- "sends prompt" --> ContentGenerator; + ContentGenerator -- "returns A2UI messages" --> GenUiConversation; + GenUiConversation -- "handles messages" --> GenUiManager; + GenUiManager -- "notifies of updates" --> GenUiSurface; + GenUiSurface -- "renders UI" --> UserInteraction; + UserInteraction -- "creates event" --> GenUiSurface; + GenUiSurface -- "sends event to host" --> GenUiManager; + GenUiManager -- "sends user input to" --> GenUiConversation; +``` + +See [DESIGN.md](./DESIGN.md) for more detailed information about the design. + +## Getting Started with `genui` + +This guidance explains how to quickly get started with the +[`genui`](https://pub.dev/packages/genui) package. + +### 1. Add `genui` to your app + +Use the following instructions to add `genui` to your Flutter app. The +code examples show how to perform the instructions on a brand new app created by +running `flutter create`. + +### 2. Configure your agent provider + +`genui` can connect to a variety of agent providers. Choose the section +below for your preferred provider. + +#### Configure Firebase AI Logic + +To use the built-in `FirebaseAiContentGenerator` to connect to Gemini via Firebase AI +Logic, follow these instructions: + +1. [Create a new Firebase project](https://support.google.com/appsheet/answer/10104995) + using the Firebase Console. +2. [Enable the Gemini API](https://firebase.google.com/docs/gemini-in-firebase/set-up-gemini) + for that project. +3. Follow the first three steps in + [Firebase's Flutter Setup guide](https://firebase.google.com/docs/flutter/setup) + to add Firebase to your app. +4. In `pubspec.yaml`, add `genui` and `genui_firebase_ai` to the + `dependencies` section. + + ```yaml + dependencies: + # ... + genui: 0.5.0 + genui_firebase_ai: 0.5.0 + ``` + +5. In your app's `main` method, ensure that the widget bindings are initialized, + and then initialize Firebase. + + ```dart + void main() async { + WidgetsFlutterBinding.ensureInitialized(); + await Firebase.initializeApp(options: DefaultFirebaseOptions.currentPlatform); + runApp(const MyApp()); + } + ``` + +#### Configure another agent provider + +To use `genui` with another agent provider, you need to follow that +provider's instructions to configure your app, and then create your own subclass +of `ContentGenerator` to connect to that provider. Use `FirebaseAiContentGenerator` or +`A2uiContentGenerator` (from the `genui_a2ui` package) as examples +of how to do so. + +### 3. Create the connection to an agent + +If you build your Flutter project for iOS or macOS, add this key to your +`{ios,macos}/Runner/*.entitlements` file(s) to enable outbound network +requests: + +```xml + +... +com.apple.security.network.client + + +``` + +Next, use the following instructions to connect your app to your chosen agent +provider. + +1. Create a `GenUiManager`, and provide it with the catalog of widgets you want + to make available to the agent. +2. Create a `ContentGenerator`, and provide it with a system instruction and a set of + tools (functions you want the agent to be able to invoke). You should always + include those provided by `GenUiManager`, but feel free to include others. +3. Create a `GenUiConversation` using the instances of `ContentGenerator` and `GenUiManager`. Your + app will primarily interact with this object to get things done. + + For example: + + ```dart + class _MyHomePageState extends State { + late final GenUiManager _genUiManager; + late final GenUiConversation _genUiConversation; + + @override + void initState() { + super.initState(); + + // Create a GenUiManager with a widget catalog. + // The CoreCatalogItems contain basic widgets for text, markdown, and images. + _genUiManager = GenUiManager(catalog: CoreCatalogItems.asCatalog()); + + // Create a ContentGenerator to communicate with the LLM. + // Provide system instructions and the tools from the GenUiManager. + final contentGenerator = FirebaseAiContentGenerator( + systemInstruction: ''' + You are an expert in creating funny riddles. Every time I give you a word, + you should generate UI that displays one new riddle related to that word. + Each riddle should have both a question and an answer. + ''', + tools: _genUiManager.getTools(), + ); + + // Create the GenUiConversation to orchestrate everything. + _genUiConversation = GenUiConversation( + genUiManager: _genUiManager, + contentGenerator: contentGenerator, + onSurfaceAdded: _onSurfaceAdded, // Added in the next step. + onSurfaceDeleted: _onSurfaceDeleted, // Added in the next step. + ); + } + + @override + void dispose() { + _textController.dispose(); + _genUiConversation.dispose(); + + super.dispose(); + } + } + ``` + +### 4. Send messages and display the agent's responses + +Send a message to the agent using the `sendRequest` method in the `GenUiConversation` +class. + +To receive and display generated UI: + +1. Use `GenUiConversation`'s callbacks to track the addition and removal of UI surfaces as + they are generated. These events include a "surface ID" for each surface. +2. Build a `GenUiSurface` widget for each active surface using the surface IDs + received in the previous step. + + For example: + + ```dart + class _MyHomePageState extends State { + + // ... + + final _textController = TextEditingController(); + final _surfaceIds = []; + + // Send a message containing the user's text to the agent. + void _sendMessage(String text) { + if (text.trim().isEmpty) return; + _genUiConversation.sendRequest(UserMessage.text(text)); + } + + // A callback invoked by the [GenUiConversation] when a new UI surface is generated. + // Here, the ID is stored so the build method can create a GenUiSurface to + // display it. + void _onSurfaceAdded(SurfaceAdded update) { + setState(() { + _surfaceIds.add(update.surfaceId); + }); + } + + // A callback invoked by GenUiConversation when a UI surface is removed. + void _onSurfaceDeleted(SurfaceRemoved update) { + setState(() { + _surfaceIds.remove(update.surfaceId); + }); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: AppBar( + backgroundColor: Theme.of(context).colorScheme.inversePrimary, + title: Text(widget.title), + ), + body: Column( + children: [ + Expanded( + child: ListView.builder( + itemCount: _surfaceIds.length, + itemBuilder: (context, index) { + // For each surface, create a GenUiSurface to display it. + final id = _surfaceIds[index]; + return GenUiSurface(host: _genUiConversation.host, surfaceId: id); + }, + ), + ), + SafeArea( + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 16.0), + child: Row( + children: [ + Expanded( + child: TextField( + controller: _textController, + decoration: const InputDecoration( + hintText: 'Enter a message', + ), + ), + ), + const SizedBox(width: 16), + ElevatedButton( + onPressed: () { + // Send the user's text to the agent. + _sendMessage(_textController.text); + _textController.clear(); + }, + child: const Text('Send'), + ), + ], + ), + ), + ), + ], + ), + ); + } + } + ``` + +### 5. [Optional] Add your own widgets to the catalog + +In addition to using the catalog of widgets in `CoreCatalogItems`, you can +create custom widgets for the agent to generate. Use the following +instructions. + +#### Import `json_schema_builder` + +Add the `json_schema_builder` package as a dependency in `pubspec.yaml`. Use the +same commit reference as the one for `genui`. + +```yaml +dependencies: + # ... + json_schema_builder: + git: + url: https://github.com/flutter/genui.git + path: packages/json_schema_builder + +``` + +#### Create the new widget's schema + +Each catalog item needs a schema that defines the data required to populate it. +Using the `json_schema_builder` package, define one for the new widget. + +```dart +import 'package:json_schema_builder/json_schema_builder.dart'; +import 'package:flutter/material.dart'; +import 'package:genui/genui.dart'; + +final _schema = S.object( + properties: { + 'question': S.string(description: 'The question part of a riddle.'), + 'answer': S.string(description: 'The answer part of a riddle.'), + }, + required: ['question', 'answer'], +); +``` + +#### Create a `CatalogItem` + +Each `CatalogItem` represents a type of widget that the agent is allowed to +generate. To do that, combines a name, a schema, and a builder function that +produces the widgets that compose the generated UI. + +```dart +final riddleCard = CatalogItem( + name: 'RiddleCard', + dataSchema: _schema, + widgetBuilder: + ({ + required data, + required id, + required buildChild, + required dispatchEvent, + required context, + required dataContext, + }) { + final json = data as Map; + final question = json['question'] as String; + final answer = json['answer'] as String; + + return Container( + constraints: const BoxConstraints(maxWidth: 400), + decoration: BoxDecoration(border: Border.all()), + padding: const EdgeInsets.all(16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text(question, style: Theme.of(context).textTheme.headlineMedium), + const SizedBox(height: 8.0), + Text(answer, style: Theme.of(context).textTheme.headlineSmall), + ], + ), + ); + }, +); +``` + +#### Add the `CatalogItem` to the catalog + +Include your catalog items when instantiating `GenUiManager`. + +```dart +_genUiManager = GenUiManager( + catalog: CoreCatalogItems.asCatalog().copyWith([riddleCard]), +); +``` + +#### Update the system instruction to use the new widget + +In order to make sure the agent knows to use your new widget, use the system +instruction to explicitly tell it how and when to do so. Provide the name from +the CatalogItem when you do. + +```dart +final contentGenerator = FirebaseAiContentGenerator( + systemInstruction: ''' + You are an expert in creating funny riddles. Every time I give you a word, + you should generate a RiddleCard that displays one new riddle related to that word. + Each riddle should have both a question and an answer. + ''', + tools: _genUiManager.getTools(), +); +``` + +### Data Model and Data Binding + +A core concept in `genui` is the **`DataModel`**, a centralized, observable store for all dynamic UI state. Instead of widgets managing their own state, their state is stored in the `DataModel`. + +Widgets are "bound" to data in this model. When data in the model changes, only the widgets that depend on that specific piece of data are rebuilt. This is achieved through a `DataContext` object that is passed to each widget's builder function. + +#### Binding to the Data Model + +To bind a widget's property to the data model, you use a special JSON object in the data sent from the AI. This object can contain either a `literalString` (for static values) or a `path` (to bind to a value in the data model). + +For example, to display a user's name in a `Text` widget, the AI would generate: + +```json +{ + "Text": { + "text": { + "literalString": "Welcome to GenUI" + }, + "hint": "h1" + } +} +``` + +#### Image + +```json +{ + "Image": { + "url": { + "literalString": "https://example.com/image.png" + }, + "hint": "mediumFeature" + } +} +``` + +#### Updating the Data Model + +Input widgets, like `TextField`, update the `DataModel` directly. When the user types in a text field that is bound to `/user/name`, the `DataModel` is updated, and any other widgets bound to that same path will automatically rebuild to show the new value. + +This reactive data flow simplifies state management and creates a powerful, high-bandwidth interaction loop between the user, the UI, and the AI. + +### Next steps + +Check out the [examples](../../examples) included in this repo! The +[travel app](../../examples/travel_app) shows how to define your own widget +`Catalog` that the agent can use to generate domain-specific UI. + +If something is unclear or missing, please +[create an issue](https://github.com/flutter/genui/issues/new/choose). + +### System instructions + +The `genui` package gives the LLM a set of tools it can use to generate +UI. To get the LLM to use these tools, the `systemInstruction` provided to +`ContentGenerator` must explicitly tell it to do so. This is why the previous example +includes a system instruction for the agent with the line "Every time I give +you a word, you should generate UI that displays one new riddle...". + +### Troubleshooting / FAQ + +#### How can I configure logging? + +To observe communication between your app and the agent, enable logging in your +`main` method. + +```dart +import 'package:logging/logging.dart'; +import 'package:genui/genui.dart'; + +final logger = configureGenUiLogging(level: Level.ALL); + +void main() async { + logger.onRecord.listen((record) { + debugPrint('${record.loggerName}: ${record.message}'); + }); + + // Additional initialization of bindings and Firebase. +} +``` + +#### I'm getting errors about my minimum macOS/iOS version. + +Firebase has a +[minimum version requirement](https://firebase.google.com/support/release-notes/ios) +for Apple's platforms, which might be higher than Flutter's default. Check your +`Podfile` (for iOS) and `CMakeLists.txt` (for macOS) to ensure you're targeting +a version that meets or exceeds Firebase's requirements. From 76e9e39778e0bc3d5edd9def09e1b33bb87736e7 Mon Sep 17 00:00:00 2001 From: Greg Spencer Date: Tue, 11 Nov 2025 19:11:05 -0800 Subject: [PATCH 2/4] Fixing publishing points issues --- packages/genui/lib/src/catalog/core_widgets/text.dart | 2 +- packages/genui/pubspec.yaml | 4 ++-- packages/genui/test/catalog/core_widgets/text_test.dart | 2 +- packages/genui_a2ui/pubspec.yaml | 2 +- packages/genui_firebase_ai/pubspec.yaml | 2 +- packages/genui_google_generative_ai/pubspec.yaml | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/genui/lib/src/catalog/core_widgets/text.dart b/packages/genui/lib/src/catalog/core_widgets/text.dart index 1d31e8238..6709fa02b 100644 --- a/packages/genui/lib/src/catalog/core_widgets/text.dart +++ b/packages/genui/lib/src/catalog/core_widgets/text.dart @@ -3,7 +3,7 @@ // found in the LICENSE file. import 'package:flutter/material.dart'; -import 'package:flutter_markdown/flutter_markdown.dart'; +import 'package:flutter_markdown_plus/flutter_markdown_plus.dart'; import 'package:json_schema_builder/json_schema_builder.dart'; import '../../core/widget_utilities.dart'; diff --git a/packages/genui/pubspec.yaml b/packages/genui/pubspec.yaml index a92363655..8b0d939d9 100644 --- a/packages/genui/pubspec.yaml +++ b/packages/genui/pubspec.yaml @@ -5,7 +5,7 @@ name: genui description: Generates and displays generative user interfaces (GenUI) in Flutter using AI. version: 0.5.0 -homepage: https://github.com/flutter/genui/packages/genui +homepage: https://github.com/flutter/genui/tree/main/packages/genui license: BSD-3-Clause issue_tracker: https://github.com/flutter/genui/issues @@ -19,7 +19,7 @@ dependencies: collection: ^1.19.1 flutter: sdk: flutter - flutter_markdown: ^0.7.7+1 + flutter_markdown_plus: ^1.0.5 json_schema_builder: ^0.1.3 logging: ^1.3.0 diff --git a/packages/genui/test/catalog/core_widgets/text_test.dart b/packages/genui/test/catalog/core_widgets/text_test.dart index 3fcbeecb9..c70416e2c 100644 --- a/packages/genui/test/catalog/core_widgets/text_test.dart +++ b/packages/genui/test/catalog/core_widgets/text_test.dart @@ -3,7 +3,7 @@ // found in the LICENSE file. import 'package:flutter/material.dart'; -import 'package:flutter_markdown/flutter_markdown.dart'; +import 'package:flutter_markdown_plus/flutter_markdown_plus.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:genui/src/catalog/core_widgets/text.dart'; import 'package:genui/src/model/catalog_item.dart'; diff --git a/packages/genui_a2ui/pubspec.yaml b/packages/genui_a2ui/pubspec.yaml index 3b3b2a355..591efa569 100644 --- a/packages/genui_a2ui/pubspec.yaml +++ b/packages/genui_a2ui/pubspec.yaml @@ -5,7 +5,7 @@ name: genui_a2ui description: Integration package for genui and A2UI Streaming UI Protocol. version: 0.5.0 -homepage: https://github.com/flutter/genui/packages/genui_a2ui +homepage: https://github.com/flutter/genui/tree/main/packages/genui_a2ui license: BSD-3-Clause issue_tracker: https://github.com/flutter/genui/issues diff --git a/packages/genui_firebase_ai/pubspec.yaml b/packages/genui_firebase_ai/pubspec.yaml index 6c59dabcb..10df3bf8d 100644 --- a/packages/genui_firebase_ai/pubspec.yaml +++ b/packages/genui_firebase_ai/pubspec.yaml @@ -5,7 +5,7 @@ name: genui_firebase_ai description: Integration package for genui and Firebase AI Logic. version: 0.5.0 -homepage: https://github.com/flutter/genui/packages/genui_firebase_ai +homepage: https://github.com/flutter/genui/tree/main/packages/genui_firebase_ai license: BSD-3-Clause issue_tracker: https://github.com/flutter/genui/issues diff --git a/packages/genui_google_generative_ai/pubspec.yaml b/packages/genui_google_generative_ai/pubspec.yaml index 0e5ba96ed..0ff8d6b9f 100644 --- a/packages/genui_google_generative_ai/pubspec.yaml +++ b/packages/genui_google_generative_ai/pubspec.yaml @@ -5,7 +5,7 @@ name: genui_google_generative_ai description: Integration package for genui and Google Cloud Generative Language API. version: 0.5.0 -homepage: https://github.com/flutter/genui/packages/genui_google_generative_ai +homepage: https://github.com/flutter/genui/tree/main/packages/genui_google_generative_ai license: BSD-3-Clause issue_tracker: https://github.com/flutter/genui/issues publish_to: none From 934fadf063b151910c12503321ee955478742b66 Mon Sep 17 00:00:00 2001 From: Greg Spencer Date: Tue, 11 Nov 2025 19:18:11 -0800 Subject: [PATCH 3/4] Upgrade dependencies --- examples/custom_backend/pubspec.yaml | 2 +- examples/simple_chat/pubspec.yaml | 2 +- examples/travel_app/pubspec.yaml | 4 ++-- examples/verdure/client/pubspec.yaml | 4 ++-- packages/genui_a2ui/pubspec.yaml | 2 +- packages/genui_firebase_ai/pubspec.yaml | 2 +- packages/genui_google_generative_ai/pubspec.yaml | 2 +- packages/json_schema_builder/pubspec.yaml | 2 +- tool/fix_copyright/pubspec.yaml | 2 +- tool/test_and_fix/pubspec.yaml | 4 ++-- 10 files changed, 13 insertions(+), 13 deletions(-) diff --git a/examples/custom_backend/pubspec.yaml b/examples/custom_backend/pubspec.yaml index a18bd8c29..d39894e46 100644 --- a/examples/custom_backend/pubspec.yaml +++ b/examples/custom_backend/pubspec.yaml @@ -16,7 +16,7 @@ dependencies: flutter: sdk: flutter genui: ^0.5.0 - http: ^1.5.0 + http: ^1.6.0 intl: ^0.20.2 json_schema_builder: ^0.1.3 diff --git a/examples/simple_chat/pubspec.yaml b/examples/simple_chat/pubspec.yaml index a88a22552..fe04909ad 100644 --- a/examples/simple_chat/pubspec.yaml +++ b/examples/simple_chat/pubspec.yaml @@ -13,7 +13,7 @@ environment: resolution: workspace dependencies: - firebase_core: ^4.0.0 + firebase_core: ^4.2.1 flutter: sdk: flutter genui: ^0.5.0 diff --git a/examples/travel_app/pubspec.yaml b/examples/travel_app/pubspec.yaml index a2bf30ddd..693e8d145 100644 --- a/examples/travel_app/pubspec.yaml +++ b/examples/travel_app/pubspec.yaml @@ -14,8 +14,8 @@ environment: resolution: workspace dependencies: - firebase_app_check: ^0.4.0 - firebase_core: ^4.0.0 + firebase_app_check: ^0.4.1+2 + firebase_core: ^4.2.1 flutter: sdk: flutter genui: ^0.5.0 diff --git a/examples/verdure/client/pubspec.yaml b/examples/verdure/client/pubspec.yaml index ead16082a..817b65ca2 100644 --- a/examples/verdure/client/pubspec.yaml +++ b/examples/verdure/client/pubspec.yaml @@ -16,12 +16,12 @@ dependencies: flutter: sdk: flutter flutter_riverpod: ^3.0.3 - flutter_svg: ^2.2.1 + flutter_svg: ^2.2.2 genui: ^0.5.0 genui_a2ui: ^0.5.0 go_router: ^16.3.0 image_picker: ^1.2.0 - logging: ^1.2.0 + logging: ^1.3.0 mime: ^2.0.0 riverpod_annotation: ^3.0.3 diff --git a/packages/genui_a2ui/pubspec.yaml b/packages/genui_a2ui/pubspec.yaml index 591efa569..745c6111e 100644 --- a/packages/genui_a2ui/pubspec.yaml +++ b/packages/genui_a2ui/pubspec.yaml @@ -22,7 +22,7 @@ dependencies: genui: ^0.5.0 json_schema_builder: ^0.1.3 logging: ^1.3.0 - uuid: ^4.5.1 + uuid: ^4.5.2 dev_dependencies: flutter_test: diff --git a/packages/genui_firebase_ai/pubspec.yaml b/packages/genui_firebase_ai/pubspec.yaml index 10df3bf8d..a4d642266 100644 --- a/packages/genui_firebase_ai/pubspec.yaml +++ b/packages/genui_firebase_ai/pubspec.yaml @@ -16,7 +16,7 @@ environment: resolution: workspace dependencies: - firebase_ai: ^3.2.0 + firebase_ai: ^3.5.0 flutter: sdk: flutter genui: ^0.5.0 diff --git a/packages/genui_google_generative_ai/pubspec.yaml b/packages/genui_google_generative_ai/pubspec.yaml index 0ff8d6b9f..ee7efb6df 100644 --- a/packages/genui_google_generative_ai/pubspec.yaml +++ b/packages/genui_google_generative_ai/pubspec.yaml @@ -20,7 +20,7 @@ dependencies: flutter: sdk: flutter genui: ^0.5.0 - google_cloud_ai_generativelanguage_v1beta: ^0.1.0 + google_cloud_ai_generativelanguage_v1beta: ^0.1.2 google_cloud_protobuf: ^0.1.0 json_schema_builder: ^0.1.3 diff --git a/packages/json_schema_builder/pubspec.yaml b/packages/json_schema_builder/pubspec.yaml index 884e0f97e..ac1b52347 100644 --- a/packages/json_schema_builder/pubspec.yaml +++ b/packages/json_schema_builder/pubspec.yaml @@ -20,7 +20,7 @@ dependencies: collection: ^1.19.1 decimal: ^3.2.4 email_validator: ^3.0.0 - http: ^1.4.0 + http: ^1.6.0 intl: ^0.20.2 meta: ^1.16.0 diff --git a/tool/fix_copyright/pubspec.yaml b/tool/fix_copyright/pubspec.yaml index 621fc45f6..2bd644a23 100644 --- a/tool/fix_copyright/pubspec.yaml +++ b/tool/fix_copyright/pubspec.yaml @@ -14,7 +14,7 @@ resolution: workspace dependencies: args: ^2.7.0 file: ^7.0.1 - path: ^1.9.0 + path: ^1.9.1 process: ^5.0.5 dev_dependencies: diff --git a/tool/test_and_fix/pubspec.yaml b/tool/test_and_fix/pubspec.yaml index 0d5ee1a3c..02de100e8 100644 --- a/tool/test_and_fix/pubspec.yaml +++ b/tool/test_and_fix/pubspec.yaml @@ -16,9 +16,9 @@ resolution: workspace dependencies: args: ^2.7.0 file: ^7.0.1 - path: ^1.9.0 + path: ^1.9.1 process: ^5.0.5 - process_runner: ^4.2.3 + process_runner: ^4.2.4 dev_dependencies: test: ^1.26.2 From 3194ae8796d92b1d91a9333942a913f321cf2ae2 Mon Sep 17 00:00:00 2001 From: Greg Spencer Date: Tue, 11 Nov 2025 19:29:57 -0800 Subject: [PATCH 4/4] Update version numbers --- examples/catalog_gallery/pubspec.yaml | 2 +- examples/custom_backend/pubspec.yaml | 2 +- examples/simple_chat/pubspec.yaml | 6 ++-- examples/travel_app/pubspec.yaml | 4 +-- examples/verdure/client/pubspec.yaml | 4 +-- packages/genui/.guides/setup.md | 4 +-- packages/genui/CHANGELOG.md | 5 +++ packages/genui/pubspec.yaml | 2 +- packages/genui_a2ui/CHANGELOG.md | 4 +++ packages/genui_a2ui/README.md | 4 +-- packages/genui_a2ui/example/pubspec.yaml | 4 +-- packages/genui_a2ui/pubspec.yaml | 4 +-- packages/genui_firebase_ai/CHANGELOG.md | 4 +++ packages/genui_firebase_ai/pubspec.yaml | 4 +-- .../genui_google_generative_ai/CHANGELOG.md | 32 +++++++++++-------- .../genui_google_generative_ai/pubspec.yaml | 4 +-- 16 files changed, 53 insertions(+), 36 deletions(-) diff --git a/examples/catalog_gallery/pubspec.yaml b/examples/catalog_gallery/pubspec.yaml index ef2f2e4a3..fab818dfe 100644 --- a/examples/catalog_gallery/pubspec.yaml +++ b/examples/catalog_gallery/pubspec.yaml @@ -15,7 +15,7 @@ resolution: workspace dependencies: flutter: sdk: flutter - genui: ^0.5.0 + genui: ^0.5.1 json_schema_builder: ^0.1.3 dev_dependencies: diff --git a/examples/custom_backend/pubspec.yaml b/examples/custom_backend/pubspec.yaml index d39894e46..2a771a6b5 100644 --- a/examples/custom_backend/pubspec.yaml +++ b/examples/custom_backend/pubspec.yaml @@ -15,7 +15,7 @@ resolution: workspace dependencies: flutter: sdk: flutter - genui: ^0.5.0 + genui: ^0.5.1 http: ^1.6.0 intl: ^0.20.2 json_schema_builder: ^0.1.3 diff --git a/examples/simple_chat/pubspec.yaml b/examples/simple_chat/pubspec.yaml index fe04909ad..e56ddb7b2 100644 --- a/examples/simple_chat/pubspec.yaml +++ b/examples/simple_chat/pubspec.yaml @@ -16,9 +16,9 @@ dependencies: firebase_core: ^4.2.1 flutter: sdk: flutter - genui: ^0.5.0 - genui_firebase_ai: ^0.5.0 - genui_google_generative_ai: ^0.5.0 + genui: ^0.5.1 + genui_firebase_ai: ^0.5.1 + genui_google_generative_ai: ^0.5.1 logging: ^1.3.0 dev_dependencies: diff --git a/examples/travel_app/pubspec.yaml b/examples/travel_app/pubspec.yaml index 693e8d145..a3ff83311 100644 --- a/examples/travel_app/pubspec.yaml +++ b/examples/travel_app/pubspec.yaml @@ -18,8 +18,8 @@ dependencies: firebase_core: ^4.2.1 flutter: sdk: flutter - genui: ^0.5.0 - genui_firebase_ai: ^0.5.0 + genui: ^0.5.1 + genui_firebase_ai: ^0.5.1 gpt_markdown: ^1.1.4 intl: ^0.20.2 json_schema_builder: ^0.1.3 diff --git a/examples/verdure/client/pubspec.yaml b/examples/verdure/client/pubspec.yaml index 817b65ca2..fed4a90f6 100644 --- a/examples/verdure/client/pubspec.yaml +++ b/examples/verdure/client/pubspec.yaml @@ -17,8 +17,8 @@ dependencies: sdk: flutter flutter_riverpod: ^3.0.3 flutter_svg: ^2.2.2 - genui: ^0.5.0 - genui_a2ui: ^0.5.0 + genui: ^0.5.1 + genui_a2ui: ^0.5.1 go_router: ^16.3.0 image_picker: ^1.2.0 logging: ^1.3.0 diff --git a/packages/genui/.guides/setup.md b/packages/genui/.guides/setup.md index 7f23f9b98..9d86ed2bf 100644 --- a/packages/genui/.guides/setup.md +++ b/packages/genui/.guides/setup.md @@ -27,8 +27,8 @@ Logic, follow these instructions: ```yaml dependencies: - genui: ^0.5.0 # Or the latest version - genui_firebase_ai: ^0.5.0 # Or the latest version + genui: ^0.5.1 # Or the latest version + genui_firebase_ai: ^0.5.1 # Or the latest version ``` 5. In your app's `main` method, ensure that the widget bindings are initialized, diff --git a/packages/genui/CHANGELOG.md b/packages/genui/CHANGELOG.md index c4dd0fb1f..118c81ed5 100644 --- a/packages/genui/CHANGELOG.md +++ b/packages/genui/CHANGELOG.md @@ -1,5 +1,10 @@ # `genui` Changelog +## 0.5.1 + +- Homepage URL was updated. +- Deprecated `flutter_markdown` package was replaced with `flutter_markdown_plus`. + ## 0.5.0 - Initial published release. diff --git a/packages/genui/pubspec.yaml b/packages/genui/pubspec.yaml index 8b0d939d9..47a751f3e 100644 --- a/packages/genui/pubspec.yaml +++ b/packages/genui/pubspec.yaml @@ -4,7 +4,7 @@ name: genui description: Generates and displays generative user interfaces (GenUI) in Flutter using AI. -version: 0.5.0 +version: 0.5.1 homepage: https://github.com/flutter/genui/tree/main/packages/genui license: BSD-3-Clause issue_tracker: https://github.com/flutter/genui/issues diff --git a/packages/genui_a2ui/CHANGELOG.md b/packages/genui_a2ui/CHANGELOG.md index 2ba1f1330..1225ea2f0 100644 --- a/packages/genui_a2ui/CHANGELOG.md +++ b/packages/genui_a2ui/CHANGELOG.md @@ -1,5 +1,9 @@ # `genui_a2ui` Change Log +## 0.5.1 + +- Homepage URL was updated. + ## 0.5.0 - Initial published release. diff --git a/packages/genui_a2ui/README.md b/packages/genui_a2ui/README.md index 0aba26e76..b66a62fbe 100644 --- a/packages/genui_a2ui/README.md +++ b/packages/genui_a2ui/README.md @@ -26,8 +26,8 @@ Add the following to your `pubspec.yaml`: dependencies: flutter: sdk: flutter - genui: ^0.5.0 # Or the latest version - genui_a2ui: ^0.5.0 # Or the latest version + genui: ^0.5.1 # Or the latest version + genui_a2ui: ^0.5.1 # Or the latest version a2a: ^3.1.0 # Or the latest version ``` diff --git a/packages/genui_a2ui/example/pubspec.yaml b/packages/genui_a2ui/example/pubspec.yaml index 540fb10f1..563d42998 100644 --- a/packages/genui_a2ui/example/pubspec.yaml +++ b/packages/genui_a2ui/example/pubspec.yaml @@ -16,8 +16,8 @@ resolution: workspace dependencies: flutter: sdk: flutter - genui: ^0.5.0 - genui_a2ui: ^0.5.0 + genui: ^0.5.1 + genui_a2ui: ^0.5.1 logging: ^1.3.0 dev_dependencies: diff --git a/packages/genui_a2ui/pubspec.yaml b/packages/genui_a2ui/pubspec.yaml index 745c6111e..cd4bd35fd 100644 --- a/packages/genui_a2ui/pubspec.yaml +++ b/packages/genui_a2ui/pubspec.yaml @@ -4,7 +4,7 @@ name: genui_a2ui description: Integration package for genui and A2UI Streaming UI Protocol. -version: 0.5.0 +version: 0.5.1 homepage: https://github.com/flutter/genui/tree/main/packages/genui_a2ui license: BSD-3-Clause issue_tracker: https://github.com/flutter/genui/issues @@ -19,7 +19,7 @@ dependencies: a2a: ^3.1.0 flutter: sdk: flutter - genui: ^0.5.0 + genui: ^0.5.1 json_schema_builder: ^0.1.3 logging: ^1.3.0 uuid: ^4.5.2 diff --git a/packages/genui_firebase_ai/CHANGELOG.md b/packages/genui_firebase_ai/CHANGELOG.md index 060097c1c..96b058072 100644 --- a/packages/genui_firebase_ai/CHANGELOG.md +++ b/packages/genui_firebase_ai/CHANGELOG.md @@ -1,5 +1,9 @@ # `genui_firebase_ai` Change Log +## 0.5.1 + +- Homepage URL was updated. + ## 0.5.0 - Initial published release. diff --git a/packages/genui_firebase_ai/pubspec.yaml b/packages/genui_firebase_ai/pubspec.yaml index a4d642266..4db6835a3 100644 --- a/packages/genui_firebase_ai/pubspec.yaml +++ b/packages/genui_firebase_ai/pubspec.yaml @@ -4,7 +4,7 @@ name: genui_firebase_ai description: Integration package for genui and Firebase AI Logic. -version: 0.5.0 +version: 0.5.1 homepage: https://github.com/flutter/genui/tree/main/packages/genui_firebase_ai license: BSD-3-Clause issue_tracker: https://github.com/flutter/genui/issues @@ -19,7 +19,7 @@ dependencies: firebase_ai: ^3.5.0 flutter: sdk: flutter - genui: ^0.5.0 + genui: ^0.5.1 json_schema_builder: ^0.1.3 dev_dependencies: diff --git a/packages/genui_google_generative_ai/CHANGELOG.md b/packages/genui_google_generative_ai/CHANGELOG.md index 09e1f3228..5ef44a533 100644 --- a/packages/genui_google_generative_ai/CHANGELOG.md +++ b/packages/genui_google_generative_ai/CHANGELOG.md @@ -1,19 +1,23 @@ # `genui_google_generative_ai` Changelog +## 0.5.1 + +- Homepage URL was updated. + ## 0.5.0 -* Initial release of `genui_google_generative_ai` -* Implements `ContentGenerator` using Google Cloud Generative Language API -* Provides `GoogleGenerativeAiContentGenerator` with support for: - * Tool calling and function declarations - * Schema adaptation from `json_schema_builder` to Google Cloud API format - * Message conversion between genui ChatMessages and Google Cloud Content - * Protocol Buffer Struct type conversion for function calling - * System instructions and custom model selection - * Token usage tracking -* Includes `GoogleContentConverter` for message format conversion -* Includes `GoogleSchemaAdapter` for JSON schema adaptation -* Compatible with Google Cloud Generative Language API v1beta -* Supports multiple Type enum values (string, number, integer, boolean, array, object) -* Handles `FunctionCallingConfig` with AUTO and ANY modes +- Initial release of `genui_google_generative_ai` +- Implements `ContentGenerator` using Google Cloud Generative Language API +- Provides `GoogleGenerativeAiContentGenerator` with support for: + - Tool calling and function declarations + - Schema adaptation from `json_schema_builder` to Google Cloud API format + - Message conversion between genui ChatMessages and Google Cloud Content + - Protocol Buffer Struct type conversion for function calling + - System instructions and custom model selection + - Token usage tracking +- Includes `GoogleContentConverter` for message format conversion +- Includes `GoogleSchemaAdapter` for JSON schema adaptation +- Compatible with Google Cloud Generative Language API v1beta +- Supports multiple Type enum values (string, number, integer, boolean, array, object) +- Handles `FunctionCallingConfig` with AUTO and ANY modes diff --git a/packages/genui_google_generative_ai/pubspec.yaml b/packages/genui_google_generative_ai/pubspec.yaml index ee7efb6df..fa18df10d 100644 --- a/packages/genui_google_generative_ai/pubspec.yaml +++ b/packages/genui_google_generative_ai/pubspec.yaml @@ -4,7 +4,7 @@ name: genui_google_generative_ai description: Integration package for genui and Google Cloud Generative Language API. -version: 0.5.0 +version: 0.5.1 homepage: https://github.com/flutter/genui/tree/main/packages/genui_google_generative_ai license: BSD-3-Clause issue_tracker: https://github.com/flutter/genui/issues @@ -19,7 +19,7 @@ resolution: workspace dependencies: flutter: sdk: flutter - genui: ^0.5.0 + genui: ^0.5.1 google_cloud_ai_generativelanguage_v1beta: ^0.1.2 google_cloud_protobuf: ^0.1.0 json_schema_builder: ^0.1.3