package com.cy.guoyan.admin.module.ai.controller.admin.chatknowledgedataset.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.springframework.web.multipart.MultipartFile;

import javax.validation.constraints.NotBlank;

@Schema(description = "管理后台 - 通过文件创建或更新知识库文档 Request VO")
@Data
public class ChatKnowledgeDocumentCreateReqVO {

    @Schema(description = "知识库 ID", required = true, example = "863e2b24-ec45-4540-b2d4-00dfb8b91d60")
    @NotBlank
    private String datasetId;

    @Schema(description = "上传的文件", required = true)
    private MultipartFile file;

    @Schema(description = "原始文档 ID（可选，传则为更新操作）", example = "ddf1234a-...")
    private String documentId;

    @Schema(description = "索引方式：high_quality / economy", required = true, example = "high_quality")
    @NotBlank
    private String indexingTechnique;

    @Schema(description = "文档形式：text_model / hierarchical_model / qa_model", required = true, example = "hierarchical_model")
    @NotBlank
    private String docForm;

    @Schema(description = "处理规则 JSON 字符串，当 documentId 为空时必填",
            example = "{\"mode\":\"custom\",\"rules\":{...}}")
    private String processRule;

    @Schema(description = "检索模型配置 JSON 字符串（可选）",
            example = "{\"search_method\":\"semantic_search\",\"top_k\":3}")
    private String retrievalModel;

    @Schema(description = "Embedding 模型名称（可选）", example = "openai-embedding-ada-002")
    private String embeddingModel;

    @Schema(description = "Embedding 模型供应商（可选）", example = "openai")
    private String embeddingModelProvider;
}
