package com.pavis.admin.aigc.model.req;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import java.io.Serial;
import java.io.Serializable;

/**
 * AIGC知识库创建或修改参数
 *
 * @author semi
 * @since 2025/05/26 17:28
 */
@Data
@Schema(description = "AIGC知识库创建或修改参数")
public class KnowledgeReq implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    /**
     * 知识库名称(唯一)
     */
    @Schema(description = "知识库名称(唯一)")
    @NotBlank(message = "知识库名称(唯一)不能为空")
    @Length(max = 100, message = "知识库名称(唯一)长度不能超过 {max} 个字符")
    private String name;

    /**
     * 向量库配置
     * {"store_type":"milvus","collection":"default","index_type":"HNSW","dimension":768,"metadata_schema":{"author":"string","publish_date":"date"}}
     */
    @Schema(description = "向量库配置 {\"store_type\":\"milvus\",\"collection\":\"default\",\"index_type\":\"HNSW\",\"dimension\":768,\"metadata_schema\":{\"author\":\"string\",\"publish_date\":\"date\"}}")
    @NotBlank(message = "不能为空")
    @Length(max = 1073741824, message = "长度不能超过 {max} 个字符")
    private String embedConfig;

    /**
     * 关联向量模型ID
     */
    @Schema(description = "关联向量模型ID")
    @NotNull(message = "关联向量模型ID不能为空")
    private Long embedModelId;

    /**
     * 关联向量存储ID
     */
    @Schema(description = "关联向量存储ID")
    @NotNull(message = "关联向量存储ID不能为空")
    private Long embedStoreId;


    /**
     * 知识库描述
     */
    @Schema(description = "知识库描述")
    private String knowDescribe;
}