package com.yanzhu.module.ai.framework.ai.core.model.doubao;

import dev.langchain4j.model.chat.ChatLanguageModel;
import dev.langchain4j.data.message.AiMessage;
import dev.langchain4j.data.message.ChatMessage;
import dev.langchain4j.model.output.Response;
import lombok.extern.slf4j.Slf4j;

import java.util.List;

/**
 * 字节豆包 {@link ChatLanguageModel} 实现类
 *
 * @author fansili
 */
@Slf4j
public class DouBaoChatModel implements ChatLanguageModel {

    public static final String BASE_URL = "https://ark.cn-beijing.volces.com/api";

    public static final String MODEL_DEFAULT = "doubao-1-5-lite-32k-250115";

    /**
     * 实际的聊天语言模型实现
     */
    private final ChatLanguageModel chatLanguageModel;

    public DouBaoChatModel(ChatLanguageModel chatLanguageModel) {
        this.chatLanguageModel = chatLanguageModel;
    }

    @Override
    public Response<AiMessage> generate(List<ChatMessage> messages) {
        return chatLanguageModel.generate(messages);
    }

    public String modelName() {
        return "doubao";
    }
}
