docs: add Google Genkit A2UI integration guide and framework references - #2686
chrisraygill wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces comprehensive documentation for integrating Google Genkit with A2UI, including new guides, updated ecosystem references, and roadmap updates. The review identified three technical issues in the provided code snippets: an incorrect struct literal usage for inline prompts in the Go example, and the use of provider-specific, fragile content access patterns in both the TypeScript and Dart client examples. These should be updated to use the recommended idiomatic function calls and provider-agnostic content access methods.
| aix.InlinePrompt{ | ||
| ai.WithModelName("googleai/gemini-flash-latest"), | ||
| ai.WithSystem("You help users. Render UI when it is clearer than prose."), | ||
| ai.WithUse(&a2uix.Surfaces{}), | ||
| }, |
There was a problem hiding this comment.
In Genkit Go, the standard option to define an inline prompt is aix.WithInlinePrompt(...) (a function call) rather than aix.InlinePrompt{...} (a struct/slice literal). Using the function call is idiomatic and ensures correct compilation.
| aix.InlinePrompt{ | |
| ai.WithModelName("googleai/gemini-flash-latest"), | |
| ai.WithSystem("You help users. Render UI when it is clearer than prose."), | |
| ai.WithUse(&a2uix.Surfaces{}), | |
| }, | |
| aix.WithInlinePrompt( | |
| ai.WithModelName("googleai/gemini-flash-latest"), | |
| ai.WithSystem("You help users. Render UI when it is clearer than prose."), | |
| ai.WithUse(&a2uix.Surfaces{}), | |
| ) |
| message: actionToMessage(action as unknown as A2uiClientAction), | ||
| }); | ||
| for await (const chunk of turn.stream) { | ||
| const envelopes = a2uiEnvelopesFromParts(chunk.raw.modelChunk?.content); |
There was a problem hiding this comment.
Accessing chunk.raw.modelChunk?.content is provider-specific and fragile. In Genkit, the standard, provider-agnostic way to access the content parts of a chunk is via chunk.content.
| const envelopes = a2uiEnvelopesFromParts(chunk.raw.modelChunk?.content); | |
| const envelopes = a2uiEnvelopesFromParts(chunk.content); |
| // Stream prose deltas and A2UI envelopes | ||
| final turn = chat.sendStream(text: 'Book a table for 4 tomorrow evening'); | ||
| await for (final chunk in turn.stream) { | ||
| for (final envelope in a2uiEnvelopesFromParts(chunk.raw.modelChunk?.content)) { |
There was a problem hiding this comment.
Accessing chunk.raw.modelChunk?.content is provider-specific and fragile. In Genkit Dart, the standard, provider-agnostic way to access the content parts of a chunk is via chunk.content.
| for (final envelope in a2uiEnvelopesFromParts(chunk.raw.modelChunk?.content)) { | |
| for (final envelope in a2uiEnvelopesFromParts(chunk.content)) { |
…t A2UI SDK snippets
|
Thanks for putting this together. Two requests before this is ready for review: please open an issue that describes the Genkit docs plan (the new guide, the ADK and CopilotKit guide renames, and the Guides nav order) and link it from the PR description so the team can prioritize and assign it, and mark the PR ready for review once it is complete. The guide renames and the nav order are a docs structure decision, so expect input from the docs owners on those parts. |
Summary
Adds first-class documentation for Google Genkit (
@genkit-ai/a2ui,github.com/firebase/genkit/go/plugins/a2ui/exp, andpackage:genkit_a2ui) across the A2UI documentation site, and standardizes the framework guide naming under Guides:New Guide (
docs/public/guides/genkit.md):@genkit-ai/a2ui), Go (github.com/firebase/genkit/go/plugins/a2ui/exp), and Dart (package:genkit_a2ui).a2uiEnvelopesFromPartsandactionToMessage) for both Web (@a2ui/lit+@genkit-ai/a2ui/client) and Flutter (genui+package:genkit_a2ui/client.dart).loadCatalog/a2uix.LoadCatalog) and Developer UI observability (genkit start).https://genkit.dev/docs/agents/a2ui) and runnable sample applications across all supported SDKs.Standardized Framework Guides (
mkdocs.yaml&docs/public/guides/):guides/agent-development.md→guides/adk.md(Building A2UI Agents with ADK) with redirect mapping inmkdocs.yaml.guides/a2ui-with-any-agent-framework.md→guides/copilotkit.md(Building A2UI Agents with CopilotKit) with redirect mapping inmkdocs.yaml.Ecosystem & Navigation Updates:
docs/public/ecosystem/a2ui-in-the-world.md(above Google ADK) and added the Genkit + Flutter Dining Concierge sample under Open Source Examples.docs/public/introduction/how-to-use.md,docs/public/reference/agents.md, anddocs/public/roadmap.md.