62 lines
2.3 KiB
JSON
Executable File
62 lines
2.3 KiB
JSON
Executable File
{
|
|
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
"$id": "https://cognitive-agent.local/schemas/intent-ir.schema.json",
|
|
"title": "IntentIR",
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["apiVersion", "kind", "metadata", "spec"],
|
|
"properties": {
|
|
"apiVersion": {"const": "cognitive-agent/v1alpha1"},
|
|
"kind": {"const": "IntentIR"},
|
|
"metadata": {"$ref": "common.schema.json#/$defs/metadata"},
|
|
"spec": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["utterance", "language", "mode", "detected_domains", "requests", "confidence", "requires_confirmation"],
|
|
"properties": {
|
|
"utterance": {"type": "string", "minLength": 1, "maxLength": 4000},
|
|
"language": {"type": "string", "pattern": "^[a-z]{2}(?:-[A-Z]{2})?$"},
|
|
"mode": {"type": "string", "enum": ["single_domain", "cross_domain"]},
|
|
"detected_domains": {
|
|
"type": "array",
|
|
"minItems": 0,
|
|
"uniqueItems": true,
|
|
"items": {"type": "string", "pattern": "^[a-z][a-z0-9_]*$"}
|
|
},
|
|
"requests": {
|
|
"type": "array",
|
|
"minItems": 0,
|
|
"items": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["domain", "goal"],
|
|
"properties": {
|
|
"domain": {"type": "string", "pattern": "^[a-z][a-z0-9_]*$"},
|
|
"goal": {"type": "string", "minLength": 1, "maxLength": 500},
|
|
"target": {"$ref": "common.schema.json#/$defs/target"},
|
|
"parameters": {"type": "object"},
|
|
"source_span": {"type": "string", "maxLength": 500}
|
|
}
|
|
}
|
|
},
|
|
"ambiguities": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"additionalProperties": false,
|
|
"required": ["field", "question"],
|
|
"properties": {
|
|
"field": {"type": "string", "minLength": 1},
|
|
"question": {"type": "string", "minLength": 1},
|
|
"options": {"type": "array", "items": {"type": ["string", "number", "boolean"]}}
|
|
}
|
|
},
|
|
"default": []
|
|
},
|
|
"confidence": {"type": "number", "minimum": 0, "maximum": 1},
|
|
"requires_confirmation": {"type": "boolean"}
|
|
}
|
|
}
|
|
}
|
|
}
|