package com.ssyf.third.doubao.model;

import lombok.Data;
import java.util.*;

/**
 * 豆包AI请求模型
 */
@Data
public class DoubaoRequest {
    
    /**
     * 模型名称
     */
    private String model;
    
    /**
     * 输入内容
     */
    private List<Map<String, Object>> input;
    
    /**
     * 创建请求对象
     * @param model 模型名称
     * @param prompt 提示词
     * @return 请求对象
     */
    public static DoubaoRequest create(String model, String prompt) {
        DoubaoRequest request = new DoubaoRequest();
        request.setModel(model);
        
        List<Map<String, Object>> inputList = new ArrayList<>();
        Map<String, Object> inputItem = new HashMap<>();
        inputItem.put("role", "user");
        
        List<Map<String, Object>> contentList = new ArrayList<>();
        Map<String, Object> textContent = new HashMap<>();
        textContent.put("type", "input_text");
        textContent.put("text", prompt);
        contentList.add(textContent);
        
        inputItem.put("content", contentList);
        inputList.add(inputItem);
        
        request.setInput(inputList);
        return request;
    }
}