Migrate maintained PromptKit definitions and fixtures
This commit is contained in:
@@ -1089,7 +1089,7 @@ func TestRenderCommandExplicitZeroTemperatureReachesEffectiveSettings(t *testing
|
||||
|
||||
writePromptFile(t, lib.promptDir, "prompt.render", "local-default")
|
||||
profile := `profiles:
|
||||
local-default:
|
||||
- id: local-default
|
||||
endpoint: http://127.0.0.1:1/v1
|
||||
model: profile-model
|
||||
temperature: 0.7
|
||||
@@ -1147,7 +1147,7 @@ func TestRenderCommandLoadsImportsAndOverlayWithoutChangingExecutionProfile(t *t
|
||||
t.Fatal(err)
|
||||
}
|
||||
base := filepath.Join(lib.rootDir, "config.yml")
|
||||
framework := writeFrameworkSourceFile(t, lib.rootDir, "framework.yml", "configkit:\n imports:\n - path: prompts/prompt.render.yaml\n")
|
||||
framework := writeFrameworkSourceFile(t, lib.rootDir, "framework.yml", "config:\n imports:\n - path: prompts/prompt.render.yaml\n required: true\n")
|
||||
for path, body := range map[string]string{
|
||||
base: "config:\n imports:\n - path: fragments/sources.yml\n required: true\n",
|
||||
filepath.Join(lib.rootDir, "fragments", "sources.yml"): fmt.Sprintf("promptkit_sources:\n - file: %q\n - directory: %q\n", framework, lib.profileDir),
|
||||
@@ -1174,25 +1174,24 @@ func TestRenderCommandLoadsImportsAndOverlayWithoutChangingExecutionProfile(t *t
|
||||
func TestRenderCommandUsesConfiguredCustomBackend(t *testing.T) {
|
||||
lib := newCLITestLibrary(t)
|
||||
writePromptDefinition(t, lib.promptDir, "custom.yaml", `prompts:
|
||||
custom:
|
||||
"1":
|
||||
default_profile: local-gpu
|
||||
messages:
|
||||
- role: user
|
||||
content: "hello"
|
||||
output:
|
||||
format: text
|
||||
validation_mode: none
|
||||
- id: custom
|
||||
default_profile: local-gpu
|
||||
messages:
|
||||
- role: user
|
||||
content: "hello"
|
||||
output:
|
||||
format: text
|
||||
validation_mode: none
|
||||
`)
|
||||
if err := os.WriteFile(filepath.Join(lib.profileDir, "local-gpu.yaml"), []byte(`profiles:
|
||||
local-gpu:
|
||||
- id: local-gpu
|
||||
backend: local-gpu
|
||||
model: local-model
|
||||
`), 0o644); err != nil {
|
||||
t.Fatalf("write profile fixture: %v", err)
|
||||
}
|
||||
configPath := writeCLIFrameworkConfig(t, lib, `backends:
|
||||
local-gpu:
|
||||
- id: local-gpu
|
||||
endpoint: http://localhost:11434/v1
|
||||
extra_params:
|
||||
provider_option: enabled
|
||||
@@ -1215,30 +1214,29 @@ func TestRenderCommandUsesConfiguredCustomBackend(t *testing.T) {
|
||||
func TestRenderCommandUsesInheritedCustomBackend(t *testing.T) {
|
||||
lib := newCLITestLibrary(t)
|
||||
writePromptDefinition(t, lib.promptDir, "custom.yaml", `prompts:
|
||||
custom:
|
||||
"1":
|
||||
default_profile: local-gpu
|
||||
messages:
|
||||
- role: user
|
||||
content: "hello"
|
||||
output:
|
||||
format: text
|
||||
validation_mode: none
|
||||
- id: custom
|
||||
default_profile: local-gpu
|
||||
messages:
|
||||
- role: user
|
||||
content: "hello"
|
||||
output:
|
||||
format: text
|
||||
validation_mode: none
|
||||
`)
|
||||
if err := os.WriteFile(filepath.Join(lib.profileDir, "local-gpu.yaml"), []byte(`profiles:
|
||||
local-gpu:
|
||||
- id: local-gpu
|
||||
backend: local-gpu
|
||||
model: local-model
|
||||
`), 0o644); err != nil {
|
||||
t.Fatalf("write profile fixture: %v", err)
|
||||
}
|
||||
configPath := writeCLIFrameworkConfig(t, lib, `backends:
|
||||
local-base:
|
||||
- id: local-base
|
||||
endpoint: http://localhost:11434/v1
|
||||
api_key_env: LOCAL_GPU_API_KEY
|
||||
concurrency_limit: 2
|
||||
local-gpu:
|
||||
extends: local-base
|
||||
- id: local-gpu
|
||||
extends: {id: local-base}
|
||||
queue_capacity: 0
|
||||
extra_params:
|
||||
provider_option: false
|
||||
@@ -1267,17 +1265,16 @@ func TestRenderCommandUsesInheritedCustomBackend(t *testing.T) {
|
||||
func TestConfiguredBackendPreservesIntegerParameterAndOptionalCredential(t *testing.T) {
|
||||
lib := newCLITestLibrary(t)
|
||||
writePromptDefinition(t, lib.promptDir, "custom.yaml", `prompts:
|
||||
custom:
|
||||
"1":
|
||||
default_profile: local-gpu
|
||||
messages:
|
||||
- role: user
|
||||
content: "hello"
|
||||
output:
|
||||
format: text
|
||||
validation_mode: none
|
||||
- id: custom
|
||||
default_profile: local-gpu
|
||||
messages:
|
||||
- role: user
|
||||
content: "hello"
|
||||
output:
|
||||
format: text
|
||||
validation_mode: none
|
||||
`)
|
||||
if err := os.WriteFile(filepath.Join(lib.profileDir, "local-gpu.yaml"), []byte("profiles:\n local-gpu:\n backend: local-gpu\n model: local-model\n"), 0o644); err != nil {
|
||||
if err := os.WriteFile(filepath.Join(lib.profileDir, "local-gpu.yaml"), []byte("profiles:\n - id: local-gpu\n backend: local-gpu\n model: local-model\n"), 0o644); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
const credentialName = "SCRIPTORIUM_OPTIONAL_BACKEND_KEY"
|
||||
@@ -1301,7 +1298,7 @@ func TestConfiguredBackendPreservesIntegerParameterAndOptionalCredential(t *test
|
||||
}))
|
||||
defer provider.Close()
|
||||
configPath := writeCLIFrameworkConfig(t, lib, fmt.Sprintf(`backends:
|
||||
local-gpu:
|
||||
- id: local-gpu
|
||||
endpoint: %q
|
||||
api_key_env: %s
|
||||
extra_params:
|
||||
@@ -1324,19 +1321,18 @@ func TestConfiguredBackendPreservesIntegerParameterAndOptionalCredential(t *test
|
||||
func TestRenderCommandMapsReasoningEffortAndSessionID(t *testing.T) {
|
||||
lib := newCLITestLibrary(t)
|
||||
writePromptDefinition(t, lib.promptDir, "session.yaml", `prompts:
|
||||
session:
|
||||
"1":
|
||||
default_profile: local
|
||||
session_id: definition-session
|
||||
messages:
|
||||
- role: user
|
||||
content: "hello"
|
||||
output:
|
||||
format: text
|
||||
validation_mode: none
|
||||
- id: session
|
||||
default_profile: local
|
||||
session_id: definition-session
|
||||
messages:
|
||||
- role: user
|
||||
content: "hello"
|
||||
output:
|
||||
format: text
|
||||
validation_mode: none
|
||||
`)
|
||||
if err := os.WriteFile(filepath.Join(lib.profileDir, "local.yaml"), []byte(`profiles:
|
||||
local:
|
||||
- id: local
|
||||
endpoint: http://127.0.0.1:1/v1
|
||||
model: local-model
|
||||
reasoning_effort: low
|
||||
@@ -1383,15 +1379,14 @@ func TestRenderCommandMapsReasoningEffortAndSessionID(t *testing.T) {
|
||||
func TestRenderCommandOmitsEmptyEffectiveSessionID(t *testing.T) {
|
||||
lib := newCLITestLibrary(t)
|
||||
writePromptDefinition(t, lib.promptDir, "plain.yaml", `prompts:
|
||||
plain:
|
||||
"1":
|
||||
default_profile: local
|
||||
messages:
|
||||
- role: user
|
||||
content: "hello"
|
||||
output:
|
||||
format: text
|
||||
validation_mode: none
|
||||
- id: plain
|
||||
default_profile: local
|
||||
messages:
|
||||
- role: user
|
||||
content: "hello"
|
||||
output:
|
||||
format: text
|
||||
validation_mode: none
|
||||
`)
|
||||
writeProfileFile(t, lib.profileDir, "local", "http://127.0.0.1:1/v1", "local-model")
|
||||
|
||||
@@ -1412,15 +1407,14 @@ func TestRenderCommandOmitsEmptyEffectiveSessionID(t *testing.T) {
|
||||
func TestRenderCommandRejectsOverlongSessionID(t *testing.T) {
|
||||
lib := newCLITestLibrary(t)
|
||||
writePromptDefinition(t, lib.promptDir, "session.yaml", `prompts:
|
||||
session:
|
||||
"1":
|
||||
default_profile: local
|
||||
messages:
|
||||
- role: user
|
||||
content: "hello"
|
||||
output:
|
||||
format: text
|
||||
validation_mode: none
|
||||
- id: session
|
||||
default_profile: local
|
||||
messages:
|
||||
- role: user
|
||||
content: "hello"
|
||||
output:
|
||||
format: text
|
||||
validation_mode: none
|
||||
`)
|
||||
writeProfileFile(t, lib.profileDir, "local", "http://127.0.0.1:1/v1", "local-model")
|
||||
|
||||
@@ -1883,7 +1877,7 @@ func TestPromptkitProfileInspectionResolvesSupportedTargets(t *testing.T) {
|
||||
}{
|
||||
{name: "inherited custom backend", profileID: "custom-derived", wantBackend: "fixture-custom", wantModel: "fixture-derived-model", wantAPIKeyEnv: "FIXTURE_PROFILE_API_KEY"},
|
||||
{name: "endpoint only", profileID: "endpoint-only", wantModel: "fixture-endpoint-model"},
|
||||
{name: "built in", profileID: "promptkit-openrouter-auto", wantBackend: "openrouter", wantModel: "openrouter/auto", wantAPIKeyEnv: "OPENROUTER_API_KEY"},
|
||||
{name: "built in", profileID: "auto", wantBackend: "openrouter", wantModel: "openrouter/auto"},
|
||||
}
|
||||
|
||||
for _, tc := range tests {
|
||||
@@ -1929,21 +1923,20 @@ func TestPromptkitProfileInspectionResolvesSupportedTargets(t *testing.T) {
|
||||
func TestProfileInspectionUsesCombinedSourcesAndValidatesUnusedPrompts(t *testing.T) {
|
||||
lib := newCLITestLibrary(t)
|
||||
combined := `backends:
|
||||
fixture:
|
||||
- id: fixture
|
||||
endpoint: http://127.0.0.1:1/v1
|
||||
profiles:
|
||||
inspectable:
|
||||
- id: inspectable
|
||||
backend: fixture
|
||||
model: fixture-model
|
||||
prompts:
|
||||
unused:
|
||||
"1.0.0":
|
||||
messages:
|
||||
- role: user
|
||||
content: "valid unused prompt"
|
||||
output:
|
||||
format: text
|
||||
validation_mode: none
|
||||
- id: unused
|
||||
messages:
|
||||
- role: user
|
||||
content: "valid unused prompt"
|
||||
output:
|
||||
format: text
|
||||
validation_mode: none
|
||||
`
|
||||
frameworkPath := writeFrameworkFile(t, lib.rootDir, "combined.yml", combined)
|
||||
configPath := writeAppConfigFile(t, fmt.Sprintf("promptkit_sources:\n - file: %q\n", frameworkPath))
|
||||
@@ -1976,19 +1969,18 @@ func TestMaintainedProfilesResolveAcrossSelectionAndSourcePrecedence(t *testing.
|
||||
promptDir := t.TempDir()
|
||||
profileDir := t.TempDir()
|
||||
writePromptDefinition(t, promptDir, "maintained.yaml", `prompts:
|
||||
maintained:
|
||||
"1.0.0":
|
||||
default_profile: promptkit-openrouter-standard
|
||||
messages:
|
||||
- role: user
|
||||
content: Hello
|
||||
output:
|
||||
format: text
|
||||
validation_mode: none
|
||||
- id: maintained
|
||||
default_profile: gpt-sol-latest
|
||||
messages:
|
||||
- role: user
|
||||
content: Hello
|
||||
output:
|
||||
format: text
|
||||
validation_mode: none
|
||||
`)
|
||||
configPath := writeAppConfigFile(t, sourceSelectionsYAML(promptDir, profileDir, ""))
|
||||
|
||||
for _, profileID := range []string{"promptkit-openrouter-standard", "promptkit-openrouter-auto"} {
|
||||
for _, profileID := range []string{"gpt-sol-latest", "auto"} {
|
||||
t.Run(profileID+" inspection", func(t *testing.T) {
|
||||
code, stdout, stderr := runCLICommand(t, inspectCommand, []string{"profile", "--config", configPath, "--profile", profileID, "--format", "json"})
|
||||
if code != ExitOK {
|
||||
@@ -2001,7 +1993,7 @@ func TestMaintainedProfilesResolveAcrossSelectionAndSourcePrecedence(t *testing.
|
||||
if inspection.ProfileID != profileID || pointerValue(inspection.ProfileModelParams.BackendID) != "openrouter" || pointerValue(inspection.ProfileModelParams.Model) == "" {
|
||||
t.Fatalf("maintained profile did not resolve: %+v", inspection)
|
||||
}
|
||||
if profileID == "promptkit-openrouter-auto" && pointerValue(inspection.ProfileModelParams.Model) != "openrouter/auto" {
|
||||
if profileID == "auto" && pointerValue(inspection.ProfileModelParams.Model) != "openrouter/auto" {
|
||||
t.Fatalf("unexpected auto target: %+v", inspection.ProfileModelParams)
|
||||
}
|
||||
})
|
||||
@@ -2012,8 +2004,8 @@ func TestMaintainedProfilesResolveAcrossSelectionAndSourcePrecedence(t *testing.
|
||||
selection []string
|
||||
wantID string
|
||||
}{
|
||||
{name: "prompt default", wantID: "promptkit-openrouter-standard"},
|
||||
{name: "explicit selection", selection: []string{"--profile", "promptkit-openrouter-auto"}, wantID: "promptkit-openrouter-auto"},
|
||||
{name: "prompt default", wantID: "gpt-sol-latest"},
|
||||
{name: "explicit selection", selection: []string{"--profile", "auto"}, wantID: "auto"},
|
||||
} {
|
||||
t.Run(tc.name, func(t *testing.T) {
|
||||
args := append([]string{"--config", configPath, "--prompt", "maintained", "--format", "json"}, tc.selection...)
|
||||
@@ -2034,11 +2026,11 @@ func TestMaintainedProfilesResolveAcrossSelectionAndSourcePrecedence(t *testing.
|
||||
})
|
||||
}
|
||||
|
||||
writePromptDefinition(t, profileDir, "derived.yaml", "profiles:\n derived-maintained:\n extends: promptkit-openrouter-standard\n model: fixture-inherited-model\n")
|
||||
writePromptDefinition(t, profileDir, "replacement.yaml", "profiles:\n promptkit-openrouter-auto:\n backend: openrouter\n model: fixture-override-model\n")
|
||||
writePromptDefinition(t, profileDir, "derived.yaml", "profiles:\n - id: derived-maintained\n extends: {id: gpt-sol-latest}\n model: fixture-inherited-model\n")
|
||||
writePromptDefinition(t, profileDir, "replacement.yaml", "profiles:\n - id: auto\n backend: openrouter\n model: fixture-override-model\n")
|
||||
for _, tc := range []struct{ id, model string }{
|
||||
{id: "derived-maintained", model: "fixture-inherited-model"},
|
||||
{id: "promptkit-openrouter-auto", model: "fixture-override-model"},
|
||||
{id: "auto", model: "fixture-override-model"},
|
||||
} {
|
||||
t.Run(tc.id+" source", func(t *testing.T) {
|
||||
code, stdout, stderr := runCLICommand(t, inspectCommand, []string{"profile", "--config", configPath, "--profile", tc.id, "--format", "json"})
|
||||
@@ -2089,7 +2081,7 @@ func TestProfileInspectionHonorsDirectoryPrecedenceOutputAndFailures(t *testing.
|
||||
args := []string{"profile", "--config", configPath, "--profile", profileID}
|
||||
if profileID == "invalid" {
|
||||
profileDir := t.TempDir()
|
||||
writePromptDefinition(t, profileDir, "invalid.yaml", "profiles:\n invalid:\n endpoint: not-a-url\n model: fixture\n")
|
||||
writePromptDefinition(t, profileDir, "invalid.yaml", "profiles:\n - id: invalid\n endpoint: not-a-url\n model: fixture\n")
|
||||
args = append(args,
|
||||
"--promptkit-source", filepath.Join(fixtureRoot, "prompts"),
|
||||
"--promptkit-source", profileDir,
|
||||
@@ -2114,14 +2106,14 @@ func TestConfiguredBackendValidationComesFromPromptkit(t *testing.T) {
|
||||
{
|
||||
name: "invalid endpoint",
|
||||
backend: `backends:
|
||||
local-gpu:
|
||||
- id: local-gpu
|
||||
endpoint: not-a-url
|
||||
`,
|
||||
},
|
||||
{
|
||||
name: "invalid capacity relationship",
|
||||
backend: `backends:
|
||||
local-gpu:
|
||||
- id: local-gpu
|
||||
endpoint: http://localhost:11434/v1
|
||||
queue_capacity: 0
|
||||
`,
|
||||
@@ -2129,7 +2121,7 @@ func TestConfiguredBackendValidationComesFromPromptkit(t *testing.T) {
|
||||
{
|
||||
name: "reserved extra parameter",
|
||||
backend: `backends:
|
||||
local-gpu:
|
||||
- id: local-gpu
|
||||
endpoint: http://localhost:11434/v1
|
||||
extra_params:
|
||||
model: forbidden
|
||||
@@ -2154,12 +2146,12 @@ func TestConfiguredBackendValidationComesFromPromptkit(t *testing.T) {
|
||||
|
||||
t.Run("built-in backend overlay", func(t *testing.T) {
|
||||
configPath := writeCLIFrameworkConfig(t, lib, `backends:
|
||||
openrouter:
|
||||
- id: openrouter
|
||||
endpoint: http://localhost:11434/v1
|
||||
`, "")
|
||||
code, stdout, stderr := runCLICommand(t, inspectCommand, []string{
|
||||
"profile", "--config", configPath,
|
||||
"--profile", "promptkit-openrouter-auto", "--format", "json",
|
||||
"--profile", "auto", "--format", "json",
|
||||
})
|
||||
if code != ExitOK {
|
||||
t.Fatalf("built-in backend overlay failed: code=%d out=%q err=%q", code, stdout, stderr)
|
||||
@@ -2177,10 +2169,10 @@ func TestConfiguredBackendValidationComesFromPromptkit(t *testing.T) {
|
||||
func TestInheritedBackendParentStillReceivesPromptkitValidation(t *testing.T) {
|
||||
lib := newCLITestLibrary(t)
|
||||
configPath := writeCLIFrameworkConfig(t, lib, `backends:
|
||||
base:
|
||||
- id: base
|
||||
endpoint: not-a-url
|
||||
child:
|
||||
extends: base
|
||||
- id: child
|
||||
extends: {id: base}
|
||||
endpoint: http://localhost:11434/v1
|
||||
`, "")
|
||||
cfg, err := parseRenderArgs([]string{"--config", configPath, "--prompt", "custom"})
|
||||
@@ -2332,7 +2324,7 @@ func TestRenderCommandUsesBuiltInProfileWithoutCustomProfileSource(t *testing.T)
|
||||
lib := newCLITestLibrary(t)
|
||||
inputPath := lib.writeInputFile(t, "transcript.md", "hello")
|
||||
|
||||
writePromptFile(t, lib.promptDir, "prompt.builtin", "mistral-small-3")
|
||||
writePromptFile(t, lib.promptDir, "prompt.builtin", "auto")
|
||||
|
||||
code, stdout, stderr := runCLICommand(t, renderCommand, []string{
|
||||
"--config", lib.configPath,
|
||||
@@ -2343,10 +2335,10 @@ func TestRenderCommandUsesBuiltInProfileWithoutCustomProfileSource(t *testing.T)
|
||||
if code != ExitOK {
|
||||
t.Fatalf("expected ExitOK, got %d stderr=%q", code, stderr)
|
||||
}
|
||||
if !strings.Contains(stdout, "selected_profile_id: mistral-small-3") {
|
||||
if !strings.Contains(stdout, "selected_profile_id: auto") {
|
||||
t.Fatalf("expected built-in selected profile, got %q", stdout)
|
||||
}
|
||||
if !strings.Contains(stdout, "model: mistralai/mistral-small-3.2-24b-instruct") {
|
||||
if !strings.Contains(stdout, "model: openrouter/auto") {
|
||||
t.Fatalf("expected built-in model, got %q", stdout)
|
||||
}
|
||||
}
|
||||
@@ -2385,54 +2377,50 @@ func TestRenderCommandUsesDefinitionInputRules(t *testing.T) {
|
||||
writeProfileFile(t, lib.profileDir, "local", "http://127.0.0.1:1/v1", "model")
|
||||
|
||||
writePromptDefinition(t, lib.promptDir, "sole.yaml", `prompts:
|
||||
sole:
|
||||
"1":
|
||||
default_profile: local
|
||||
messages:
|
||||
- role: user
|
||||
content: "hello"
|
||||
output:
|
||||
format: text
|
||||
validation_mode: none
|
||||
- id: sole
|
||||
default_profile: local
|
||||
messages:
|
||||
- role: user
|
||||
content: "hello"
|
||||
output:
|
||||
format: text
|
||||
validation_mode: none
|
||||
`)
|
||||
writePromptDefinition(t, lib.promptDir, "optional.yaml", `prompts:
|
||||
optional:
|
||||
"1":
|
||||
default_profile: local
|
||||
inputs:
|
||||
- name: note
|
||||
required: false
|
||||
messages:
|
||||
- role: user
|
||||
content: "hello"
|
||||
output:
|
||||
format: text
|
||||
validation_mode: none
|
||||
- id: optional
|
||||
default_profile: local
|
||||
inputs:
|
||||
- name: note
|
||||
required: false
|
||||
messages:
|
||||
- role: user
|
||||
content: "hello"
|
||||
output:
|
||||
format: text
|
||||
validation_mode: none
|
||||
`)
|
||||
writePromptDefinition(t, lib.promptDir, "required.yaml", `prompts:
|
||||
required:
|
||||
"1":
|
||||
default_profile: local
|
||||
inputs:
|
||||
- name: note
|
||||
required: true
|
||||
messages:
|
||||
- role: user
|
||||
content: "hello"
|
||||
output:
|
||||
format: text
|
||||
validation_mode: none
|
||||
- id: required
|
||||
default_profile: local
|
||||
inputs:
|
||||
- name: note
|
||||
required: true
|
||||
messages:
|
||||
- role: user
|
||||
content: "hello"
|
||||
output:
|
||||
format: text
|
||||
validation_mode: none
|
||||
`)
|
||||
writePromptDefinition(t, lib.promptDir, "template.yaml", `prompts:
|
||||
template:
|
||||
"1":
|
||||
default_profile: local
|
||||
messages:
|
||||
- role: user
|
||||
content: '{{input "note"}}'
|
||||
output:
|
||||
format: text
|
||||
validation_mode: none
|
||||
- id: template
|
||||
default_profile: local
|
||||
messages:
|
||||
- role: user
|
||||
content: '{{input "note"}}'
|
||||
output:
|
||||
format: text
|
||||
validation_mode: none
|
||||
`)
|
||||
|
||||
baseArgs := []string{"--config", lib.configPath, "--promptkit-source", lib.promptDir, "--promptkit-source", lib.profileDir}
|
||||
@@ -2746,19 +2734,18 @@ func writePromptDefinition(t *testing.T, dir, name, definition string) {
|
||||
func writePromptFileWithTemplate(t *testing.T, dir, id, defaultProfile, templateContent string) {
|
||||
t.Helper()
|
||||
data := fmt.Sprintf(`prompts:
|
||||
%q:
|
||||
"1.0.0":
|
||||
default_profile: %q
|
||||
inputs:
|
||||
- name: transcript
|
||||
required: true
|
||||
messages:
|
||||
- role: user
|
||||
content: %q
|
||||
output:
|
||||
format: text
|
||||
validation_mode: none
|
||||
repair_attempts: 0
|
||||
- id: %q
|
||||
default_profile: %q
|
||||
inputs:
|
||||
- name: transcript
|
||||
required: true
|
||||
messages:
|
||||
- role: user
|
||||
content: %q
|
||||
output:
|
||||
format: text
|
||||
validation_mode: none
|
||||
repair_attempts: 0
|
||||
`, id, defaultProfile, templateContent)
|
||||
if err := os.WriteFile(filepath.Join(dir, id+".yaml"), []byte(data), 0o644); err != nil {
|
||||
t.Fatalf("failed to write prompt fixture: %v", err)
|
||||
@@ -2767,7 +2754,7 @@ func writePromptFileWithTemplate(t *testing.T, dir, id, defaultProfile, template
|
||||
|
||||
func writeProfileFile(t *testing.T, dir, id, endpoint, model string) {
|
||||
t.Helper()
|
||||
data := fmt.Sprintf("profiles:\n %q:\n endpoint: %q\n model: %q\n", id, endpoint, model)
|
||||
data := fmt.Sprintf("profiles:\n - id: %q\n endpoint: %q\n model: %q\n", id, endpoint, model)
|
||||
if err := os.WriteFile(filepath.Join(dir, id+".yaml"), []byte(data), 0o644); err != nil {
|
||||
t.Fatalf("failed to write profile fixture: %v", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user