{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/compoid-com/json-schema/compoid-com-generative-scoring-request-schema.json",
  "title": "GenerativeScoringRequest",
  "description": "Request for computing generative scoring.\n\nAttributes:\n    model: The model to use for scoring. Optional, follows existing patterns.\n    query: The query text or pre-tokenized query token IDs.\n    items: The item text(s) or pre-tokenized item token IDs.\n    label_token_ids: List of token IDs to compute probabilities for.\n    apply_softmax: Whether to normalize probabilities using softmax over only\n        the label_token_ids (True) or return true model probabilities over\n        the full vocab for those ids (False).\n    item_first: If True, prepend items to query. Otherwise append items to query.\n    add_special_tokens: Whether to add special tokens when tokenizing.\n    cache_salt: Optional salt for prefix caching.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/compoid-com-generative-scoring-api-openapi.yml#/components/schemas/GenerativeScoringRequest",
  "properties": {
    "model": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Model"
    },
    "query": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "items": {
            "type": "integer"
          },
          "type": "array"
        }
      ],
      "title": "Query",
      "description": "The query text or pre-tokenized query token IDs."
    },
    "items": {
      "anyOf": [
        {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        {
          "items": {
            "items": {
              "type": "integer"
            },
            "type": "array"
          },
          "type": "array"
        }
      ],
      "title": "Items",
      "description": "List of item texts or pre-tokenized item token IDs."
    },
    "label_token_ids": {
      "items": {
        "type": "integer"
      },
      "type": "array",
      "title": "Label Token Ids",
      "description": "List of token IDs to compute probabilities for."
    },
    "apply_softmax": {
      "type": "boolean",
      "title": "Apply Softmax",
      "description": "If True, normalize probabilities using softmax over only the label_token_ids. If False, return the true model probabilities over the full vocab for those ids.",
      "default": true
    },
    "item_first": {
      "type": "boolean",
      "title": "Item First",
      "description": "If True, prepend items to query. Otherwise append items to query.",
      "default": false
    },
    "add_special_tokens": {
      "type": "boolean",
      "title": "Add Special Tokens",
      "description": "Whether to add special tokens when tokenizing.",
      "default": true
    },
    "cache_salt": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Cache Salt",
      "description": "If specified, the prefix cache will be salted with the provided string to prevent an attacker to guess prompts in multi-user environments. The salt should be random, protected from access by 3rd parties, and long enough to be unpredictable (e.g., 43 characters base64-encoded, corresponding to 256 bit)."
    },
    "priority": {
      "type": "integer",
      "maximum": 9.223372036854776e+18,
      "minimum": -9.223372036854776e+18,
      "title": "Priority",
      "description": "The priority of the request (lower means earlier handling; default: 0).",
      "default": 0
    },
    "request_id": {
      "type": "string",
      "title": "Request Id",
      "description": "The request_id related to this request."
    }
  },
  "additionalProperties": true,
  "type": "object",
  "required": [
    "query",
    "items",
    "label_token_ids"
  ]
}