{
  "$defs": {
    "Role": {
      "description": "Chat message roles, normalised across providers.",
      "enum": [
        "system",
        "user",
        "assistant",
        "tool"
      ],
      "title": "Role",
      "type": "string"
    },
    "ToolCallRequest": {
      "description": "A tool call requested by the model via native function calling.\n\nAttributes:\n    id: Provider-assigned call id (empty for providers that omit one, e.g.\n        Ollama); echoed back on the corresponding ``tool`` message.\n    name: The tool/function name to invoke.\n    arguments: Parsed arguments object for the call.",
      "properties": {
        "id": {
          "default": "",
          "title": "Id",
          "type": "string"
        },
        "name": {
          "title": "Name",
          "type": "string"
        },
        "arguments": {
          "additionalProperties": true,
          "title": "Arguments",
          "type": "object"
        }
      },
      "required": [
        "name"
      ],
      "title": "ToolCallRequest",
      "type": "object"
    }
  },
  "description": "A single chat message.\n\nAttributes:\n    role: Who authored the message.\n    content: The text content.\n    name: Optional author/tool name (used by some providers for tool roles).\n    tool_call_id: Correlates a ``tool`` message with a prior tool call.\n    tool_calls: Tool calls requested by an ``assistant`` message (native\n        function calling); carried back into the next request verbatim.",
  "properties": {
    "role": {
      "$ref": "#/$defs/Role"
    },
    "content": {
      "title": "Content",
      "type": "string"
    },
    "name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Name"
    },
    "tool_call_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Tool Call Id"
    },
    "tool_calls": {
      "items": {
        "$ref": "#/$defs/ToolCallRequest"
      },
      "title": "Tool Calls",
      "type": "array"
    }
  },
  "required": [
    "role",
    "content"
  ],
  "title": "Message",
  "type": "object"
}
