Перейти к содержимому

Справочник Input Schema

Узлы agent-directive используют JSON Schema (Draft 7) для валидации ответов агента. Невалидные ответы вызывают повторную попытку с сообщениями об ошибках валидации.

{
"inputSchema": {
"type": "object",
"properties": {
"field_name": { "type": "string" }
},
"required": ["field_name"]
}
}
{
"properties": {
"name": { "type": "string" },
"description": { "type": "string", "minLength": 10 },
"code": { "type": "string", "maxLength": 100 }
}
}
{
"properties": {
"score": { "type": "number", "minimum": 0, "maximum": 100 },
"count": { "type": "integer", "minimum": 1 }
}
}
{
"properties": {
"confirmed": { "type": "boolean" }
}
}
{
"properties": {
"items": {
"type": "array",
"items": { "type": "string" },
"minItems": 1,
"maxItems": 10
}
}
}
{
"properties": {
"config": {
"type": "object",
"properties": {
"enabled": { "type": "boolean" },
"value": { "type": "number" }
},
"required": ["enabled"]
}
}
}
{
"properties": {
"status": { "type": "string", "enum": ["pending", "approved", "rejected"] },
"decision": { "type": "string", "enum": ["yes", "no"] }
}
}

Для ответов на русском:

{
"properties": {
"confirmed": { "type": "string", "enum": ["да", "нет"] }
}
}
{
"required": ["result", "confidence"]
}

Необязательные поля со значением по умолчанию

Заголовок раздела «Необязательные поля со значением по умолчанию»
{
"properties": {
"verbose": { "type": "boolean", "default": false }
}
}
{
"properties": {
"result": { "type": "string" },
"skip": { "type": "string", "enum": ["yes"] }
}
}

Агент предоставляет либо result, либо skip, но не оба.

{
"properties": {
"file_path": {
"type": "string",
"pattern": "^[a-zA-Z0-9/_.-]+\\.(json|yaml|md)$"
}
}
}
{
"properties": {
"email": {
"type": "string",
"pattern": "^[^@]+@[^@]+\\.[^@]+$"
}
}
}
{
"properties": {
"url": {
"type": "string",
"pattern": "^https?://"
}
}
}
{
"properties": {
"tags": {
"type": "array",
"items": { "type": "string" }
}
}
}
{
"properties": {
"steps": {
"type": "array",
"items": {
"type": "object",
"properties": {
"name": { "type": "string" },
"status": { "type": "string", "enum": ["done", "pending"] }
},
"required": ["name", "status"]
},
"minItems": 1
}
}
}
{
"type": "object",
"properties": {
"result": { "type": "string" }
},
"required": ["result"],
"additionalProperties": false
}

Отклоняет любые поля, не определённые в properties. Движок автоматически применяет additionalProperties: false ко всем объектным схемам с properties, поэтому это поведение по умолчанию даже без явного указания.

{
"additionalProperties": true
}

Явно укажите additionalProperties: true для разрешения дополнительных полей.

Добавляйте описания, чтобы помочь агентам понять назначение полей:

{
"properties": {
"quality_score": {
"type": "number",
"minimum": 1,
"maximum": 10,
"description": "Rate implementation quality from 1-10"
},
"evidence": {
"type": "string",
"description": "Concrete proof that work is complete (test output, command results)"
}
}
}

Специальная переменная execution_note обновляет отслеживание execution:

{
"properties": {
"execution_note": {
"type": "string",
"description": "Note to identify this execution"
}
}
}

Подробнее в Магические переменные.

{
"type": "object",
"properties": {
"result": { "type": "string", "enum": ["yes", "no"] },
"reason": { "type": "string" }
},
"required": ["result"]
}
{
"type": "object",
"properties": {
"error_count": { "type": "number", "minimum": 0 },
"evidence": { "type": "string", "minLength": 10 }
},
"required": ["error_count", "evidence"]
}
{
"type": "object",
"properties": {
"action": {
"type": "string",
"enum": ["create", "edit", "delete", "skip"]
},
"details": { "type": "string" }
},
"required": ["action"]
}