Feat/incremental catalog loading#949
Conversation
Introduces CatalogContext to support incremental catalog building in the facade, and updates PromptBuilder to consume it. Includes tests and golden output for the new incremental loading behavior.
The removed test asserted the manifest excludes schema/examples/properties keys, which is already guaranteed by the adjacent test pinning the keys to exactly name+description. Also trims comment noise in the incremental catalog prompt assembly.
Package publishing
Documentation at https://github.com/dart-lang/ecosystem/wiki/Publishing-automation. |
There was a problem hiding this comment.
Code Review
This pull request introduces an incremental catalog prompt mode to optimize system prompts for LLMs. It adds CatalogContext to manage a compact catalog manifest and load detailed component schemas and examples on demand via a new loadCatalogItems tool. It also updates PromptBuilder to support both full-schema and incremental modes, adjusting the system prompt structure and tool policies accordingly. The reviewer's feedback suggests improving robustness by supporting case-insensitive catalog item lookups, enhancing error handling during example JSON decoding to provide clearer debugging context, and adding corresponding unit tests.
…remental-catalog-loading # Conflicts: # packages/genui/lib/src/facade/prompt_builder.dart # packages/genui/test/facade/prompt_builder_test.dart
Issue: #946
Description
Replace this paragraph with a description of what this PR is changing or adding, and why. Consider including before/after screenshots.
List which issues are fixed by this PR. For larger changes, raising an issue first helps reduce redundant work.
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-devrel channel on Discord.