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

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

/**
 * Grok 语言模型实现类
 *
 *
 */
@Slf4j
@RequiredArgsConstructor
public class GrokChatModel {

    public static final String BASE_URL = "https://api.x.ai";
    public static final String COMPLETE_PATH = "/v1/chat/completions";
    public static final String MODEL_DEFAULT = "grok-4-fast-reasoning";

    /**
     * 兼容 OpenAI 接口，进行复用
     */
    private final ChatLanguageModel openAiChatModel;

    public Response<AiMessage> generate(dev.langchain4j.data.message.UserMessage userMessage) {
        return openAiChatModel.generate(userMessage);
    }

    public Response<AiMessage> generate(java.util.List<dev.langchain4j.data.message.ChatMessage> messages) {
        return openAiChatModel.generate(messages);
    }

}
