{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/frasma-org/json-schema/frasma-org-chat-request-schema.json",
  "title": "ChatRequest",
  "x-generated": "2026-11-09",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/frasma-org-openapi.json#/components/schemas/ChatRequest",
  "type": "object",
  "required": [
    "messages"
  ],
  "properties": {
    "messages": {
      "type": "array",
      "minItems": 1,
      "maxItems": 20,
      "items": {
        "$ref": "#/$defs/ChatMessage"
      }
    },
    "lang": {
      "type": "string",
      "enum": [
        "it",
        "en"
      ]
    },
    "timezone": {
      "type": "string"
    },
    "pagePath": {
      "type": "string",
      "description": "Current public website path used to prioritize verified knowledge."
    },
    "conversationId": {
      "type": "string",
      "format": "uuid",
      "description": "Existing persisted conversation id, when resuming a session."
    }
  },
  "$defs": {
    "ChatMessage": {
      "type": "object",
      "required": [
        "role",
        "content"
      ],
      "properties": {
        "role": {
          "type": "string",
          "enum": [
            "user",
            "assistant"
          ]
        },
        "content": {
          "type": "string",
          "maxLength": 30000,
          "description": "User messages are limited to 2000 characters; assistant messages may include a reviewed structured form up to 30000 characters."
        }
      }
    }
  }
}