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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user