package com.infoepoch.pms.agent.service;

import com.infoepoch.pms.agent.config.JsonUtils;
import com.infoepoch.pms.agent.properties.AiZhiYuProperties;
import com.infoepoch.pms.agent.web.dto.AgentChatRequest;
import lombok.RequiredArgsConstructor;
import org.springframework.ai.chat.messages.Message;
import org.springframework.ai.chat.messages.SystemMessage;
import org.springframework.ai.chat.messages.UserMessage;
import org.springframework.ai.chat.model.ChatModel;
import org.springframework.ai.chat.model.ChatResponse;
import org.springframework.ai.chat.prompt.Prompt;
import org.springframework.ai.openai.OpenAiChatOptions;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;

import java.util.ArrayList;
import java.util.List;

@Service
public class PmsAgentService {
    private final ChatModel pmsChatModel;

    public PmsAgentService(@Qualifier("localChatModel") ChatModel pmsChatModel){
        this.pmsChatModel = pmsChatModel;
    }

    public void chatTest() {
        ChatResponse chatResponse = pmsChatModel.call(new Prompt("你好"));
        System.out.println(chatResponse.getResult().getOutput().getText());
    }
}
