package org.hzhub.service.chat.impl.provider;

import dev.langchain4j.community.model.dashscope.QwenStreamingChatModel;
import dev.langchain4j.model.chat.StreamingChatModel;
import lombok.extern.slf4j.Slf4j;
import org.hzhub.common.chat.domain.dto.request.ChatRequest;
import org.hzhub.common.chat.domain.vo.chat.ChatModelVo;
import org.hzhub.enums.ChatModeType;
import org.hzhub.service.chat.AbstractChatService;
import org.springframework.stereotype.Service;


/**
 * qianWenAI服务调用
 *
 * @author ageerle@163.com
 * @date 2025/12/13
 */
@Service
@Slf4j
public class QianWenChatServiceImpl implements AbstractChatService {

    // 添加文档解析的前缀字段
    @Override
    public StreamingChatModel buildStreamingChatModel(ChatModelVo chatModelVo,ChatRequest chatRequest) {
        return QwenStreamingChatModel.builder()
                .apiKey(chatModelVo.getApiKey())
                .modelName(chatModelVo.getModelName())
                .build();
    }

    @Override
    public String getProviderName() {
        return ChatModeType.QIAN_WEN.getCode();
    }

}
