{
  "$ref": "#/definitions/turn-done",
  "definitions": {
    "turn-done": {
      "type": "object",
      "properties": {
        "v": {
          "type": "string",
          "pattern": "^\\d+\\.\\d+$"
        },
        "id": {
          "type": "string",
          "minLength": 10,
          "maxLength": 64
        },
        "type": {
          "type": "string",
          "const": "turn.done"
        },
        "ts": {
          "type": "integer",
          "exclusiveMinimum": 0
        },
        "sid": {
          "type": "string",
          "minLength": 16,
          "maxLength": 128
        },
        "replyTo": {
          "type": "string",
          "minLength": 10,
          "maxLength": 64
        },
        "payload": {
          "type": "object",
          "properties": {
            "turnId": {
              "type": "string"
            },
            "contextRev": {
              "type": "integer",
              "minimum": 0
            },
            "usage": {
              "type": "object",
              "properties": {
                "inputTokens": {
                  "type": "integer"
                },
                "outputTokens": {
                  "type": "integer"
                }
              },
              "required": [
                "inputTokens",
                "outputTokens"
              ],
              "additionalProperties": false
            }
          },
          "required": [
            "turnId"
          ],
          "additionalProperties": false
        }
      },
      "required": [
        "v",
        "id",
        "type",
        "ts",
        "payload"
      ],
      "additionalProperties": true
    }
  },
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://schwaizer.ch/ocp/schemas/1.0/turn-done.json"
}
