-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Description
如何在controller层获取到消息的id啊
@GetMapping("/stream")
public Flux<String> testStream(String q, String chatId, HttpServletResponse response) {
response.setCharacterEncoding("UTF-8");
SystemPromptTemplate systemPromptTemplate = new SystemPromptTemplate(systemResource);
String render = systemPromptTemplate.render(Map.of("currentDate", LocalDateTime.now().atZone(ZoneId.of("Asia/Shanghai")).format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm"))));
return chatClient.prompt().system(render).user(q)
.advisors(a -> a.param(CONVERSATION_ID, chatId))
.stream()
.content();
}