Align the spell response schema
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
||||
"$id": "notarius.dnd.spells.llm",
|
||||
"$id": "notarius.dnd.spells",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"required": ["spell_casts"],
|
||||
|
||||
@@ -20,6 +20,13 @@ func TestLoadResponseSchemaUsesExtractorOwnedLLMSchema(t *testing.T) {
|
||||
if !strings.HasPrefix(schema.SHA256, "sha256:") || !json.Valid(schema.JSONSchema) {
|
||||
t.Fatalf("schema metadata = %#v, want valid hashed JSON", schema)
|
||||
}
|
||||
var schemaDocument map[string]any
|
||||
if err := json.Unmarshal(schema.JSONSchema, &schemaDocument); err != nil {
|
||||
t.Fatalf("Unmarshal(schema.JSONSchema) error = %v, want nil", err)
|
||||
}
|
||||
if schemaDocument["$id"] != ResponseSchemaID {
|
||||
t.Fatalf("schema $id = %#v, want %q", schemaDocument["$id"], ResponseSchemaID)
|
||||
}
|
||||
|
||||
valid := validSpellsResponse()
|
||||
validJSON, err := json.Marshal(valid)
|
||||
|
||||
Reference in New Issue
Block a user