Skip to content

[0.9 branch] system instruction construction process is quite manual #716

@yjbanov

Description

@yjbanov

Describe the bug

Right now you have to write code like this:

    final systemInstruction =
        '''You are a helpful assistant who chats with a user.
Your responses should contain acknowledgment of the user message.

IMPORTANT: When you generate UI in a response, you MUST always create
a new surface with a unique `surfaceId`. Do NOT reuse or update
existing `surfaceId`s. Each UI response must be in its own new surface.

<a2ui_schema>
$a2uiSchema
</a2ui_schema>

${StandardCatalogEmbed.standardCatalogRules}

${PromptFragments.basicChat}''';

Which, unless you poke around sample apps, you wouldn't get right. Also, if we change how the schema is intended to be embedded into the SI, the SI code you wrote before will break with the new version of A2UI.

Expected behavior

I think I'd like (if possible) two utilities:

  1. An A2UI SI constructor that keeps the construction process on rails. When I upgrade the version of the GenUI SDK, I will also automatically get the new and improved constructor.
  2. If my app is introducing agentic functionality for the first time, I won't have an existing AI pipeline to plug my GenUI pipeline into. It would be useful to have a prompt builder utility that helps me build a complete SI from scratch using some ergonomic Dart API (e.g. a builder pattern).

Metadata

Metadata

Assignees

Labels

P1A high-priority issue. Someone should be assigned and actively working on it.front-line-handledCan wait until the second-line triage. The front-line triage already checked if it's a P0.second-line-triagedThe issue has been fully triaged.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions