-
Notifications
You must be signed in to change notification settings - Fork 127
Improve package:genui pub score. #679
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
276b15f
Added some missing documentation
hunterino 08ff359
moved simple_chat to example for project points
hunterino 1d81edd
Updated CHANGELOG.md
hunterino c0b27a4
Moved example.md back to README.md
hunterino a9f4745
Merge remote-tracking branch 'origin/main'
hunterino 824d5c1
Revert moving examples around.
ditman 571342d
Rename examples/examples.md to README.md
ditman 3f2465d
Merge remote-tracking branch 'origin/main' into HEAD
ditman 1b1515e
Add standard example directory
ditman 8f5d8a1
Update changelog
ditman c997d85
Address PR comments/issues
ditman 349aaec
Ensure all examples have their own README, and refer to that from the…
ditman db218fb
Merge branch 'main' into hunterino-main
ditman cff0b44
Make A2uiSchemas abstract final so it cannot be instantiated.
ditman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| # Examples | ||
|
|
||
| This directory contains example applications demonstrating the `genui` SDK | ||
| capabilities. | ||
|
|
||
| ## Overview | ||
|
|
||
| | Example | Complexity | Backend | Description | | ||
| |---------|------------|---------|-------------| | ||
| | [catalog_gallery][catalog_gallery] | Simple | None | Visual reference for core catalog widgets | | ||
| | [custom_backend][custom_backend] | Intermediate | JSON `assets` | Demonstrates custom backend integration | | ||
| | [simple_chat][simple_chat] | Intermediate | Firebase/Google AI | A simple, conversational chat application. | | ||
| | [travel_app][travel_app] | Advanced | Firebase/Google AI | Full travel planning assistant with custom catalog | | ||
| | [verdure][verdure] | Advanced | Python A2A Server | Full-stack landscape design agent | | ||
|
|
||
| [catalog_gallery]: https://github.com/flutter/genui/tree/main/examples/catalog_gallery | ||
| [custom_backend]: https://github.com/flutter/genui/tree/main/examples/custom_backend | ||
| [simple_chat]: https://github.com/flutter/genui/tree/main/examples/simple_chat | ||
| [travel_app]: https://github.com/flutter/genui/tree/main/examples/travel_app | ||
| [verdure]: https://github.com/flutter/genui/tree/main/examples/verdure | ||
|
|
||
| Each example directory contains a more detailed `README.md` file with | ||
| its specific instructions. | ||
|
|
||
| --- | ||
|
|
||
| ## Choosing an Example | ||
|
|
||
| | Goal | Recommended Example | | ||
| |------|---------------------| | ||
| | Understand core widgets | `catalog_gallery` | | ||
| | Basic use of the SDK | `simple_chat` | | ||
| | Build custom backend integration | `custom_backend` | | ||
| | Build a production-like app with custom catalog | `travel_app` | | ||
| | Implement client-server architecture with A2A | `verdure` | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,18 @@ | ||
| # catalog_gallery | ||
|
|
||
| A new Flutter project. | ||
| A developer tool for visualizing and testing the core widget catalog. Displays all available `CoreCatalogItems` widgets and allows interaction testing. | ||
|
|
||
| ## Getting Started | ||
|
|
||
| This project is a starting point for a Flutter application. | ||
| **Key Features:** | ||
| - Browse all core catalog widgets | ||
| - Interactive widget testing with event logging | ||
| - Sample file loading support | ||
|
|
||
| A few resources to get you started if this is your first Flutter project: | ||
| ## Getting Started | ||
|
|
||
| - [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab) | ||
| - [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook) | ||
| This is a standard Flutter app, and can be run with `flutter run`. | ||
|
|
||
| For help getting started with Flutter development, view the | ||
| [online documentation](https://docs.flutter.dev/), which offers tutorials, | ||
| samples, guidance on mobile development, and a full API reference. | ||
| **Run:** | ||
| ```bash | ||
| cd examples/catalog_gallery | ||
| flutter run | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,31 @@ | ||
| # custom_backend | ||
|
|
||
| An example that illustrates how custom backend can interact with genui. | ||
| This app demonstrates integrating genui with a custom backend without using | ||
| predefined provider packages (`genui_firebase_ai`, | ||
| `genui_google_generative_ai`). | ||
|
|
||
| **Key Features:** | ||
| - Direct integration with `A2uiMessageProcessor` | ||
| - Manual tool call parsing and handling | ||
| - Saved response testing for development without API calls | ||
| - Shows how to build `UiSchemaDefinition` and `catalogToFunctionDeclaration` | ||
|
|
||
| **Key Files:** | ||
| - `lib/backend.dart` - Custom backend implementation | ||
| - `lib/gemini_client.dart` - Direct Gemini API client | ||
| - `assets/data/saved-response-*.json` - Pre-recorded responses for testing | ||
|
|
||
| ## Getting Started | ||
|
|
||
| This is a standard flutter app that directly calls the Gemini API. You need | ||
| a Gemini API Key. Get one in [Google AI Studio][ai-studio]. | ||
|
|
||
| Then pass it as a `--dart-define` when calling `flutter run`: | ||
|
|
||
| **Run:** | ||
| ```bash | ||
| cd examples/custom_backend | ||
| flutter run --dart-define=GEMINI_API_KEY=YOUR_API_KEY | ||
| ``` | ||
|
|
||
| [ai-studio]: https://aistudio.google.com/api-keys |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| Check the `examples` directory at the root of the `flutter/genui` monorepo for | ||
| several sample apps demonstrating the SDK: | ||
|
|
||
| * https://github.com/flutter/genui/tree/main/examples | ||
|
|
||
| Each example is backed by a different backend stack. Check the [README.md][1] | ||
| file there for more information about each example. | ||
|
|
||
| [1]: https://github.com/flutter/genui/blob/main/examples/README.md |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.