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

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} 实现类
 *
 * 1. 混元大模型：基于 <a href="https://cloud.tencent.com/document/product/1729/111007">知识引擎原子能力</a> 实现
 * 2. 知识引擎原子能力：基于 <a href="https://cloud.tencent.com/document/product/1772/115969">知识引擎原子能力</a> 实现
 *
 * @author fansili
 */
@Slf4j
public class HunYuanChatModel implements ChatLanguageModel {

    public static final String BASE_URL = "https://api.hunyuan.cloud.tencent.com";

    public static final String MODEL_DEFAULT = "hunyuan-turbo";

    public static final String DEEP_SEEK_BASE_URL = "https://api.lkeap.cloud.tencent.com";

    public static final String DEEP_SEEK_MODEL_DEFAULT = "deepseek-v3";

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

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

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

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