package org.jeecg.modules.adweb.gpt.vo;

import com.fasterxml.jackson.annotation.JsonProperty;

import lombok.Data;

import java.io.Serializable;
import java.util.Collections;
import java.util.List;

/**
 * 聊天记录
 *
 * @author: chenrui
 * @date: 2024/2/22 13:36
 */
@Data
public class ChatHistoryVO implements Serializable {
    private static final long serialVersionUID = 3238429500037511283L;

    /** 话题id */
    private String topicId;

    /** 聊天记录内容 */
    private String content;

    @Data
    public static class Content {
        private String active;
        private boolean usingContext;
        private List<History> history = Collections.emptyList();
        private List<Chat> chat = Collections.emptyList();

        @Data
        public static class History {
            private String uuid;
            private String title;

            @JsonProperty("isEdit")
            private boolean isEdit;
        }

        @Data
        public static class Chat {
            private String uuid;
            private List<ChatData> data;

            @Data
            public static class ChatData {
                private String dateTime;
                // 不解析 - 节省内存
                // private String text;
                private boolean inversion;
                private boolean error;
                private boolean loading;

                // 不解析 - 节省内存
                // private ConversationOptions conversationOptions;
                // private RequestOptions requestOptions;

                @Data
                public static class ConversationOptions {
                    private String parentMessageId;
                }

                @Data
                public static class RequestOptions {
                    private String prompt;
                    private Options options;

                    @Data
                    public static class Options {
                        private String parentMessageId;
                    }
                }
            }
        }
    }
}
