package org.xyzh.ai.client.dto;

import com.fasterxml.jackson.annotation.JsonProperty;
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;
    
    @JsonProperty("has_more")
    private Boolean hasMore;
    
    private List<MessageInfo> data;

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

        @JsonProperty("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;
        @JsonProperty("belongs_to")
        private String belongsTo;
    }

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

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

