{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/insuremo-com/json-schema/insuremo-com-model-chat-form-schema.json",
  "title": "model.ChatForm",
  "x-generated": "2026-12-02",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/insuremo-com-genai-openapi.yml#/components/schemas/model.ChatForm",
  "type": "object",
  "properties": {
    "query": {
      "type": "string",
      "description": "query question"
    },
    "top_k": {
      "type": "integer",
      "description": "retrieval top_k related paragraphs for answering, if you need chat using documents"
    },
    "messages": {
      "type": "array",
      "description": "chat history",
      "items": {
        "type": "object",
        "properties": {
          "content": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "description": "role should be assistant, user or system",
            "enum": [
              "system",
              "user",
              "assistant"
            ]
          }
        }
      }
    },
    "threshold": {
      "type": "number",
      "default": 60,
      "description": "retrievaled passages whose relevant score should > threshold for answering, if you need chat using documents"
    },
    "temperature": {
      "type": "number",
      "default": 0.2,
      "description": "control the randomness or diversity for AI outputs, larger number means more randomness, range from 0-2"
    },
    "file_ids": {
      "type": "array",
      "default": [],
      "description": "use files uploaded by user to chat with",
      "items": {
        "type": "integer",
        "description": "specify files for the chat"
      }
    },
    "stream": {
      "type": "boolean",
      "default": true,
      "description": "stream output or not"
    },
    "use_files": {
      "type": "boolean",
      "default": true,
      "description": "whether use files for chat, default true"
    },
    "llm_code": {
      "type": "string",
      "description": "llm code for chat"
    }
  },
  "required": [
    "messages",
    "query"
  ]
}