package com.yingpaipay.common.ai.pojo;

import com.yingpaipay.common.ai.enumeration.SiliconModel;
import lombok.Data;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

@Data
public class SiliconFlowReq {

    private String model;

    private List<SiliconFlowMessage> messages;

    public static class Builder {
        SiliconFlowReq req = new SiliconFlowReq();
        List<SiliconFlowMessage> messages = new ArrayList<>();

        public Builder model(SiliconModel model) {
            req.model = model.getName();
            return this;
        }

        public Builder message(SiliconFlowMessage message) {
            messages.add(message);
            return this;
        }

        public Builder messages(List<SiliconFlowMessage> messages) {
            this.messages = messages;
            return this;
        }

        public Builder messages(SiliconFlowMessage[] messages) {
            this.messages = Arrays.asList(messages);
            return this;
        }

        public SiliconFlowReq build() {
            req.messages = messages;
            return req;
        }

    }

}
