{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cadencz-com/json-schema/cadencz-com-text-generation-request-schema.json",
  "title": "TextGenerationRequest",
  "x-generated": "2026-11-03",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cadencz-com-openapi.json#/components/schemas/TextGenerationRequest",
  "properties": {
    "input": {
      "type": "string",
      "maxLength": 8000,
      "minLength": 1,
      "title": "Input",
      "description": "Source material or instructions the model should turn into social copy."
    },
    "platforms": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "maxItems": 5,
      "minItems": 1,
      "title": "Platforms",
      "description": "One or more platform prompt templates to apply."
    },
    "provider": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Provider",
      "description": "Text model provider. Defaults to TEXT_MODEL_PROVIDER."
    },
    "model": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Model",
      "description": "Provider model id. Defaults to OPENAI_MODEL for the OpenAI provider."
    },
    "brain_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Brain Id",
      "description": "Optional Brain id/slug used to ground the generation in saved product knowledge."
    },
    "conversation_id": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 36
        },
        {
          "type": "null"
        }
      ],
      "title": "Conversation Id",
      "description": "Optional durable Brain conversation to continue. Requires brain_id; when omitted, a new conversation is created for Brain-backed generation."
    },
    "conversation_message": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 8000,
          "minLength": 1
        },
        {
          "type": "null"
        }
      ],
      "title": "Conversation Message",
      "description": "User-visible conversation turn to persist. Defaults to input when omitted, allowing clients to keep generation-only prompt instructions out of conversation history."
    },
    "brain_context": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 12000
        },
        {
          "type": "null"
        }
      ],
      "title": "Brain Context",
      "description": "Optional client-provided Brain context fallback when the Brain is not yet saved server-side."
    },
    "temperature": {
      "type": "number",
      "maximum": 2.0,
      "minimum": 0.0,
      "title": "Temperature",
      "default": 0.7
    },
    "max_tokens": {
      "anyOf": [
        {
          "type": "integer",
          "maximum": 2000.0,
          "minimum": 64.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Max Tokens"
    },
    "count": {
      "anyOf": [
        {
          "type": "integer",
          "maximum": 5.0,
          "minimum": 1.0
        },
        {
          "type": "null"
        }
      ],
      "title": "Count",
      "description": "How many distinct post concepts to create. When omitted, Compose infers an explicit count from requests such as 'write two posts'."
    },
    "content_guidance": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 500
        },
        {
          "type": "null"
        }
      ],
      "title": "Content Guidance",
      "description": "Selected content mode, kept separate from the user's requested subject."
    }
  },
  "type": "object",
  "required": [
    "input"
  ]
}