Skip to content

PromptBuilder doesn't surface the Catalog's id #900

@filiph

Description

@filiph

Describe the bug
When creating the system prompt using a custom Catalog, the system prompt doesn't contain the catalog's id.

But then in the CONTROLLING_THE_UI section, the prompt says: use the catalog ID provided in system instructions.

The only catalogId in the instructions is in the first example from BasicCatalog (if you include that), which is:

{
  "version": "v0.9",
  "createSurface": {
    "surfaceId": "main",
    "catalogId": "https://a2ui.org/specification/v0_9/standard_catalog.json",
    "sendDataModel": true
  }
}

So then, during building of the widgets, the controller throws an error because no such catalog exists.

Also, https://a2ui.org/specification/v0_9/standard_catalog.json is a HTTP 404.

To Reproduce
Steps to reproduce the behavior:

  1. Write the following code
  final catalog = Catalog(
    [
      BasicCatalogItems.text,
      BasicCatalogItems.divider,
      // ...
    ],
    catalogId: 'com.example.my_catalog',
  );

  final promptBuilder = PromptBuilder.chat(
    catalog: catalog,
    systemPromptFragments: [
      // ...
    ],
  );

  final promptText = promptBuilder.systemPromptJoined();
  print(promptText);
  1. Run this and inspect the output.

Expected behavior
The prompt states which catalog id the app expects.

Also, possibly, catalogId should be a required field on Catalog?

// cc @redbrogdon

Metadata

Metadata

Assignees

No one assigned

    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