Update zhipuai-chat.adoc (#3531)

* Update zhipuai-chat docs example with "produces = MediaType.TEXT_EVENT_STREAM_VALUE"  ( Content-Type =  "text/event-stream" ) in the "@GetMapping" annotation.

Signed-off-by: 老虎是条大狼狗 <494509580@qq.com>
(cherry picked from commit ed4fb29a74)
This commit is contained in:
老虎是条大狼狗
2025-06-13 22:19:34 +08:00
committed by Spring Builds
parent dd84b7558d
commit 219cf9a65d

View File

@@ -210,7 +210,7 @@ public class ChatController {
return Map.of("generation", this.chatModel.call(message));
}
@GetMapping("/ai/generateStream")
@GetMapping(value = "/ai/generateStream", produces = MediaType.TEXT_EVENT_STREAM_VALUE)
public Flux<ChatResponse> generateStream(@RequestParam(value = "message", defaultValue = "Tell me a joke") String message) {
var prompt = new Prompt(new UserMessage(message));
return this.chatModel.stream(prompt);