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
|
## 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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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: .
|
||||||
|
|||||||
@@ -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
|
|
||||||
|
|||||||
@@ -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:
|
||||||
|
|||||||
@@ -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
|
||||||
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
|
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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -1,22 +1,23 @@
|
|||||||
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.
|
||||||
- name: transcript
|
inputs:
|
||||||
required: true
|
- name: transcript
|
||||||
content_type: text/markdown
|
required: true
|
||||||
description: Session source content
|
content_type: text/markdown
|
||||||
- name: glossary
|
description: Session source content
|
||||||
required: false
|
- name: glossary
|
||||||
content_type: text/yaml
|
required: false
|
||||||
description: Optional glossary context
|
content_type: text/yaml
|
||||||
messages:
|
description: Optional glossary context
|
||||||
- role: system
|
messages:
|
||||||
content_file: ./dnd.session_recap.system.md
|
- role: system
|
||||||
- role: user
|
content_file: ./dnd.session_recap.system.md
|
||||||
content_file: ./dnd.session_recap.user.md
|
- role: user
|
||||||
output:
|
content_file: ./dnd.session_recap.user.md
|
||||||
format: markdown
|
output:
|
||||||
validation_mode: basic
|
format: markdown
|
||||||
repair_attempts: 0
|
validation_mode: basic
|
||||||
|
repair_attempts: 0
|
||||||
|
|||||||
@@ -1,22 +1,23 @@
|
|||||||
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.
|
||||||
- name: transcript
|
inputs:
|
||||||
required: true
|
- name: transcript
|
||||||
content_type: text/markdown
|
required: true
|
||||||
description: Source transcript content
|
content_type: text/markdown
|
||||||
- name: glossary
|
description: Source transcript content
|
||||||
required: false
|
- name: glossary
|
||||||
content_type: text/yaml
|
required: false
|
||||||
description: Optional glossary context
|
content_type: text/yaml
|
||||||
messages:
|
description: Optional glossary context
|
||||||
- role: system
|
messages:
|
||||||
content_file: ./generic.markdown_summary.system.md
|
- role: system
|
||||||
- role: user
|
content_file: ./generic.markdown_summary.system.md
|
||||||
content_file: ./generic.markdown_summary.user.md
|
- role: user
|
||||||
output:
|
content_file: ./generic.markdown_summary.user.md
|
||||||
format: markdown
|
output:
|
||||||
validation_mode: basic
|
format: markdown
|
||||||
repair_attempts: 0
|
validation_mode: basic
|
||||||
|
repair_attempts: 0
|
||||||
|
|||||||
@@ -1,23 +1,24 @@
|
|||||||
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.
|
||||||
- name: transcript
|
inputs:
|
||||||
required: true
|
- name: transcript
|
||||||
content_type: text/markdown
|
required: true
|
||||||
description: Source transcript content
|
content_type: text/markdown
|
||||||
- name: glossary
|
description: Source transcript content
|
||||||
required: false
|
- name: glossary
|
||||||
content_type: text/yaml
|
required: false
|
||||||
description: Optional glossary context
|
content_type: text/yaml
|
||||||
messages:
|
description: Optional glossary context
|
||||||
- role: system
|
messages:
|
||||||
content_file: ./generic.structured_events.system.md
|
- role: system
|
||||||
- role: user
|
content_file: ./generic.structured_events.system.md
|
||||||
content_file: ./generic.structured_events.user.md
|
- role: user
|
||||||
output:
|
content_file: ./generic.structured_events.user.md
|
||||||
format: json
|
output:
|
||||||
validation_mode: json_schema
|
format: json
|
||||||
schema_path: structured_events.schema.json
|
validation_mode: json_schema
|
||||||
repair_attempts: 0
|
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
|
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
|
|
||||||
|
|||||||
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
|
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
|
||||||
routing:
|
extra_params:
|
||||||
order:
|
routing:
|
||||||
- primary
|
order:
|
||||||
- fallback
|
- primary
|
||||||
allow_fallback: true
|
- fallback
|
||||||
|
allow_fallback: true
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
endpoint_option:
|
extra_params:
|
||||||
nested: true
|
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
|
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}}'
|
||||||
- name: source
|
inputs:
|
||||||
required: true
|
- name: source
|
||||||
content_type: text/markdown
|
required: true
|
||||||
description: Source material rendered by a file-backed message.
|
content_type: text/markdown
|
||||||
- name: context
|
description: Source material rendered by a file-backed message.
|
||||||
required: false
|
- name: context
|
||||||
content_type: text/plain
|
required: false
|
||||||
description: Optional caller context.
|
content_type: text/plain
|
||||||
messages:
|
description: Optional caller context.
|
||||||
- role: developer
|
messages:
|
||||||
content: 'Use the topic {{.topic}}.'
|
- role: developer
|
||||||
cache_control:
|
content: 'Use the topic {{.topic}}.'
|
||||||
type: ephemeral
|
cache_control:
|
||||||
ttl: 1h
|
type: ephemeral
|
||||||
- role: system
|
ttl: 1h
|
||||||
content_file: ./messages/complete.system.md
|
- role: system
|
||||||
- role: user
|
content_file: ./messages/complete.system.md
|
||||||
content_file: ./messages/complete.user.md
|
- role: user
|
||||||
- role: assistant
|
content_file: ./messages/complete.user.md
|
||||||
content: Return one JSON object.
|
- role: assistant
|
||||||
output:
|
content: Return one JSON object.
|
||||||
format: json
|
output:
|
||||||
validation_mode: json_schema
|
format: json
|
||||||
schema_path: complete.schema.json
|
validation_mode: json_schema
|
||||||
repair_attempts: 2
|
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
|
prompts:
|
||||||
version: "1.0.0"
|
compat.json:
|
||||||
default_profile: endpoint-only
|
"1.0.0":
|
||||||
messages:
|
default_profile: endpoint-only
|
||||||
- role: user
|
messages:
|
||||||
content: Return JSON.
|
- role: user
|
||||||
output:
|
content: Return JSON.
|
||||||
format: json
|
output:
|
||||||
validation_mode: json
|
format: json
|
||||||
repair_attempts: 0
|
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
|
prompts:
|
||||||
version: "1.0.0"
|
compat.none:
|
||||||
default_profile: endpoint-only
|
"1.0.0":
|
||||||
messages:
|
default_profile: endpoint-only
|
||||||
- role: user
|
messages:
|
||||||
content: Return text.
|
- role: user
|
||||||
output:
|
content: Return text.
|
||||||
format: text
|
output:
|
||||||
validation_mode: none
|
format: text
|
||||||
repair_attempts: 0
|
validation_mode: none
|
||||||
|
repair_attempts: 0
|
||||||
|
|||||||
Reference in New Issue
Block a user