{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://sediment.so/schemas/trainer-messages/assistant-tool-call-message/v1.json",
  "title": "TrainerAssistantToolCallMessage",
  "description": "One assistant message with structured tool calls.",
  "type": "object",
  "properties": {
    "role": {
      "const": "assistant",
      "type": "string",
      "description": "The trainer-facing message role."
    },
    "tool_calls": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/TrainerToolCall"
      },
      "description": "Structured function calls requested by the assistant."
    },
    "thinking": {
      "type": "string",
      "description": "Readable assistant reasoning kept outside visible content."
    },
    "content": {
      "type": "string",
      "description": "Plain-text message content."
    }
  },
  "additionalProperties": false,
  "required": [
    "role",
    "tool_calls"
  ],
  "$defs": {
    "TrainerToolCall": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "The tool-call identity used by the matching result."
        },
        "type": {
          "const": "function",
          "type": "string",
          "description": "The fixed `function` tool-call discriminator."
        },
        "function": {
          "$ref": "#/$defs/TrainerFunctionCall",
          "description": "The structured function payload for this tool call."
        }
      },
      "additionalProperties": false,
      "required": [
        "id",
        "type",
        "function"
      ]
    },
    "TrainerFunctionCall": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "The function name associated with this tool call or result."
        },
        "arguments": {
          "type": "object",
          "additionalProperties": {},
          "description": "The exact structured arguments supplied to the function."
        }
      },
      "additionalProperties": false,
      "required": [
        "name",
        "arguments"
      ]
    }
  }
}
