Migrate maintained PromptKit definitions and examples
This commit is contained in:
@@ -276,7 +276,16 @@ removed constructor API or backend schema remains in production code.
|
||||
|
||||
## 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
|
||||
`testdata/promptkit-v0.9/`; their application configs and scripts; new
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
prompt_dir: ./examples/prompts
|
||||
profile_dir: ./examples/profiles
|
||||
promptkit_sources:
|
||||
- directory: ./examples/prompts
|
||||
- directory: ./examples/profiles
|
||||
- file: ./examples/framework/backends.yml
|
||||
schema_dir: ./examples/schemas
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
configkit:
|
||||
imports:
|
||||
- path: config-fragments/sources.yml
|
||||
- path: config-fragments/backend.yml
|
||||
|
||||
server:
|
||||
addr: :8080
|
||||
|
||||
@@ -1,16 +1,9 @@
|
||||
prompt_dir: ./examples/prompts
|
||||
profile_dir: ./examples/profiles
|
||||
promptkit_sources:
|
||||
- directory: ./examples/prompts
|
||||
- directory: ./examples/profiles
|
||||
- file: ./examples/framework/backends.yml
|
||||
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:
|
||||
addr: 127.0.0.1:8080
|
||||
artifact_root: .
|
||||
|
||||
@@ -1,18 +1,6 @@
|
||||
# Application paths are relative to the repository invocation directory.
|
||||
prompt_dir: ./examples/prompts
|
||||
profile_dir: ./examples/profiles
|
||||
promptkit_sources:
|
||||
- directory: ./examples/prompts
|
||||
- directory: ./examples/profiles
|
||||
- file: ./examples/framework/inheritance.yml
|
||||
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
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
prompt_dir: ./examples/prompts
|
||||
profile_dir: ./examples/profiles
|
||||
promptkit_sources:
|
||||
- directory: ./examples/prompts
|
||||
- directory: ./examples/profiles
|
||||
- file: ./examples/framework/backends.yml
|
||||
schema_dir: ./examples/schemas
|
||||
|
||||
server:
|
||||
|
||||
@@ -2,3 +2,7 @@ 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
|
||||
13
examples/framework/inheritance.yml
Normal file
13
examples/framework/inheritance.yml
Normal 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
|
||||
@@ -1,7 +1,8 @@
|
||||
id: local-fast
|
||||
endpoint: http://localhost:8000/v1
|
||||
model: gpt-4o-mini
|
||||
temperature: 0.2
|
||||
max_tokens: 500
|
||||
top_p: 1.0
|
||||
timeout_seconds: 90
|
||||
profiles:
|
||||
local-fast:
|
||||
endpoint: http://localhost:8000/v1
|
||||
model: gpt-4o-mini
|
||||
temperature: 0.2
|
||||
max_tokens: 500
|
||||
top_p: 1.0
|
||||
timeout_seconds: 90
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
id: local-gpu
|
||||
backend: local-gpu
|
||||
model: local-model
|
||||
reasoning_effort: low
|
||||
profiles:
|
||||
local-gpu:
|
||||
backend: local-gpu
|
||||
model: local-model
|
||||
reasoning_effort: low
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
id: local-quality
|
||||
endpoint: http://localhost:8000/v1
|
||||
model: gpt-4.1
|
||||
temperature: 0.0
|
||||
max_tokens: 1200
|
||||
top_p: 1.0
|
||||
timeout_seconds: 180
|
||||
api_key_env: SCRIPTORIUM_API_KEY
|
||||
profiles:
|
||||
local-quality:
|
||||
endpoint: http://localhost:8000/v1
|
||||
model: gpt-4.1
|
||||
temperature: 0.0
|
||||
max_tokens: 1200
|
||||
top_p: 1.0
|
||||
timeout_seconds: 180
|
||||
api_key_env: SCRIPTORIUM_API_KEY
|
||||
|
||||
@@ -1,22 +1,23 @@
|
||||
id: dnd.session_recap
|
||||
version: "1.0.0"
|
||||
default_profile: local-quality
|
||||
description: Example D&D session recap prompt definition for demonstration only.
|
||||
inputs:
|
||||
- name: transcript
|
||||
required: true
|
||||
content_type: text/markdown
|
||||
description: Session source content
|
||||
- name: glossary
|
||||
required: false
|
||||
content_type: text/yaml
|
||||
description: Optional glossary context
|
||||
messages:
|
||||
- role: system
|
||||
content_file: ./dnd.session_recap.system.md
|
||||
- role: user
|
||||
content_file: ./dnd.session_recap.user.md
|
||||
output:
|
||||
format: markdown
|
||||
validation_mode: basic
|
||||
repair_attempts: 0
|
||||
prompts:
|
||||
dnd.session_recap:
|
||||
"1.0.0":
|
||||
default_profile: local-quality
|
||||
description: Example D&D session recap prompt definition for demonstration only.
|
||||
inputs:
|
||||
- name: transcript
|
||||
required: true
|
||||
content_type: text/markdown
|
||||
description: Session source content
|
||||
- name: glossary
|
||||
required: false
|
||||
content_type: text/yaml
|
||||
description: Optional glossary context
|
||||
messages:
|
||||
- role: system
|
||||
content_file: ./dnd.session_recap.system.md
|
||||
- role: user
|
||||
content_file: ./dnd.session_recap.user.md
|
||||
output:
|
||||
format: markdown
|
||||
validation_mode: basic
|
||||
repair_attempts: 0
|
||||
|
||||
@@ -1,22 +1,23 @@
|
||||
id: generic.markdown_summary
|
||||
version: "1.0.0"
|
||||
default_profile: local-fast
|
||||
description: Generic markdown summary from transcript and glossary.
|
||||
inputs:
|
||||
- name: transcript
|
||||
required: true
|
||||
content_type: text/markdown
|
||||
description: Source transcript content
|
||||
- name: glossary
|
||||
required: false
|
||||
content_type: text/yaml
|
||||
description: Optional glossary context
|
||||
messages:
|
||||
- role: system
|
||||
content_file: ./generic.markdown_summary.system.md
|
||||
- role: user
|
||||
content_file: ./generic.markdown_summary.user.md
|
||||
output:
|
||||
format: markdown
|
||||
validation_mode: basic
|
||||
repair_attempts: 0
|
||||
prompts:
|
||||
generic.markdown_summary:
|
||||
"1.0.0":
|
||||
default_profile: local-fast
|
||||
description: Generic markdown summary from transcript and glossary.
|
||||
inputs:
|
||||
- name: transcript
|
||||
required: true
|
||||
content_type: text/markdown
|
||||
description: Source transcript content
|
||||
- name: glossary
|
||||
required: false
|
||||
content_type: text/yaml
|
||||
description: Optional glossary context
|
||||
messages:
|
||||
- role: system
|
||||
content_file: ./generic.markdown_summary.system.md
|
||||
- role: user
|
||||
content_file: ./generic.markdown_summary.user.md
|
||||
output:
|
||||
format: markdown
|
||||
validation_mode: basic
|
||||
repair_attempts: 0
|
||||
|
||||
@@ -1,23 +1,24 @@
|
||||
id: generic.structured_events
|
||||
version: "1.0.0"
|
||||
default_profile: local-quality
|
||||
description: Produce structured event JSON from a transcript.
|
||||
inputs:
|
||||
- name: transcript
|
||||
required: true
|
||||
content_type: text/markdown
|
||||
description: Source transcript content
|
||||
- name: glossary
|
||||
required: false
|
||||
content_type: text/yaml
|
||||
description: Optional glossary context
|
||||
messages:
|
||||
- role: system
|
||||
content_file: ./generic.structured_events.system.md
|
||||
- role: user
|
||||
content_file: ./generic.structured_events.user.md
|
||||
output:
|
||||
format: json
|
||||
validation_mode: json_schema
|
||||
schema_path: structured_events.schema.json
|
||||
repair_attempts: 0
|
||||
prompts:
|
||||
generic.structured_events:
|
||||
"1.0.0":
|
||||
default_profile: local-quality
|
||||
description: Produce structured event JSON from a transcript.
|
||||
inputs:
|
||||
- name: transcript
|
||||
required: true
|
||||
content_type: text/markdown
|
||||
description: Source transcript content
|
||||
- name: glossary
|
||||
required: false
|
||||
content_type: text/yaml
|
||||
description: Optional glossary context
|
||||
messages:
|
||||
- role: system
|
||||
content_file: ./generic.structured_events.system.md
|
||||
- role: user
|
||||
content_file: ./generic.structured_events.user.md
|
||||
output:
|
||||
format: json
|
||||
validation_mode: json_schema
|
||||
schema_path: structured_events.schema.json
|
||||
repair_attempts: 0
|
||||
|
||||
15
testdata/promptkit-v0.9/config.yml
vendored
15
testdata/promptkit-v0.9/config.yml
vendored
@@ -1,12 +1,5 @@
|
||||
prompt_dir: ./testdata/promptkit-v0.9/prompts
|
||||
profile_dir: ./testdata/promptkit-v0.9/profiles
|
||||
promptkit_sources:
|
||||
- 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
|
||||
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
|
||||
|
||||
9
testdata/promptkit-v0.9/framework/backends.yml
vendored
Normal file
9
testdata/promptkit-v0.9/framework/backends.yml
vendored
Normal 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
|
||||
@@ -1,16 +1,17 @@
|
||||
id: custom-base
|
||||
backend: fixture-custom
|
||||
model: fixture-base-model
|
||||
temperature: 0.25
|
||||
max_tokens: 640
|
||||
top_p: 0.9
|
||||
timeout_seconds: 45
|
||||
service_tier: flex
|
||||
reasoning_effort: medium
|
||||
api_key_env: FIXTURE_PROFILE_API_KEY
|
||||
extra_params:
|
||||
routing:
|
||||
order:
|
||||
- primary
|
||||
- fallback
|
||||
allow_fallback: true
|
||||
profiles:
|
||||
custom-base:
|
||||
backend: fixture-custom
|
||||
model: fixture-base-model
|
||||
temperature: 0.25
|
||||
max_tokens: 640
|
||||
top_p: 0.9
|
||||
timeout_seconds: 45
|
||||
service_tier: flex
|
||||
reasoning_effort: medium
|
||||
api_key_env: FIXTURE_PROFILE_API_KEY
|
||||
extra_params:
|
||||
routing:
|
||||
order:
|
||||
- primary
|
||||
- fallback
|
||||
allow_fallback: true
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
id: custom-derived
|
||||
base_profile: custom-base
|
||||
model: fixture-derived-model
|
||||
reasoning_effort: high
|
||||
profiles:
|
||||
custom-derived:
|
||||
extends: custom-base
|
||||
model: fixture-derived-model
|
||||
reasoning_effort: high
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
id: endpoint-only
|
||||
endpoint: http://127.0.0.1:8000/v1
|
||||
model: fixture-endpoint-model
|
||||
temperature: 0.1
|
||||
max_tokens: 128
|
||||
top_p: 0.75
|
||||
timeout_seconds: 30
|
||||
extra_params:
|
||||
endpoint_option:
|
||||
nested: true
|
||||
profiles:
|
||||
endpoint-only:
|
||||
endpoint: http://127.0.0.1:8000/v1
|
||||
model: fixture-endpoint-model
|
||||
temperature: 0.1
|
||||
max_tokens: 128
|
||||
top_p: 0.75
|
||||
timeout_seconds: 30
|
||||
extra_params:
|
||||
endpoint_option:
|
||||
nested: true
|
||||
|
||||
72
testdata/promptkit-v0.9/prompts/complete-v1.yaml
vendored
72
testdata/promptkit-v0.9/prompts/complete-v1.yaml
vendored
@@ -1,31 +1,41 @@
|
||||
id: compat.complete
|
||||
version: "1.0.0"
|
||||
description: Exercise the complete Promptkit v0.9 prompt-definition surface.
|
||||
default_profile: custom-derived
|
||||
session_id: 'fixture-{{.topic}}'
|
||||
inputs:
|
||||
- name: source
|
||||
required: true
|
||||
content_type: text/markdown
|
||||
description: Source material rendered by a file-backed message.
|
||||
- name: context
|
||||
required: false
|
||||
content_type: text/plain
|
||||
description: Optional caller context.
|
||||
messages:
|
||||
- role: developer
|
||||
content: 'Use the topic {{.topic}}.'
|
||||
cache_control:
|
||||
type: ephemeral
|
||||
ttl: 1h
|
||||
- role: system
|
||||
content_file: ./messages/complete.system.md
|
||||
- role: user
|
||||
content_file: ./messages/complete.user.md
|
||||
- role: assistant
|
||||
content: Return one JSON object.
|
||||
output:
|
||||
format: json
|
||||
validation_mode: json_schema
|
||||
schema_path: complete.schema.json
|
||||
repair_attempts: 2
|
||||
prompts:
|
||||
compat.complete:
|
||||
"1.0.0":
|
||||
description: Exercise the complete Promptkit v0.9 prompt-definition surface.
|
||||
default_profile: custom-derived
|
||||
session_id: 'fixture-{{.topic}}'
|
||||
inputs:
|
||||
- name: source
|
||||
required: true
|
||||
content_type: text/markdown
|
||||
description: Source material rendered by a file-backed message.
|
||||
- name: context
|
||||
required: false
|
||||
content_type: text/plain
|
||||
description: Optional caller context.
|
||||
messages:
|
||||
- role: developer
|
||||
content: 'Use the topic {{.topic}}.'
|
||||
cache_control:
|
||||
type: ephemeral
|
||||
ttl: 1h
|
||||
- role: system
|
||||
content_file: ./messages/complete.system.md
|
||||
- role: user
|
||||
content_file: ./messages/complete.user.md
|
||||
- role: assistant
|
||||
content: Return one JSON object.
|
||||
output:
|
||||
format: json
|
||||
validation_mode: json_schema
|
||||
schema_path: complete.schema.json
|
||||
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
|
||||
|
||||
10
testdata/promptkit-v0.9/prompts/complete-v2.yml
vendored
10
testdata/promptkit-v0.9/prompts/complete-v2.yml
vendored
@@ -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
|
||||
21
testdata/promptkit-v0.9/prompts/json.yaml
vendored
21
testdata/promptkit-v0.9/prompts/json.yaml
vendored
@@ -1,10 +1,11 @@
|
||||
id: compat.json
|
||||
version: "1.0.0"
|
||||
default_profile: endpoint-only
|
||||
messages:
|
||||
- role: user
|
||||
content: Return JSON.
|
||||
output:
|
||||
format: json
|
||||
validation_mode: json
|
||||
repair_attempts: 0
|
||||
prompts:
|
||||
compat.json:
|
||||
"1.0.0":
|
||||
default_profile: endpoint-only
|
||||
messages:
|
||||
- role: user
|
||||
content: Return JSON.
|
||||
output:
|
||||
format: json
|
||||
validation_mode: json
|
||||
repair_attempts: 0
|
||||
|
||||
21
testdata/promptkit-v0.9/prompts/none.yaml
vendored
21
testdata/promptkit-v0.9/prompts/none.yaml
vendored
@@ -1,10 +1,11 @@
|
||||
id: compat.none
|
||||
version: "1.0.0"
|
||||
default_profile: endpoint-only
|
||||
messages:
|
||||
- role: user
|
||||
content: Return text.
|
||||
output:
|
||||
format: text
|
||||
validation_mode: none
|
||||
repair_attempts: 0
|
||||
prompts:
|
||||
compat.none:
|
||||
"1.0.0":
|
||||
default_profile: endpoint-only
|
||||
messages:
|
||||
- role: user
|
||||
content: Return text.
|
||||
output:
|
||||
format: text
|
||||
validation_mode: none
|
||||
repair_attempts: 0
|
||||
|
||||
Reference in New Issue
Block a user