Exercise spell and NPC integration through native providers and published artifacts

This commit is contained in:
2026-11-22 04:39:55 +00:00
parent 20c0975d9d
commit 0ad73ff575
9 changed files with 219 additions and 261 deletions

View File

@@ -22,7 +22,12 @@ func nativeTestEngine(t *testing.T, client promptkit.LLMClient, profileIDs ...st
for index, id := range profileIDs {
profiles[index] = map[string]any{"id": id, "endpoint": "https://example.invalid/v1", "model": "integration-test-model", "api_key_required": false}
}
content, err := json.Marshal(map[string]any{"promptkit": map[string]any{"profiles": profiles}})
content, err := json.Marshal(map[string]any{"promptkit": map[string]any{
"profiles": profiles,
"collections": map[string]any{"notarius": map[string]any{"profiles": []map[string]any{
{"id": "dnd-extraction", "endpoint": "https://example.invalid/v1", "model": "integration-test-model", "api_key_required": false},
}}},
}})
if err != nil {
t.Fatal(err)
}
@@ -72,3 +77,21 @@ func nativePromptText(request promptkit.GenerateRequest) string {
}
return strings.Join(content, "\n")
}
func nativeSchemaHasProperty(request promptkit.GenerateRequest, property string) bool {
if request.StructuredOutput == nil || request.StructuredOutput.JSONSchema == nil {
return false
}
content, err := json.Marshal(request.StructuredOutput.JSONSchema.Schema)
if err != nil {
return false
}
var schema struct {
Properties map[string]json.RawMessage `json:"properties"`
}
if json.Unmarshal(content, &schema) != nil {
return false
}
_, found := schema.Properties[property]
return found
}