package com.bifan.txtreaderlib.bean;

import java.util.List;


//curl https://api.openai.com/v1/chat/completions \
//        -H "Content-Type: application/json" \
//        -H "Authorization: Bearer $OPENAI_API_KEY" \
//        -d '{
//        "model": "gpt-3.5-turbo",
//        "messages": [
//        {
//        "role": "system",
//        "content": "You are a helpful assistant."
//        },
//        {
//        "role": "user",
//        "content": "Hello!"
//        }
//        ]
//        }'
public class ChatRequest {
    private String model;
    private List<Message> messages;
    private Integer maxTokens;
    private Double temperature;

    public ChatRequest(List<Message> messages) {
        this.messages = messages;
        this.model = "gpt-3.5-turbo"; // 默认模型
        this.maxTokens = 150; // 默认的最大 token 数
        this.temperature = 0.7;
    }
    public void setMaxTokens(Integer maxTokens) {
        this.maxTokens = maxTokens;
    }
    public Integer getMaxTokens() {
        return maxTokens;
    }
    public void setTemperature(Double temperature) {
        this.temperature = temperature;
    }

    public Double getTemperature() {
        return temperature;
    }

    public void setModel(String model) {
        this.model = model;
    }

    public List<Message> getMessages() {
        return messages;
    }

    public String getModel() {
        return model;
    }

    // Message 类
    public static class Message {
        String role;
        String content;

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

