{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/insuremo-com/json-schema/insuremo-com-model-rag-search-req-schema.json",
  "title": "model.RagSearchReq",
  "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.RagSearchReq",
  "type": "object",
  "properties": {
    "query": {
      "type": "string",
      "description": "query question"
    },
    "tags": {
      "type": "array",
      "description": "search documents with specified tags, all documents will be searched if it is empty",
      "items": {
        "type": "string"
      }
    },
    "top_k": {
      "type": "integer",
      "description": "retrieval top_k related paragraphs for answering"
    },
    "file_names": {
      "type": "array",
      "description": "specific target documents for retrieval",
      "items": {
        "type": "string"
      }
    },
    "messages": {
      "type": "array",
      "description": "chat history",
      "items": {
        "type": "object",
        "properties": {
          "content": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "description": "role should be assistant, user or system"
          }
        }
      }
    },
    "threshold": {
      "type": "number",
      "description": "retrievaled passages whose relevant score should > threshold for answering"
    },
    "stream": {
      "type": "boolean",
      "default": true,
      "description": "if you want tokens returned one by one, set stream=true, else set stream=false"
    },
    "llm_code": {
      "type": "string",
      "description": "llm code for rag"
    }
  },
  "required": [
    "query",
    "threshold",
    "top_k"
  ]
}