{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/coderpad/json-schema/coderpad-ai-assist-conversations-schema.json",
  "title": "ai_assist_conversations",
  "description": "the conversations the candidate had with the AI assistant on a PROJECT question",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/coderpad-tests-api-openapi.yml#/components/schemas/ai_assist_conversations",
  "type": "object",
  "properties": {
    "conversations": {
      "type": "array",
      "description": "the conversations, oldest first. Empty when the candidate did not use the AI assistant",
      "items": {
        "$ref": "#/$defs/ai_assist_conversation"
      }
    }
  },
  "$defs": {
    "ArrayNode": {
      "type": "object"
    },
    "ai_assist_conversation": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "conversation id",
          "format": "uuid"
        },
        "subject": {
          "type": "string",
          "description": "subject of the conversation"
        },
        "creation_time": {
          "type": "string",
          "description": "creation date of the conversation (ISO 8601, UTC)"
        },
        "messages": {
          "type": "array",
          "description": "the messages of the conversation, oldest first",
          "items": {
            "$ref": "#/$defs/ai_assist_message"
          }
        }
      },
      "description": "a conversation between the candidate and the AI assistant"
    },
    "ai_assist_message": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "description": "message id",
          "format": "uuid"
        },
        "role": {
          "type": "string",
          "description": "USER for a message of the candidate, ASSISTANT for an answer of the AI",
          "enum": [
            "USER",
            "ASSISTANT"
          ]
        },
        "creation_time": {
          "type": "string",
          "description": "creation date of the message (ISO 8601, UTC)"
        },
        "output_items": {
          "type": "array",
          "description": "the parts of the message, in the format the AI assistant stores them, which may evolve. Each item has an id, a type, a status and its startedAt / finishedAt times in milliseconds. A message item carries its text chunks in content, a reasoning item the summary of the AI reasoning, and a function_call, web_search or code_execution item what the AI asked for (name and arguments, or queries), never its result.",
          "items": {
            "$ref": "#/$defs/ArrayNode"
          }
        }
      },
      "description": "a message of an AI assist conversation"
    }
  }
}