Migrate native PromptKit test fixtures

This commit is contained in:
2026-11-06 00:59:05 +00:00
parent 983c22be77
commit 33cc36ff3b
6 changed files with 43 additions and 39 deletions

View File

@@ -18,8 +18,7 @@ import (
)
const adapterPrompt = `prompts:
briefing:
version: "1"
- id: briefing
default_profile: default
inputs:
- name: topic
@@ -36,8 +35,7 @@ const adapterPrompt = `prompts:
output:
format: text
validation_mode: none
empty:
version: "1"
- id: empty
default_profile: default
messages:
- role: user
@@ -46,10 +44,10 @@ const adapterPrompt = `prompts:
format: text
validation_mode: none
backends:
local:
- id: local
endpoint: "https://example.invalid/v1"
profiles:
default:
- id: default
backend: local
model: example
temperature: 0
@@ -61,15 +59,14 @@ profiles:
visible: true
null_value: null
sequence: [first, null, 3]
requires-key:
- id: requires-key
backend: local
model: example
api_key_required: true
`
const adapterRequirementsPrompt = `prompts:
briefing:
version: "1"
- id: briefing
default_profile: default
session_id: '{{input "session-only"}} {{.session_variable}}'
messages:
@@ -79,10 +76,10 @@ const adapterRequirementsPrompt = `prompts:
format: text
validation_mode: none
backends:
local:
- id: local
endpoint: "https://example.invalid/v1"
profiles:
default:
- id: default
backend: local
model: example
`
@@ -101,13 +98,22 @@ func adapterEngineFrom(t *testing.T, label, configuration string, options ...pro
}
engine, err := promptkit.NewEngine(promptkit.Config{Sources: promptkit.ConfigurationSources{
Underlays: []configkit.Underlay{{Inputs: inputs}},
}}, options...)
}}, append([]promptkit.Option{promptkit.WithBundledOpenRouter(false)}, options...)...)
if err != nil {
t.Fatalf("construct PromptKit fixture: %v", err)
}
return engine
}
func bundledEngine(t *testing.T) *promptkit.Engine {
t.Helper()
engine, err := promptkit.NewEngine(promptkit.Config{})
if err != nil {
t.Fatalf("construct bundled PromptKit fixture: %v", err)
}
return engine
}
type recordingSmokeClient struct {
request promptkit.GenerateRequest
response *promptkit.GenerateResponse