AI智能工牌的建表语句
This commit is contained in:
17
src/main/java/com/rj/aiservice/CstAIService.java
Normal file
17
src/main/java/com/rj/aiservice/CstAIService.java
Normal file
@@ -0,0 +1,17 @@
|
||||
package com.rj.aiservice;
|
||||
|
||||
import dev.langchain4j.service.spring.AiService;
|
||||
import dev.langchain4j.service.spring.AiServiceWiringMode;
|
||||
|
||||
/**
|
||||
* Author: 李中华 wx: spllzh email(qq): 28668817@qq.com
|
||||
* Date: 2025/8/4 10:21
|
||||
**/
|
||||
@AiService(
|
||||
wiringMode = AiServiceWiringMode.EXPLICIT,
|
||||
chatModel = "openAiChatModel"
|
||||
)
|
||||
public interface CstAIService {
|
||||
|
||||
public String chat(String message);
|
||||
}
|
||||
36
src/main/java/com/rj/aiservice/CstAIStreamingService.java
Normal file
36
src/main/java/com/rj/aiservice/CstAIStreamingService.java
Normal file
@@ -0,0 +1,36 @@
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user