package org.xyzh.ai.client.dto;

import com.alibaba.fastjson2.annotation.JSONField;
import lombok.Data;
import java.util.List;

/**
 * @description 消息历史响应
 * @filename MessageHistoryResponse.java
 * @author AI Assistant
 * @copyright xyzh
 * @since 2025-11-04
 */
@Data
public class MessageHistoryResponse {

    private Integer limit;
    
    @JSONField(name = "has_more")
    private Boolean hasMore;
    
    private List<MessageInfo> data;

    @Data
    public static class MessageInfo {
        private String id;
        
        @JSONField(name = "conversation_id")
        private String conversationId;
        
        private List<MessageContent> inputs;
        
        private String query;
        
        private String answer;
        
        @JSONField(name = "message_files")
        private List<MessageFile> messageFiles;
        
        private Feedback feedback;
        
        @JSONField(name = "retriever_resources")
        private List<RetrieverResource> retrieverResources;
        
        @JSONField(name = "created_at")
        private Long createdAt;

        @JSONField(name = "agent_thoughts")
        private List<Object> agentThoughts;
    }

    @Data
    public static class MessageContent {
        private String key;
        private String value;
    }

    @Data
    public static class MessageFile {
        private String id;
        private String type;
        private String url;
        @JSONField(name = "belongs_to")
        private String belongsTo;
    }

    @Data
    public static class Feedback {
        private String rating;
    }

    @Data
    public static class RetrieverResource {
        @JSONField(name = "dataset_id")
        private String datasetId;
        
        @JSONField(name = "dataset_name")
        private String datasetName;
        
        @JSONField(name = "document_id")
        private String documentId;
        
        @JSONField(name = "document_name")
        private String documentName;
        
        @JSONField(name = "segment_id")
        private String segmentId;
        
        private Double score;
        
        private String content;
    }
}

