Skip to content

Commit f184ff5

Browse files
Remove implementation detail from catalog core widget schema descriptions
1 parent 8a34ec3 commit f184ff5

File tree

150 files changed

+4166
-869
lines changed

Some content is hidden

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

150 files changed

+4166
-869
lines changed

.gemini/GEMINI.md

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ The project is structured as a monorepo containing several Dart and Flutter pack
1212

1313
| Package | Description |
1414
| ------------------------------------ | ----------------------------------------------------------------------- |
15-
| `packages/genui` | The core framework for employing Generative UI. |
16-
| `packages/genui_firebase_ai` | Firebase AI integration for `genui`. |
15+
| `packages/genui` | The core framework for employing Generative UI. |
16+
| `packages/genui_a2ui` | Integration with the A2UI Streaming UI Protocol. |
17+
| `packages/genui_firebase_ai` | Firebase AI integration for `genui`. |
18+
| `packages/genui_google_generative_ai`| Integration with Google Cloud Generative Language API. |
1719
| `packages/json_schema_builder` | A Dart JSON Schema package with validation, used by the core framework. |
1820

1921
### Example Applications
@@ -25,15 +27,16 @@ The `examples` directory contains sample applications demonstrating the usage of
2527
| `simple_chat` | A minimal example of a conversational chat application. It demonstrates the fundamental concepts of `genui`, such as initializing the `GenUiConversation`, sending user messages, and rendering the AI-generated UI surfaces using the default core widget catalog. |
2628
| `travel_app` | A more advanced example of a travel planning assistant. It showcases dynamic UI generation, the use of a custom, domain-specific widget catalog, and how user interactions with the UI can be fed back to the AI to refine the conversation. |
2729
| `catalog_gallery` | A simple application that displays the widgets available in the catalog. It's a useful tool for developers to visualize the components that the AI can use to build UIs. |
30+
| `verdure` | A full-stack example (Flutter client + Python server) of a landscape design agent using the A2A protocol. |
31+
| `custom_backend` | Demonstrates how a custom backend can interact with `genui`. |
2832

2933
The `simple_chat` and `travel_app` examples are good starting points for understanding the library's capabilities.
3034

3135
## Implementation Details
3236

3337
For a deeper understanding of the project's architecture and data flow, refer to the following documents:
3438

35-
- **`packages/genui/IMPLEMENTATION.md`**: Provides a comprehensive overview of the core `genui` package's architecture, purpose, and implementation.
36-
- **`examples/travel_app/IMPLEMENTATION.md`**: Describes the architecture and implementation of the `travel_app` example, showcasing how the `genui` package is used to build a dynamic, conversational UI.
39+
- **`packages/genui/DESIGN.md`**: Provides a comprehensive overview of the core `genui` package's architecture, purpose, and implementation.
3740

3841
## Building and Running
3942

