package com.mcwl.communityCenter.domain;

import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.ArrayList;
import java.util.List;

/**
 * DeepSeek API请求参数封装类
 */
public class DeepSeekRequest {
    private String model;
    private List<Message> messages;
    @JsonProperty("max_tokens")
    private Integer maxTokens;
    private Double temperature;
    private Boolean stream;

    // 构造方法
    public DeepSeekRequest() {
        this.messages = new ArrayList<>();
    }

    // 添加消息的便捷方法
    public void addMessage(String role, String content) {
        if (this.messages == null) {
            this.messages = new ArrayList<>();
        }
        this.messages.add(new Message(role, content));
    }



    // Getters and Setters
    // 注意：必须包含所有需要序列化的字段的getter方法

    public static class Message {
        private String role;
        private String content;

        public Message(String role, String content) {
            this.role = role;
            this.content = content;
        }

        // Getters
        public String getRole() { return role; }
        public String getContent() { return content; }
    }

    // 以下是各字段的getter/setter
    public String getModel() { return model; }
    public void setModel(String model) { this.model = model; }

    public List<Message> getMessages() { return messages; }
    public void setMessages(List<Message> messages) { this.messages = messages; }

    public Integer getMaxTokens() { return maxTokens; }
    public void setMaxTokens(Integer maxTokens) { this.maxTokens = maxTokens; }

    public Double getTemperature() { return temperature; }
    public void setTemperature(Double temperature) { this.temperature = temperature; }
    public Boolean getStream() {
        return this.stream;
    }
    public void setStream(boolean stream) {
        this.stream = stream;
    }
}