Migrate maintained PromptKit definitions and examples

This commit is contained in:
2026-10-04 11:41:00 +00:00
parent 0df2aad3a8
commit 2027b80311
23 changed files with 244 additions and 221 deletions

View File

@@ -276,7 +276,16 @@ removed constructor API or backend schema remains in production code.
## Stage 4: Migrate Maintained Definitions, Application Examples, And Testdata ## Stage 4: Migrate Maintained Definitions, Application Examples, And Testdata
Status: Pending. Depends on Stage 3. Status: Complete. Maintained and fixture prompt/profile definitions now use
PromptKit's keyed format, and application examples select ordered native
sources with framework backend data in separate files. The two fixture
versions sharing one prompt ID are in one document so their directory remains
a strict composition group. The old imported backend fragment contained no
application defaults; it was removed after its framework data moved rather
than introducing an unrelated defaults fragment. All four application configs
validate; both maintained render scripts, the composed-overlay render, the
inheritance render without credentials, and offline renders for each maintained
and fixture prompt/version pass.
Files: maintained prompt/profile YAML under `examples/` and Files: maintained prompt/profile YAML under `examples/` and
`testdata/promptkit-v0.9/`; their application configs and scripts; new `testdata/promptkit-v0.9/`; their application configs and scripts; new

View File

@@ -1,3 +1,5 @@
prompt_dir: ./examples/prompts promptkit_sources:
profile_dir: ./examples/profiles - directory: ./examples/prompts
- directory: ./examples/profiles
- file: ./examples/framework/backends.yml
schema_dir: ./examples/schemas schema_dir: ./examples/schemas

View File

@@ -2,7 +2,6 @@
configkit: configkit:
imports: imports:
- path: config-fragments/sources.yml - path: config-fragments/sources.yml
- path: config-fragments/backend.yml
server: server:
addr: :8080 addr: :8080

View File

@@ -1,16 +1,9 @@
prompt_dir: ./examples/prompts promptkit_sources:
profile_dir: ./examples/profiles - directory: ./examples/prompts
- directory: ./examples/profiles
- file: ./examples/framework/backends.yml
schema_dir: ./examples/schemas schema_dir: ./examples/schemas
backends:
local-gpu:
endpoint: http://localhost:11434/v1
api_key_env: LOCAL_GPU_API_KEY
extra_params:
provider_option: enabled
concurrency_limit: 2
queue_capacity: 0
server: server:
addr: 127.0.0.1:8080 addr: 127.0.0.1:8080
artifact_root: . artifact_root: .

View File

@@ -1,18 +1,6 @@
# Application paths are relative to the repository invocation directory. # Application paths are relative to the repository invocation directory.
prompt_dir: ./examples/prompts promptkit_sources:
profile_dir: ./examples/profiles - directory: ./examples/prompts
- directory: ./examples/profiles
- file: ./examples/framework/inheritance.yml
schema_dir: ./examples/schemas schema_dir: ./examples/schemas
backends:
local-base:
endpoint: http://localhost:11434/v1
api_key_env: LOCAL_GPU_API_KEY
concurrency_limit: 2
queue_capacity: 4
extra_params:
provider_option: true
local-gpu:
extends: local-base
queue_capacity: 0
extra_params:
provider_option: false

View File

@@ -1,5 +1,7 @@
prompt_dir: ./examples/prompts promptkit_sources:
profile_dir: ./examples/profiles - directory: ./examples/prompts
- directory: ./examples/profiles
- file: ./examples/framework/backends.yml
schema_dir: ./examples/schemas schema_dir: ./examples/schemas
server: server:

View File

@@ -2,3 +2,7 @@ backends:
local-gpu: local-gpu:
endpoint: http://localhost:11434/v1 endpoint: http://localhost:11434/v1
api_key_env: LOCAL_GPU_API_KEY api_key_env: LOCAL_GPU_API_KEY
extra_params:
provider_option: enabled
concurrency_limit: 2
queue_capacity: 0

View File

@@ -0,0 +1,13 @@
backends:
local-base:
endpoint: http://localhost:11434/v1
api_key_env: LOCAL_GPU_API_KEY
concurrency_limit: 2
queue_capacity: 4
extra_params:
provider_option: true
local-gpu:
extends: local-base
queue_capacity: 0
extra_params:
provider_option: false

View File

