package com.rj.aiservice;

import dev.langchain4j.service.MemoryId;
import dev.langchain4j.service.SystemMessage;
import dev.langchain4j.service.UserMessage;
import dev.langchain4j.service.spring.AiService;
import dev.langchain4j.service.spring.AiServiceWiringMode;
import reactor.core.publisher.Flux;

/**
 * Author: 李中华  wx: spllzh  email(qq): 28668817@qq.com
 * Date: 2025/8/4 11:50
 **/
@AiService(
        wiringMode = AiServiceWiringMode.EXPLICIT,
        chatModel = "openAiChatModel",
        streamingChatModel = "openAiStreamingChatModel", //配置流式 输出模型
//        chatMemory = "chatMemory", //  配置聊天记忆对象 ，基于内存
        chatMemoryProvider = "chatMemoryProvider",//配置会话记忆 提供者对象 ， 基于Redis
        contentRetriever = "contentRetriever", // 配置向量数据库检索对象
        tools = "reservationTool" // 配置工具对象
)
public interface CstAIStreamingService {

    @SystemMessage(fromResource = "system.txt")
    public Flux<String> chat(String message);

//    @SystemMessage(fromResource = "system.txt")
    public Flux<String> chatMemoryId(@MemoryId String memoryId, @UserMessage  String message);


//    @SystemMessage(fromResource = "system.txt")
    public Flux<String> chatMemoryIdRAG(@MemoryId String memoryId, @UserMessage  String message);

}


