package org.xyzh.ai.client.dto;

import com.alibaba.fastjson2.annotation.JSONField;
import lombok.Data;

import java.util.List;
import java.util.Map;

/**
 * @description Dify Rerank模型响应
 * @filename RerankModelResponse.java
 * @author AI Assistant
 * @copyright xyzh
 * @since 2025-11-06
 */
@Data
public class RerankModelResponse {
    private List<ModelProvider> data;

    @Data
    public static class ModelProvider {
        private String provider;
        private Map<String, String> label; // e.g., {"en_US": "Cohere", "zh_Hans": "Cohere"}
        @JSONField(name = "icon_small")
        private String iconSmall;
        @JSONField(name = "icon_large")
        private String iconLarge;
        private String status; // e.g., "active"
        private List<Model> models;
    }

    @Data
    public static class Model {
        private String model; // e.g., "rerank-multilingual-v3.0"
        private Map<String, String> label;
        @JSONField(name = "model_type")
        private String modelType; // e.g., "rerank"
        private List<String> features;
        @JSONField(name = "fetch_from")
        private String fetchFrom;
        @JSONField(name = "model_properties")
        private ModelProperties modelProperties;
        private Boolean deprecated;
        private String status; // e.g., "active"
        private String provider; // 模型提供商（可能在 model 数据中）
    }

    @Data
    public static class ModelProperties {
        @JSONField(name = "context_size")
        private Integer contextSize;
        @JSONField(name = "max_chunks")
        private Integer maxChunks;
    }
}