@@ -1,7 +1,8 @@
id: local-fast profiles:
endpoint: http://localhost:8000/v1 local-fast:
model: gpt-4o-mini endpoint: http://localhost:8000/v1
temperature: 0.2 model: gpt-4o-mini
max_tokens: 500 temperature: 0.2
top_p: 1.0 max_tokens: 500
timeout_seconds: 90 top_p: 1.0
timeout_seconds: 90

View File

@@ -1,4 +1,5 @@
id: local-gpu profiles:
backend: local-gpu local-gpu:
model: local-model backend: local-gpu
reasoning_effort: low model: local-model
reasoning_effort: low

View File

@@ -1,8 +1,9 @@
id: local-quality profiles:
endpoint: http://localhost:8000/v1 local-quality:
model: gpt-4.1 endpoint: http://localhost:8000/v1
temperature: 0.0 model: gpt-4.1
max_tokens: 1200 temperature: 0.0
top_p: 1.0 max_tokens: 1200
timeout_seconds: 180 top_p: 1.0
api_key_env: SCRIPTORIUM_API_KEY timeout_seconds: 180
api_key_env: SCRIPTORIUM_API_KEY

View File

@@ -1,8 +1,9 @@
id: dnd.session_recap prompts:
version: "1.0.0" dnd.session_recap:
default_profile: local-quality "1.0.0":
description: Example D&D session recap prompt definition for demonstration only. default_profile: local-quality
inputs: description: Example D&D session recap prompt definition for demonstration only.
inputs:
- name: transcript - name: transcript
required: true required: true
content_type: text/markdown content_type: text/markdown
@@ -11,12 +12,12 @@ inputs:
required: false required: false
content_type: text/yaml content_type: text/yaml
description: Optional glossary context description: Optional glossary context
messages: messages:
- role: system - role: system
content_file: ./dnd.session_recap.system.md content_file: ./dnd.session_recap.system.md
- role: user - role: user
content_file: ./dnd.session_recap.user.md content_file: ./dnd.session_recap.user.md
output: output:
format: markdown format: markdown
validation_mode: basic validation_mode: basic
repair_attempts: 0 repair_attempts: 0

View File

@@ -1,8 +1,9 @@
id: generic.markdown_summary prompts:
version: "1.0.0" generic.markdown_summary:
default_profile: local-fast "1.0.0":
description: Generic markdown summary from transcript and glossary. default_profile: local-fast
inputs: description: Generic markdown summary from transcript and glossary.
inputs:
- name: transcript - name: transcript
required: true required: true
content_type: text/markdown content_type: text/markdown
@@ -11,12 +12,12 @@ inputs:
required: false required: false
content_type: text/yaml content_type: text/yaml
description: Optional glossary context description: Optional glossary context
messages: messages:
- role: system - role: system
content_file: ./generic.markdown_summary.system.md content_file: ./generic.markdown_summary.system.md
- role: user - role: user
content_file: ./generic.markdown_summary.user.md content_file: ./generic.markdown_summary.user.md
output: output:
format: markdown format: markdown
validation_mode: basic validation_mode: basic
repair_attempts: 0 repair_attempts: 0

View File

@@ -1,8 +1,9 @@
id: generic.structured_events prompts:
version: "1.0.0" generic.structured_events:
default_profile: local-quality "1.0.0":
description: Produce structured event JSON from a transcript. default_profile: local-quality
inputs: description: Produce structured event JSON from a transcript.
inputs:
- name: transcript - name: transcript
required: true required: true
content_type: text/markdown content_type: text/markdown
@@ -11,12 +12,12 @@ inputs:
required: false required: false
content_type: text/yaml content_type: text/yaml
description: Optional glossary context description: Optional glossary context
messages: messages:
- role: system - role: system
content_file: ./generic.structured_events.system.md content_file: ./generic.structured_events.system.md
- role: user - role: user
content_file: ./generic.structured_events.user.md content_file: ./generic.structured_events.user.md
output: output:
format: json format: json
validation_mode: json_schema validation_mode: json_schema
schema_path: structured_events.schema.json schema_path: structured_events.schema.json

View File

@@ -1,12 +1,5 @@
prompt_dir: ./testdata/promptkit-v0.9/prompts promptkit_sources:
profile_dir: ./testdata/promptkit-v0.9/profiles - directory: ./testdata/promptkit-v0.9/prompts
- directory: ./testdata/promptkit-v0.9/profiles
- file: ./testdata/promptkit-v0.9/framework/backends.yml
schema_dir: ./testdata/promptkit-v0.9/schemas schema_dir: ./testdata/promptkit-v0.9/schemas
backends:
fixture-custom:
endpoint: http://127.0.0.1:11434/v1
api_key_env: FIXTURE_BACKEND_API_KEY
extra_params:
backend_option:
enabled: true
concurrency_limit: 2
queue_capacity: 0

