Commit cbf7a1c587caee27cb98676f0ccffdcbf7b1dc49
1 parent
6633bf00
【代码优化】XingHuoApi stream 变量没有其他地方使用,直接return
Showing
1 changed file
with
1 additions
and
2 deletions
yudao-module-ai/yudao-spring-boot-starter-ai/src/main/java/cn/iocoder/yudao/framework/ai/core/model/xinghuo/api/XingHuoApi.java
| ... | ... | @@ -134,7 +134,7 @@ public class XingHuoApi { |
| 134 | 134 | URI uri = URI.create(authUrl); |
| 135 | 135 | // 发起 wss 请求并处理响应 |
| 136 | 136 | // 创建一个 Flux 来处理接收到的消息 |
| 137 | - Flux<XingHuoChatCompletion> messageFlux = Flux.create(sink -> { | |
| 137 | + return Flux.create(sink -> { | |
| 138 | 138 | socketClient.execute(uri, session -> |
| 139 | 139 | session.send(Mono.just(session.textMessage(JSONUtil.toJsonStr(request)))) |
| 140 | 140 | .thenMany(session.receive() |
| ... | ... | @@ -145,6 +145,5 @@ public class XingHuoApi { |
| 145 | 145 | .then()) |
| 146 | 146 | .subscribe(); // 订阅以开始会话 |
| 147 | 147 | }); |
| 148 | - return messageFlux; | |
| 149 | 148 | } |
| 150 | 149 | } | ... | ... |