主题
流处理
代码片段
java
@GetMapping(value = "/stream",produces = "text/html;charset=UTF-8")
public Flux<String> stream(@RequestParam(value = "msg",
defaultValue = "Tell me a joke") String message) {
Flux<String> output = this.chatClient.prompt()
.user(message)
// .system("You are a funny assistant") // 设置角色
.stream()
.content();
return output;
}