# place.hud.chat.message

> 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.

- Kind: record
- Record key: tid
- Authority: chat.hud.place
- Lexicon: 1
- Published by [lexicons.hud.place](https://lexicon.garden/identity/did:plc:3tzbz4pml36u4mkresb6pdhv), the NSID's authority

## Links

- [Documentation](https://lexicon.garden/lexicon/did:plc:3tzbz4pml36u4mkresb6pdhv/place.hud.chat.message)
- [Schema JSON](https://lexicon.garden/lexicon/did:plc:3tzbz4pml36u4mkresb6pdhv/place.hud.chat.message/schema.json)
- [Analytics](https://lexicon.garden/lexicon/did:plc:3tzbz4pml36u4mkresb6pdhv/place.hud.chat.message/analytics)

## Record (`place.hud.chat.message`)

Type: record · key tid

### Properties

- `artifacts` (array): The versions of the chat's artifacts the answer made, or tried to, in order.
  - `items` (ref)
    - Reference: `place.hud.chatDefs#artifactRef`
- `createdAt` (string · datetime, required)
- `error` (string)
  - Constraints: maxLength: 2000
- `partsJson` (string): 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.
  - Constraints: maxLength: 1000000
- `role` (string, required)
  - Constraints: maxLength: 32, knownValues: person | model
- `steps` (array): The tool calls of the model's answer, where a record holds their arguments; else in partsJson.
  - `items` (ref)
    - Reference: `place.hud.chatDefs#step`
- `text` (string, required)
  - Constraints: maxLength: 10000
- `tiles` (array): What the model's answer draws, where a record holds their arguments; else in partsJson.
  - `items` (ref)
    - Reference: `place.hud.chatDefs#tile`
- `turn` (integer, required): The exchange it belongs to: a person's message and the answer after it share one.
  - Constraints: minimum: 1

## Schema

```json
{
  "$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
}
```
