{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "A message of a chat, in its person's repo in the chat's space (place.hud.chat), keyed by a TID of when it was written: the person's words, or the model's answer to them, as place.hud.chatDefs#message holds it.",
      "key": "tid",
      "record": {
        "properties": {
          "artifacts": {
            "description": "The versions of the chat's artifacts the answer made, or tried to, in order.",
            "items": {
              "ref": "place.hud.chatDefs#artifactRef",
              "type": "ref"
            },
            "type": "array"
          },
          "createdAt": {
            "format": "datetime",
            "type": "string"
          },
          "error": {
            "maxLength": 2000,
            "type": "string"
          },
          "partsJson": {
            "description": "The steps and tiles as JSON text ({steps, tiles}), where their arguments hold a number that is not an integer, which a record cannot hold.",
            "maxLength": 1000000,
            "type": "string"
          },
          "role": {
            "knownValues": [
              "person",
              "model"
            ],
            "maxLength": 32,
            "type": "string"
          },
          "steps": {
            "description": "The tool calls of the model's answer, where a record holds their arguments; else in partsJson.",
            "items": {
              "ref": "place.hud.chatDefs#step",
              "type": "ref"
            },
            "type": "array"
          },
          "text": {
            "maxLength": 10000,
            "type": "string"
          },
          "tiles": {
            "description": "What the model's answer draws, where a record holds their arguments; else in partsJson.",
            "items": {
              "ref": "place.hud.chatDefs#tile",
              "type": "ref"
            },
            "type": "array"
          },
          "turn": {
            "description": "The exchange it belongs to: a person's message and the answer after it share one.",
            "minimum": 1,
            "type": "integer"
          }
        },
        "required": [
          "turn",
          "role",
          "text",
          "createdAt"
        ],
        "type": "object"
      },
      "type": "record"
    }
  },
  "id": "place.hud.chat.message",
  "lexicon": 1
}
