Skip to content

message-record

Generated reference page for spec/v1/schemas/resources/message-record.json.

Metadata

  • Type: JSON Schema
  • Source: spec/v1/schemas/resources/message-record.json
  • Raw: View Raw

Summary

Source

json
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://agent-service.spec/v1/schemas/resources/message-record.json",
  "$defs": {
    "TextContent": {
      "type": "object",
      "additionalProperties": false,
      "required": ["type", "text"],
      "properties": {
        "type": {
          "const": "text"
        },
        "text": {
          "type": "string"
        }
      }
    },
    "BinaryContent": {
      "type": "object",
      "additionalProperties": false,
      "required": ["type", "mimeType"],
      "properties": {
        "type": {
          "const": "binary"
        },
        "mimeType": {
          "type": "string"
        },
        "id": {
          "$ref": "../common/identity.json#/$defs/opaqueId"
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "data": {
          "type": "string"
        },
        "filename": {
          "type": "string"
        }
      }
    },
    "DataContent": {
      "type": "object",
      "additionalProperties": false,
      "required": ["type", "data"],
      "properties": {
        "type": {
          "const": "data"
        },
        "data": {
          "type": "object",
          "additionalProperties": true
        }
      }
    },
    "TaskContent": {
      "oneOf": [
        {
          "$ref": "#/$defs/TextContent"
        },
        {
          "$ref": "#/$defs/BinaryContent"
        },
        {
          "$ref": "#/$defs/DataContent"
        }
      ]
    },
    "ToolResult": {
      "type": "object",
      "additionalProperties": false,
      "required": ["toolCallId", "result"],
      "properties": {
        "toolCallId": {
          "$ref": "../common/identity.json#/$defs/opaqueId"
        },
        "result": {
          "type": "object",
          "additionalProperties": true
        },
        "error": {
          "type": "string"
        }
      }
    },
    "ToolCall": {
      "type": "object",
      "additionalProperties": false,
      "required": ["id", "toolName", "arguments"],
      "properties": {
        "id": {
          "$ref": "../common/identity.json#/$defs/opaqueId"
        },
        "toolName": {
          "type": "string"
        },
        "arguments": {
          "type": "object",
          "additionalProperties": true
        }
      }
    },
    "TaskArtifactInline": {
      "type": "object",
      "additionalProperties": false,
      "required": ["id", "content"],
      "properties": {
        "id": {
          "$ref": "../common/identity.json#/$defs/artifactId"
        },
        "name": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "content": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/TaskContent"
          }
        }
      }
    },
    "SystemMessage": {
      "type": "object",
      "additionalProperties": false,
      "required": ["id", "role", "content"],
      "properties": {
        "id": {
          "$ref": "../common/identity.json#/$defs/messageId"
        },
        "role": {
          "const": "system"
        },
        "content": {
          "type": "string"
        },
        "name": {
          "type": "string"
        }
      }
    },
    "UserMessage": {
      "type": "object",
      "additionalProperties": false,
      "required": ["id", "role", "content"],
      "properties": {
        "id": {
          "$ref": "../common/identity.json#/$defs/messageId"
        },
        "role": {
          "const": "user"
        },
        "content": {
          "oneOf": [
            {
              "type": "string"
            },
            {
              "type": "array",
              "items": {
                "$ref": "#/$defs/TaskContent"
              }
            }
          ]
        },
        "name": {
          "type": "string"
        }
      }
    },
    "UserToolResultMessage": {
      "type": "object",
      "additionalProperties": false,
      "required": ["id", "role", "toolResults"],
      "properties": {
        "id": {
          "$ref": "../common/identity.json#/$defs/messageId"
        },
        "role": {
          "const": "user"
        },
        "name": {
          "type": "string"
        },
        "toolResults": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ToolResult"
          }
        }
      }
    },
    "AssistantMessage": {
      "type": "object",
      "additionalProperties": false,
      "required": ["id", "role", "content"],
      "properties": {
        "id": {
          "$ref": "../common/identity.json#/$defs/messageId"
        },
        "role": {
          "const": "assistant"
        },
        "content": {
          "type": "string"
        },
        "name": {
          "type": "string"
        }
      }
    },
    "AssistantToolCallMessage": {
      "type": "object",
      "additionalProperties": false,
      "required": ["id", "role", "toolCalls"],
      "properties": {
        "id": {
          "$ref": "../common/identity.json#/$defs/messageId"
        },
        "role": {
          "const": "assistant"
        },
        "name": {
          "type": "string"
        },
        "toolCalls": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ToolCall"
          }
        }
      }
    },
    "AssistantArtifactMessage": {
      "type": "object",
      "additionalProperties": false,
      "required": ["id", "role", "artifact"],
      "properties": {
        "id": {
          "$ref": "../common/identity.json#/$defs/messageId"
        },
        "role": {
          "const": "assistant"
        },
        "name": {
          "type": "string"
        },
        "artifact": {
          "$ref": "#/$defs/TaskArtifactInline"
        }
      }
    },
    "AssistantStatusMessage": {
      "type": "object",
      "additionalProperties": false,
      "required": ["id", "role", "status"],
      "properties": {
        "id": {
          "$ref": "../common/identity.json#/$defs/messageId"
        },
        "role": {
          "const": "assistant"
        },
        "status": {
          "$ref": "../common/enums.json#/$defs/taskStatus"
        },
        "errorMessage": {
          "type": "string"
        }
      }
    },
    "ReasoningMessage": {
      "type": "object",
      "additionalProperties": false,
      "required": ["id", "role", "content"],
      "properties": {
        "id": {
          "$ref": "../common/identity.json#/$defs/messageId"
        },
        "role": {
          "const": "reasoning"
        },
        "content": {
          "type": "string"
        },
        "name": {
          "type": "string"
        }
      }
    },
    "ToolMessage": {
      "type": "object",
      "additionalProperties": false,
      "required": ["id", "role", "toolCallId", "content"],
      "properties": {
        "id": {
          "$ref": "../common/identity.json#/$defs/messageId"
        },
        "role": {
          "const": "tool"
        },
        "toolCallId": {
          "$ref": "../common/identity.json#/$defs/opaqueId"
        },
        "content": {
          "type": "string"
        },
        "name": {
          "type": "string"
        }
      }
    },
    "ActivityMessage": {
      "type": "object",
      "additionalProperties": false,
      "required": ["id", "role", "activityType"],
      "properties": {
        "id": {
          "$ref": "../common/identity.json#/$defs/messageId"
        },
        "role": {
          "const": "activity"
        },
        "activityType": {
          "type": "string"
        },
        "content": {
          "type": "object",
          "additionalProperties": true
        },
        "name": {
          "type": "string"
        }
      }
    },
    "TaskInputMessage": {
      "oneOf": [
        {
          "$ref": "#/$defs/SystemMessage"
        },
        {
          "$ref": "#/$defs/UserMessage"
        },
        {
          "$ref": "#/$defs/UserToolResultMessage"
        }
      ]
    },
    "StoredMessage": {
      "oneOf": [
        {
          "$ref": "#/$defs/SystemMessage"
        },
        {
          "$ref": "#/$defs/UserMessage"
        },
        {
          "$ref": "#/$defs/UserToolResultMessage"
        },
        {
          "$ref": "#/$defs/AssistantMessage"
        },
        {
          "$ref": "#/$defs/AssistantToolCallMessage"
        },
        {
          "$ref": "#/$defs/AssistantArtifactMessage"
        },
        {
          "$ref": "#/$defs/AssistantStatusMessage"
        },
        {
          "$ref": "#/$defs/ReasoningMessage"
        },
        {
          "$ref": "#/$defs/ToolMessage"
        },
        {
          "$ref": "#/$defs/ActivityMessage"
        }
      ]
    }
  },
  "type": "object",
  "additionalProperties": false,
  "required": ["id", "runId", "messageId", "role", "source", "message"],
  "properties": {
    "id": {
      "$ref": "../common/identity.json#/$defs/opaqueId"
    },
    "runId": {
      "$ref": "../common/identity.json#/$defs/runId"
    },
    "threadId": {
      "$ref": "../common/identity.json#/$defs/threadId"
    },
    "messageId": {
      "$ref": "../common/identity.json#/$defs/messageId"
    },
    "role": {
      "$ref": "../common/enums.json#/$defs/messageRole"
    },
    "source": {
      "$ref": "../common/enums.json#/$defs/messageSource"
    },
    "sequence": {
      "$ref": "../common/identity.json#/$defs/sequence"
    },
    "sortAt": {
      "$ref": "../common/identity.json#/$defs/timestamp"
    },
    "message": {
      "$ref": "#/$defs/StoredMessage"
    },
    "metadata": {
      "type": "object",
      "additionalProperties": true
    },
    "createdAt": {
      "$ref": "../common/identity.json#/$defs/timestamp"
    },
    "updatedAt": {
      "$ref": "../common/identity.json#/$defs/timestamp"
    }
  }
}

Generated from spec source.