Expand prompt catalog discovery example
This commit is contained in:
@@ -185,11 +185,26 @@ import, source-location, and ownership behavior.
|
||||
## Identified prompt sequences
|
||||
|
||||
[`LoadPromptCatalog`](../../examples/consumers/prompt_catalog.go) uses one
|
||||
definition registration for the literal `prompts` path and `id` field. Its main
|
||||
file imports one prompt by path and others by glob, placing each source as an
|
||||
item. A nested ordinary helper import supplies an item's ID. The main tier
|
||||
strictly appends the distinct records in contribution order; its completed
|
||||
sequence replaces the lower-priority default collection as one value.
|
||||
definition registration for the literal `prompts` path and `id` field. Its
|
||||
load-wide filename defaults accept two patterns, an explicit directory
|
||||
declaration overrides those patterns, and an exclusion omits one matching
|
||||
candidate. A nested ordinary helper import supplies an item's ID. A separate
|
||||
empty optional directory search is read from `SourceInfo.ImportSelections`.
|
||||
The executable example prints both the scheduled prompt order and the single
|
||||
empty-search outcome; the behavior test also follows a mounted resource through
|
||||
its effective metadata origin to the declaring source context. The completed
|
||||
main sequence replaces the lower-priority default collection as one value.
|
||||
The maintained [executable example and behavior tests](../../examples/consumers/prompt_catalog_test.go)
|
||||
show the scheduled result, empty-search inspection, excluded candidate, and
|
||||
resource lookup without a consumer-side discovery pass. The corresponding
|
||||
[complex fixture](../../examples/consumers/testdata/prompt-catalog/config.yml)
|
||||
and [simple required-file fixture](../../examples/consumers/testdata/prompt-catalog/simple.yml)
|
||||
are complete local examples.
|
||||
|
||||
[`LoadRequiredPromptCatalog`](../../examples/consumers/prompt_catalog.go) and
|
||||
[`Example_requiredPromptCatalog`](../../examples/consumers/prompt_catalog_test.go)
|
||||
keep the smaller adoption path visible: one explicitly required file import,
|
||||
the same identity registration, and the same application validation.
|
||||
|
||||
The example's `validatePromptCatalog` remains application-owned. It checks that
|
||||
prompt names and message lists satisfy this consumer's requirements after
|
||||
|
||||
Reference in New Issue
Block a user