{
  "$type": "com.atproto.lexicon.schema",
  "defs": {
    "main": {
      "description": "Record containing a chat message in a conversation.",
      "key": "tid",
      "record": {
        "properties": {
          "author": {
            "description": "DID of the message author.",
            "format": "did",
            "type": "string"
          },
          "content": {
            "description": "The content of the message.",
            "maxGraphemes": 10000,
            "maxLength": 100000,
            "type": "string"
          },
          "createdAt": {
            "description": "Client-declared timestamp when this message was created.",
            "format": "datetime",
            "type": "string"
          },
          "lang": {
            "description": "Language code of the original content (e.g., 'ja', 'en').",
            "maxLength": 10,
            "type": "string"
          },
          "parent": {
            "description": "AT-URI of the parent message being replied to.",
            "format": "at-uri",
            "type": "string"
          },
          "root": {
            "description": "AT-URI of the root message in the thread.",
            "format": "at-uri",
            "type": "string"
          },
          "translations": {
            "description": "Translations of the message in other languages.",
            "ref": "#translationMap",
            "type": "ref"
          }
        },
        "required": [
          "content",
          "author",
          "createdAt"
        ],
        "type": "object"
      },
      "type": "record"
    },
    "translation": {
      "description": "A translation of a chat message.",
      "properties": {
        "content": {
          "maxGraphemes": 10000,
          "maxLength": 100000,
          "type": "string"
        }
      },
      "type": "object"
    },
    "translationMap": {
      "description": "Map of language codes to translations.",
      "properties": {
        "en": {
          "ref": "#translation",
          "type": "ref"
        },
        "ja": {
          "ref": "#translation",
          "type": "ref"
        }
      },
      "type": "object"
    }
  },
  "id": "ai.syui.log.chat",
  "lexicon": 1
}
