Add PromptKit definition inspection
This commit is contained in:
70
docs/cli.md
70
docs/cli.md
@@ -225,6 +225,76 @@ environment-variable name; effective and historical secret fragments remain
|
||||
redacted. Empty location, inheritance, history, reason, and dependency lists are
|
||||
serialized as `[]`.
|
||||
|
||||
## PromptKit definition inspection
|
||||
|
||||
Applications can install prompt and profile inspection independently with
|
||||
`RegisterPromptKit`. Each installed handler constructs the selected engine once
|
||||
and asks PromptKit to inspect the named definition. Inspection reads the
|
||||
engine's captured configuration; it does not generate a prompt, contact a
|
||||
provider, or look up credentials.
|
||||
Prompt definitions and profile resolution remain owned by
|
||||
[PromptKit](https://pkg.go.dev/gitea.maximumdirect.net/eric/promptkit).
|
||||
|
||||
```text
|
||||
example promptkit show prompt customer/summary --version 2 --format yaml
|
||||
example promptkit show prompt customer/summary
|
||||
example promptkit show profile customer-support --format yaml
|
||||
```
|
||||
|
||||
Both commands require one ID operand and accept `--config`, `--overlay`, and
|
||||
`--format text|yaml` (default `text`). Prompt inspection also accepts singleton
|
||||
`--version`, defaulting to the empty string. PromptKit owns version selection:
|
||||
an omitted version works for a single-version ID, while an ambiguous ID is an
|
||||
operational error. These commands do not accept `--scope`; their namespace is
|
||||
`promptkit`.
|
||||
|
||||
Prompt YAML has these fields. Input order is preserved and an empty input list is
|
||||
`[]`. The prompt hash is an opaque owning-library equality value.
|
||||
|
||||
```yaml
|
||||
prompt_id: customer/summary
|
||||
prompt_version: "2"
|
||||
prompt_hash: opaque-value
|
||||
default_profile_id: customer-support
|
||||
inputs:
|
||||
- name: topic
|
||||
required: true
|
||||
content_type: text/plain
|
||||
description: Topic to summarize
|
||||
output_contract:
|
||||
format: json
|
||||
validation_mode: basic
|
||||
schema_path: ""
|
||||
repair_attempts: 2
|
||||
```
|
||||
|
||||
Profile YAML preserves the effective values reported by PromptKit, including
|
||||
zero values and nested provider parameters. `api_key_env` is only an
|
||||
environment-variable name. `api_key_required` reports a direct credential
|
||||
requirement; neither field reports credential availability. A nil provider
|
||||
parameter map is displayed as `{}`.
|
||||
|
||||
```yaml
|
||||
profile_id: customer-support
|
||||
effective_model_params:
|
||||
backend_id: local
|
||||
endpoint: https://example.invalid/v1
|
||||
model: support-model
|
||||
temperature: 0
|
||||
max_tokens: 0
|
||||
top_p: 0
|
||||
timeout_seconds: 600
|
||||
service_tier: ""
|
||||
reasoning_effort: ""
|
||||
api_key_env: ""
|
||||
extra_params: {}
|
||||
api_key_required: true
|
||||
```
|
||||
|
||||
Text uses labeled fields and includes nested `extra_params` values. A missing ID
|
||||
is a usage error. Blank, unknown, ambiguous, and canceled selections are
|
||||
operational inspection results from PromptKit and retain its error identity.
|
||||
|
||||
## Outcome status
|
||||
|
||||
CommandKit usage failures use status `2`; operational failures use status `1`.
|
||||
|
||||
Reference in New Issue
Block a user