Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
citmina authored Mar 11, 2024
1 parent a250c8e commit 36b9ad8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,15 @@ public class ChatController {
* 以下两种方式均可
*/
// 连续对话,流式
@GetMapping(value = "/stream/chat", produces = MediaType.TEXT_EVENT_STREAM_VALUE)
@GetMapping(value = "/stream/chats", produces = MediaType.TEXT_EVENT_STREAM_VALUE)
public Flux<String> chatSingleStream(@RequestParam String msg, @RequestParam String uid) {
// 单次对话 chatClient.chatStream(msg)
Flux<ChatResponse> responseFlux = chatClient.chatsStream(msg, uid);
return responseFlux.map(ChatResponse::getResult);
}

// 连续对话,流式
@GetMapping(value = "/sse/chats", produces = MediaType.TEXT_EVENT_STREAM_VALUE)
@GetMapping(value = "/stream/chats1", produces = MediaType.TEXT_EVENT_STREAM_VALUE)
public SseEmitter chats(@RequestParam String msg, @RequestParam String uid) {
SseEmitter emitter = new SseEmitter();
// 支持参数设置 ChatErnieRequest(Ernie系列模型)、ChatBaseRequest(其他模型)
Expand Down

0 comments on commit 36b9ad8

Please sign in to comment.