View File

@@ -0,0 +1,9 @@
backends:
fixture-custom:
endpoint: http://127.0.0.1:11434/v1
api_key_env: FIXTURE_BACKEND_API_KEY
extra_params:
backend_option:
enabled: true
concurrency_limit: 2
queue_capacity: 0

View File

@@ -1,14 +1,15 @@
id: custom-base profiles:
backend: fixture-custom custom-base:
model: fixture-base-model backend: fixture-custom
temperature: 0.25 model: fixture-base-model
max_tokens: 640 temperature: 0.25
top_p: 0.9 max_tokens: 640
timeout_seconds: 45 top_p: 0.9
service_tier: flex timeout_seconds: 45
reasoning_effort: medium service_tier: flex
api_key_env: FIXTURE_PROFILE_API_KEY reasoning_effort: medium
extra_params: api_key_env: FIXTURE_PROFILE_API_KEY
extra_params:
routing: routing:
order: order:
- primary - primary

View File

@@ -1,4 +1,5 @@
id: custom-derived profiles:
base_profile: custom-base custom-derived:
model: fixture-derived-model extends: custom-base
reasoning_effort: high model: fixture-derived-model
reasoning_effort: high

View File

@@ -1,10 +1,11 @@
id: endpoint-only profiles:
endpoint: http://127.0.0.1:8000/v1 endpoint-only:
model: fixture-endpoint-model endpoint: http://127.0.0.1:8000/v1
temperature: 0.1 model: fixture-endpoint-model
max_tokens: 128 temperature: 0.1
top_p: 0.75 max_tokens: 128
timeout_seconds: 30 top_p: 0.75
extra_params: timeout_seconds: 30
extra_params:
endpoint_option: endpoint_option:
nested: true nested: true

View File

@@ -1,9 +1,10 @@
id: compat.complete prompts:
version: "1.0.0" compat.complete:
description: Exercise the complete Promptkit v0.9 prompt-definition surface. "1.0.0":
default_profile: custom-derived description: Exercise the complete Promptkit v0.9 prompt-definition surface.
session_id: 'fixture-{{.topic}}' default_profile: custom-derived
inputs: session_id: 'fixture-{{.topic}}'
inputs:
- name: source - name: source
required: true required: true
content_type: text/markdown content_type: text/markdown
@@ -12,7 +13,7 @@ inputs:
required: false required: false
content_type: text/plain content_type: text/plain
description: Optional caller context. description: Optional caller context.
messages: messages:
- role: developer - role: developer
content: 'Use the topic {{.topic}}.' content: 'Use the topic {{.topic}}.'
cache_control: cache_control:
@@ -24,8 +25,17 @@ messages:
content_file: ./messages/complete.user.md content_file: ./messages/complete.user.md
- role: assistant - role: assistant
content: Return one JSON object. content: Return one JSON object.
output: output:
format: json format: json
validation_mode: json_schema validation_mode: json_schema
schema_path: complete.schema.json schema_path: complete.schema.json
repair_attempts: 2 repair_attempts: 2
"2.0.0":
default_profile: endpoint-only
messages:
- role: user
content: Version two has no declared inputs.
output:
format: text
validation_mode: basic
repair_attempts: 1

View File

@@ -1,10 +0,0 @@
id: compat.complete
version: "2.0.0"
default_profile: endpoint-only
messages:
- role: user
content: Version two has no declared inputs.
output:
format: text
validation_mode: basic
repair_attempts: 1

View File

@@ -1,10 +1,11 @@
id: compat.json prompts:
version: "1.0.0" compat.json:
default_profile: endpoint-only "1.0.0":
messages: default_profile: endpoint-only
messages:
- role: user - role: user
content: Return JSON. content: Return JSON.
output: output:
format: json format: json
validation_mode: json validation_mode: json
repair_attempts: 0 repair_attempts: 0

View File

@@ -1,10 +1,11 @@
id: compat.none prompts:
version: "1.0.0" compat.none:
default_profile: endpoint-only "1.0.0":
messages: default_profile: endpoint-only
messages:
- role: user - role: user
content: Return text. content: Return text.
output: output:
format: text format: text
validation_mode: none validation_mode: none
repair_attempts: 0 repair_attempts: 0