Migrate native PromptKit test fixtures
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user