@@ -47,7 +50,7 @@ The project uses standard `flutter` and `dart` commands. A comprehensive script
4750
./tool/run_all_tests_and_fixes.sh
4851
```
4952

50-
This is a script used by CI for ensuring code quality. It runs `dart fix`, `dart format`, `flutter test`, and `flutter analyze` for all packages and examples in the repository.
53+
This script wraps the `test_and_fix` Dart tool (`tool/test_and_fix`) to run `dart fix`, `dart format`, `fix_copyright` (in `tool/fix_copyright`), `flutter test`, and `flutter analyze` for all packages and examples in the repository. It is used by developers before comitting code. It takes a while to run, and is not idempotent: it will reformat code and add copyright notices if necessary.
5154

5255
## Development Conventions
5356

@@ -71,14 +74,18 @@ The project uses standard `flutter` and `dart` commands. A comprehensive script
7174
### Firebase Integration
7275

7376
- The examples and the `genui_firebase_ai` package use Firebase.
74-
- A script at `tool/stub_firebase_options.sh` is used in CI to create a stub `firebase_options.dart` file. For local development, developers need to configure their own Firebase project by following the instructions in `packages/genui/USAGE.md`.
77+
- A script at `tool/stub_firebase_options.sh` is used in CI to create a stub `firebase_options.dart` file. For local development, developers need to configure their own Firebase project by following the instructions in [`packages/genui/README.md`](packages/genui/README.md#configure-firebase-ai-logic).
7578

76-
## Folder `spikes`
79+
## Updating the Guides (`packages/genui/.guides`)
7780

78-
The folder `spikes` contains experiments and proof of concepts,
79-
that does not have to be of good quality.
81+
When asked to update the developer guides located in `packages/genui/.guides`, it is critical to ensure the documentation accurately reflects the current state of the codebase. Before making any changes to the guides, you must read *all* the Dart code in the following packages:
8082

81-
Skip this folder when reviewing code.
83+
- `packages/genui`
84+
- `packages/genui_firebase_ai`
85+
- `packages/genui_google_generative_ai`
86+
- `packages/genui_a2ui`
87+
88+
This ensures that any code examples, API references, and architectural explanations in the guides are up-to-date and consistent with the actual implementation.
8289

8390
## Draft pull requests
8491

.gemini/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ The files in this directory are used to customize the behavior of these tools fo
1010
- **`GEMINI.md`**: Provides project-specific context, instructions, and guidelines that are included in the context when using Gemini CLI and Code Assist. This helps the AI understand the project's conventions and requirements.
1111
- **`config.yaml`**: Configuration for the Gemini for GitHub tools, such as settings for code review.
1212
- **`styleguide.md`**: Contains the project's style guide, which is used by the Gemini for Github tools to ensure that generated reviews adhere to the project's conventions.
13+
- **`commands/`**: A directory containing custom command definitions (e.g., `fix_code.toml`) for the Gemini CLI.
1314

1415
## Documentation
1516

.github/workflows/flutter_packages.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,6 @@ jobs:
121121
- name: Update submodules
122122
working-directory: ${{ matrix.package.path }}
123123
run: git submodule update --init --recursive
124-
- name: Stub firebase_options.dart
125-
run: sh tool/stub_firebase_options.sh
126124
- name: Install dependencies
127125
working-directory: ${{ matrix.package.path }}
128126
run: dart pub get

.gitignore

Lines changed: 45 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,38 @@
1-
# These files are regularly auto-updated, but they should not be ignored:
2-
# **/project.pbxproj
3-
# **/settings.gradle.kts
4-
# **/build.gradle.kts
1+
# Diagrams, produced by https://pub.dev/packages/layerlens.
2+
DEPS.md
3+
4+
# Firebase
5+
google-services.json
6+
**/lib/firebase_options.dart
7+
firebase.json
8+
GoogleService-Info.plist
9+
.firebase
10+
.firebaserc
11+
12+
# This package's specific logs.
13+
*.log.*
14+
*.log
15+
16+
# Python
17+
__pycache__/
18+
*.py[cod]
19+
*$py.class
20+
.venv
21+
venv/
22+
ENV/
23+
.env
24+
build/
25+
dist/
26+
*.egg-info/
27+
.pytest_cache/
28+
.coverage
29+
htmlcov/
30+
31+
# ==============================================================================
32+
#
33+
# STANDARD FLUTTER GITIGNORE
34+
#
35+
# ==============================================================================
536

637
# Miscellaneous
738
*.class
@@ -15,35 +46,27 @@
1546
.svn/
1647
.swiftpm/
1748
migrate_working_dir/
18-
firepit-log.txt
19-
pglite-debug.log
20-
21-
# Diagrams, produced by https://pub.dev/packages/layerlens.
22-
DEPS.md
2349

2450
# IntelliJ related
2551
*.iml
2652
*.ipr
2753
*.iws
2854
.idea/
2955

56+
# The .vscode folder contains launch configuration and tasks you configure in
57+
# VS Code which you may wish to be included in version control, so this line
58+
# is commented out by default.
59+
#.vscode/
60+
3061
# Flutter/Dart/Pub related
3162
**/doc/api/
3263
**/ios/Flutter/.last_build_id
3364
.dart_tool/
3465
.flutter-plugins-dependencies
3566
.pub-cache/
3667
.pub/
37-
build/
38-
coverage/
39-
pubspec.lock
40-
generated_plugins.cmake
41-
GeneratedPluginRegistrant.*
42-
generated_plugin_registrant.*
43-
Podfile
44-
Podfile.lock
45-
Runner-Bridging-Header.h
46-
contents.xcworkspacedata
68+
/build/
69+
/coverage/
4770

4871
# Symbolication related
4972
app.*.symbols
@@ -52,33 +75,6 @@ app.*.symbols
5275
app.*.map.json
5376

5477
# Android Studio will place build artifacts here
55-
**/android/app/debug
56-
**/android/app/profile
57-
**/android/app/release
58-
59-
# Firebase
60-
google-services.json
61-
**/lib/firebase_options.dart
62-
firebase.json
63-
GoogleService-Info.plist
64-
.firebase
65-
.firebaserc
66-
67-
# This package's specific logs.
68-
*.log.*
69-
*.log
70-
71-
# Python
72-
__pycache__/
73-
*.py[cod]
74-
*$py.class
75-
.venv
76-
venv/
77-
ENV/
78-
.env
79-
build/
80-
dist/
81-
*.egg-info/
82-
.pytest_cache/
83-
.coverage
84-
htmlcov/
78+
/android/app/debug
79+
/android/app/profile
80+
/android/app/release

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Please follow [Flutter contributor guidelines][flutter_guidelines].
88

99
To run examples:
1010

11-
1. Configure Firebase as described in [USAGE.md][usage_md].
11+
1. Configure Firebase as described in [README.md][readme_md].
1212
2. Run `flutter run`.
1313

1414
NOTE: For Google-internal projects see go/flutter-genui-internal.
@@ -104,7 +104,7 @@ releasing a new version.
104104
[Semver]: https://semver.org/
105105
[for-front-line]: https://github.com/flutter/genui/issues?q=is%3Aissue%20state%3Aopen%20-label%3AP0%20%20-label%3AP1%20-label%3AP2%20%20-label%3AP3%20-label%3Afront-line-handled
106106
[flutter_guidelines]: https://github.com/flutter/flutter/blob/master/CONTRIBUTING.md
107-
[usage_md]: packages/genui/USAGE.md#configure-firebase
107+
[readme_md]: packages/genui/README.md#configure-firebase-ai-logic
108108
[assigned_p2_p3_issues]: https://github.com/flutter/genui/issues?q=is%3Aopen%20is%3Aissue%20label%3AP2%2CP3%20assignee%3A*
109109
[p0_p1_issues_without_milestone]: https://github.com/flutter/genui/issues?q=is%3Aopen%20is%3Aissue%20label%3AP1%2CP0%20no%3Amilestone
110110
[projectless_open_issues]: https://github.com/flutter/genui/issues?q=is%3Aopen%20is%3Aissue%20no%3Aproject

README.md

Lines changed: 31 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
A Flutter library to enable developers to easily add interactive
44
generative UI to their applications.
55

6+
See the [Getting started with GenUI](https://www.youtube.com/watch?v=nWr6eZKM6no) video for an overview of the package.
7+
8+
[<img src="docs/assets/genui_intro_video_still.png" alt="GenUI Intro video still" height="500">](https://www.youtube.com/watch?v=nWr6eZKM6no)
9+
610
## Status: Highly Experimental
711

812
This is a highly experimental package, which means the API will change (sometimes drastically).
@@ -37,58 +41,6 @@ chatbots and next-generation agent-based user experiences.
3741
- Create dynamically composed UIs: an agent can generate a complete form with sliders, date pickers,
3842
and text fields on the fly based on a user's request to "book a flight."
3943

40-
## Example
41-
42-
### Using the GenUI SDK with Firebase AI Logic
43-
44-
```dart
45-
// Adding your widgets into the catalog.
46-
// Start with the built-in catalog and add your own custom widgets.
47-
final catalog = CoreCatalogItems.asCatalog().copyWith([
48-
myCustomNewWidget,
49-
]);
50-
51-
/// Initializing the library.
52-
final genUiManager = GenUiManager(catalog: catalog);
53-
final contentGenerator = FirebaseAiContentGenerator(
54-
catalog: catalog,
55-
systemInstruction: '''
56-
You are a bicycle maintenance assistant who is an expert in diagnosing issues and
57-
giving step-by-step instructions.
58-
''',
59-
);
60-
late final _genUiConversation = GenUiConversation(
61-
genUiManager: genUiManager,
62-
contentGenerator: contentGenerator,
63-
onSurfaceAdded: _onSurfaceAdded,
64-
onSurfaceDeleted: (_) {},
65-
onTextResponse: (_) {},
66-
// ignore: avoid_print
67-
onWarning: (value) => print('Warning from GenUiConversation: $value'),
68-
);
69-
70-
// Put the surface, added by AI, to the list of messages that should be rendered,
71-
// trigger re-render, and scroll to bottom.
72-
void _onSurfaceAdded(SurfaceAdded surface) {
73-
if (!mounted) return;
74-
setState(() {
75-
_messages.add(MessageController(surfaceId: surface.surfaceId));
76-
});
77-
_scrollToBottom();
78-
}
79-
80-
// Render that UI.
81-
Widget build(BuildContext context) {
82-
if (type == MessageType.genUi) {
83-
return GenUiSurface(
84-
host: _genUiConversation.genUiManager.host,
85-
surfaceId: _surfaceId,
86-
onEvent: _handleEvent,
87-
);
88-
}
89-
}
90-
```
91-
9244
## Look & Feel
9345

9446
### Interactive [Travel App Example](examples/travel_app/)
@@ -120,31 +72,44 @@ based on a widget catalog from the developers' project.
12072
- **Basic Layout:** LLM-driven basic layout generation.
12173
- **Any Model:** Integrate with any LLM that can generate structured JSON output.
12274

123-
## Some things we're thinking about
75+
## Connecting to an AI Agent
12476

125-
- **Genkit Integration:** Integration with Genkit.
126-
- **Expanded LLM Framework Support:** Official support for additional LLM frameworks.
127-
- **Streaming UI:** Support for progressively rendering UI components as they stream from the LLM.
128-
- **Full-Screen Composition:** Enable LLM-driven composition and navigation of entire app screens.
129-
- **A2A Agent Support:** Support for A2A agent interactions.
130-
- **Dart Bytecode:** Future support for Dart Bytecode for even greater dynamism and flexibility.
77+
The `genui` framework uses a `ContentGenerator` to communicate with a generative AI model,
78+
allowing `genui` to be backend agnostic. You can choose the implementation that best fits
79+
your needs, whether it's `FirebaseAiContentGenerator` for production apps,
80+
`GoogleGenerativeAiContentGenerator` for rapid prototyping, or `A2uiContentGenerator` for
81+
custom agent servers.
82+
83+
See the package table below for more details on each.
13184

13285
## Packages
13386

134-
| Package | Description |
135-
| ---------------------------------------------------------------- | ----------------------------------------------------------------------------- |
136-
| [genui](packages/genui/) | A framework to employ Generative UI. |
137-
| [genui_firebase_ai](packages/genui_firebase_ai/) | Firebase AI integration for genui. |
138-
| [json_schema_builder](packages/json_schema_builder/) | A fully featured Dart JSON Schema package with validation. |
87+
| Package | Description |
88+
| ------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
89+
| [genui](packages/genui/) | The core framework to employ Generative UI. |
90+
| [genui_firebase_ai](packages/genui_firebase_ai/) | Provides **`FirebaseAiContentGenerator`** to connect to Gemini via Firebase AI Logic. This is the recommended approach for production apps based on client-side agents. |
91+
| [genui_google_generative_ai](packages/genui_google_generative_ai/) | Provides **`GoogleGenerativeAiContentGenerator`** for connecting to the Google Generative AI API with only an API key. Ideal for getting started quickly. |
92+
| [genui_a2ui](packages/genui_a2ui/) | Provides **`A2uiContentGenerator`** for connecting to any server that implements the [A2UI protocol](https://a2ui.org). Use this for integrating with custom agent backends. |
93+
| [json_schema_builder](packages/json_schema_builder/) | A fully featured Dart JSON Schema package with validation, used by the core framework to define widget data structures. |
13994

140-
## Usage
95+
## Getting Started
14196

142-
See [packages/genui/USAGE.md](packages/genui/USAGE.md).
97+
See the [genui getting started guide](packages/genui/README.md#getting-started-with-genui).
14398

14499
## Constraints
145100

146101
This repo requires Flutter version >=3.35.7.
147102

103+
## Some things we're thinking about
104+
105+
- **Genkit Integration:** Integration with Genkit.
106+
- **ADK Plugin:** turnkey integration with ADK.
107+
- **Expanded LLM Framework Support:** Official support for additional LLM frameworks.
108+
- **Streaming UI:** Support for progressively rendering UI components as they stream from the LLM.
109+
- **Full-Screen Composition:** Enable LLM-driven composition and navigation of entire app screens.
110+
- **A2A Agent Support:** Support for A2A agent interactions.
111+
- **Dart Bytecode:** Future support for Dart Bytecode for even greater dynamism and flexibility.
112+
148113
## Contribute
149114

150115
See [CONTRIBUTING.md](CONTRIBUTING.md)
5.9 MB
Loading

examples/catalog_gallery/ios/Flutter/AppFrameworkInfo.plist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@
2121
<key>CFBundleVersion</key>
2222
<string>1.0</string>
2323
<key>MinimumOSVersion</key>
24-
<string>13.0</string>
24+
<string>15.0</string>
2525
</dict>
2626
</plist>

examples/catalog_gallery/ios/Runner.xcodeproj/project.pbxproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@
346346
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
347347
GCC_WARN_UNUSED_FUNCTION = YES;
348348
GCC_WARN_UNUSED_VARIABLE = YES;
349-
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
349+
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
350350
MTL_ENABLE_DEBUG_INFO = NO;
351351
SDKROOT = iphoneos;
352352
SUPPORTED_PLATFORMS = iphoneos;
@@ -472,7 +472,7 @@
472472
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
473473
GCC_WARN_UNUSED_FUNCTION = YES;
474474
GCC_WARN_UNUSED_VARIABLE = YES;
475-
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
475+
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
476476
MTL_ENABLE_DEBUG_INFO = YES;
477477
ONLY_ACTIVE_ARCH = YES;
478478
SDKROOT = iphoneos;
@@ -523,7 +523,7 @@
523523
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
524524
GCC_WARN_UNUSED_FUNCTION = YES;
525525
GCC_WARN_UNUSED_VARIABLE = YES;
526-
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
526+
IPHONEOS_DEPLOYMENT_TARGET = 15.0;
527527
MTL_ENABLE_DEBUG_INFO = NO;
528528
SDKROOT = iphoneos;
529529
SUPPORTED_PLATFORMS = iphoneos;

0 commit comments

Comments
 (0)