package com.fs.fastgptApi.result;

import lombok.Data;

import java.util.List;

/**
* detail=true,stream=false 响应
*/
@Data
public class ChatDetailTStreamFResult {


    public List<ResponseNode> responseData;
    public NewVariables newVariables;
    public String id;
    public String model;
    // 人为添加额外字段：是否长对话 -> false：短对话 true：长对话
    public boolean longText;
    // 人为添加额外字段：是否转人工 -> false：不需要 true：需要转人工
    public boolean artificial;
    // 人为添加额外字段：是否匹配到知识库了 -> false：未匹配 true：已匹配
    public boolean knowledge;
    public Usage usage;
    public List<Choice> choices;

    @Data
    public static class ResponseNode {
        public String nodeId;
        public String moduleName;
        public String moduleType;
        public double totalPoints;
        public String model;
        public int tokens;
        public String query;
        public int maxToken;
        public List<HistoryPreview> historyPreview;
        public int contextTotalLen;
        public double runningTime;
        public PluginOutput pluginOutput;

        @Data
        public static class HistoryPreview {
            public String obj;
            public String value;
        }

        @Data
        public static class PluginOutput {
            public String result;
        }
    }
    @Data
    public static class NewVariables {
        public String query;
    }
    @Data
    public static class Usage {
        public int prompt_tokens;
        public int completion_tokens;
        public int total_tokens;
    }
    @Data
    public static class Choice {
        public Message message;
        public String finish_reason;
        public int index;
        @Data
        public static class Message {
            public String role;
            public String content;
        }
    }
}
