Capture prompt schema selections and source references

This commit is contained in:
2026-11-20 15:27:46 +00:00
parent 596e985cff
commit e8420d229e
6 changed files with 185 additions and 33 deletions

View File

@@ -4,6 +4,7 @@ import (
"context"
"strings"
"testing"
"testing/fstest"
"go.maximumdirect.net/configkit"
)
@@ -64,7 +65,10 @@ func TestPromptResolutionNormalizesOutputAndRejectsDuplicateNames(t *testing.T)
"messages": []any{map[string]any{"role": "user", "content": "hello"}},
"output": map[string]any{"format": "json", "validation_mode": "json_schema", "schema_path": " schema.json "},
}
state, err := load(mapping("prompt metadata", map[string]any{"prompts": []any{definition}}), nil)
filesystem := configkit.NewFilesystem("schemas", fstest.MapFS{})
input := mapping("prompt metadata", map[string]any{"schema_root": ".", "prompts": []any{definition}})
input.Filesystem = &configkit.FilesystemContext{FS: &filesystem, Root: ".", BaseDir: "."}
state, err := load(input, nil)
if err != nil {
t.Fatal(err)
}