Share configuration settings across the public boundary
This commit is contained in:
@@ -373,14 +373,13 @@ func TestLoadAcceptsEmptyInlineContentAndRejectsInvalidPromptFields(t *testing.T
|
||||
if _, _, err := state.prompt("exact.id"); !errors.Is(err, errPromptNotFound) {
|
||||
t.Fatalf("trimmed prompt identity unexpectedly matched: %v", err)
|
||||
}
|
||||
_, err = load(mapping("obsolete-field", map[string]any{"prompts": []any{map[string]any{
|
||||
extended, err := load(mapping("application-field", map[string]any{"prompts": []any{map[string]any{
|
||||
"version": "v1",
|
||||
"id": "example", "messages": []any{map[string]any{"role": "user", "content": "ok"}},
|
||||
"output": map[string]any{"format": "text", "validation_mode": "basic"},
|
||||
}}}), nil)
|
||||
var loadError *configkit.LoadError
|
||||
if !errors.As(err, &loadError) {
|
||||
t.Fatalf("obsolete identity field should fail strict decoding: %v", err)
|
||||
if err != nil || extended.result.Config.Prompts[0].Application["version"] != "v1" {
|
||||
t.Fatalf("application field not retained: %+v, %v", extended, err)
|
||||
}
|
||||
_, err = load(mapping("null-prompt", map[string]any{"prompts": []any{nil}}), nil)
|
||||
if err == nil {
|
||||
|
||||
Reference in New Issue
Block a user