package com.ruoyi.ai.assistant;
|
|
import dev.langchain4j.service.MemoryId;
|
import dev.langchain4j.service.SystemMessage;
|
import dev.langchain4j.service.UserMessage;
|
import dev.langchain4j.service.V;
|
import dev.langchain4j.service.spring.AiService;
|
import dev.langchain4j.service.spring.AiServiceWiringMode;
|
|
/**
|
* @author :yys
|
* @date : 2025/5/2 19:35
|
*/
|
@AiService(
|
wiringMode = AiServiceWiringMode.EXPLICIT,
|
chatModel = "qwenChatModel",
|
chatMemoryProvider = "chatMemoryProvider"
|
)
|
public interface SeparateChatAssistant {
|
|
@SystemMessage(fromResource = "my-prompt-template.txt")//系统消息提示词
|
String chat(@MemoryId String memoryId, @UserMessage String userMessage);
|
|
@UserMessage("你是我的好朋友,请用粤语回答问题。{{message}}")
|
String chat2(@MemoryId String memoryId, @V("message") String userMessage);
|
|
@SystemMessage(fromResource = "my-prompt-template3.txt")
|
String chat3(
|
@MemoryId String memoryId,
|
@UserMessage String userMessage,
|
@V("username") String username,
|
@V("age") int age
|
);
|
|
}
|