

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

import com.pavis.admin.aigc.model.entity.DocDO;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 相似性搜索响应类，用于封装相似性搜索的结果
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class SimilaritySearchResp {

    /**
     * 嵌入ID
     */
    @Schema(description = "嵌入ID")
    private Long embeddingId;

    /**
     * 相似度分数
     */
    @Schema(description = "相似度分数", example = "0.95")
    private Double score;

    /**
     * 文本片段
     */
    @Schema(description = "文本片段", example = "这是与查询相关的文本内容")
    private String segment;

    /**
     * 向量
     */
    @Schema(description = "向量", example = "[0.1, 0.2, 0.3, ...]")
    private float[] vector;

    /**
     * 关联的文档信息
     */
    @Schema(description = "嵌入关联的文档信息")
    private DocDO document;

    public SimilaritySearchResp(Long embeddingId, Double score, String segment, DocDO document) {
        this.embeddingId = embeddingId;
        this.score = score;
        this.segment = segment;
        this.document = document;
    }
}