Exercise spell and NPC integration through native providers and published artifacts
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user