{
  "$defs": {
    "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"
    },
    "Usage": {
      "description": "Token accounting for a single request, normalised across providers.",
      "properties": {
        "prompt_tokens": {
          "default": 0,
          "title": "Prompt Tokens",
          "type": "integer"
        },
        "completion_tokens": {
          "default": 0,
          "title": "Completion Tokens",
          "type": "integer"
        },
        "total_tokens": {
          "default": 0,
          "title": "Total Tokens",
          "type": "integer"
        }
      },
      "title": "Usage",
      "type": "object"
    }
  },
  "description": "A completed (non-streaming) chat response.\n\nAttributes:\n    content: The assistant's text reply.\n    model: The model that produced the reply.\n    provider: The adapter/provider name.\n    finish_reason: Provider-reported stop reason, if any.\n    usage: Token accounting.\n    raw: The provider's raw decoded JSON, for debugging/observability.",
  "properties": {
    "content": {
      "title": "Content",
      "type": "string"
    },
    "model": {
      "title": "Model",
      "type": "string"
    },
    "provider": {
      "title": "Provider",
      "type": "string"
    },
    "finish_reason": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "title": "Finish Reason"
    },
    "usage": {
      "$ref": "#/$defs/Usage"
    },
    "tool_calls": {
      "items": {
        "$ref": "#/$defs/ToolCallRequest"
      },
      "title": "Tool Calls",
      "type": "array"
    },
    "raw": {
      "additionalProperties": true,
      "title": "Raw",
      "type": "object"
    }
  },
  "required": [
    "content",
    "model",
    "provider"
  ],
  "title": "ChatResponse",
  "type": "object"
}
