|
|
@@ -180,9 +180,6 @@ public class TakaiAiServiceImpl implements ITakaiAiService {
|
|
|
public void onEvent(@NotNull EventSource eventSource, String id, String type, @NotNull String data) {
|
|
|
if (!StringUtils.isEmpty(data)) {
|
|
|
String newData = data.substring(preData.length());
|
|
|
- if (com.takai.common.utils.StringUtils.isNotEmpty(type) && "finish".equals(type)) {
|
|
|
- logger.info("deepseek聊天结束", newData);
|
|
|
- }
|
|
|
logger.info("deepseek聊天返回消息:" + data);
|
|
|
preData = data;
|
|
|
if (newData.indexOf(START_SIGN) > -1 || symbolData.length() > 0) {
|
|
|
@@ -245,6 +242,15 @@ public class TakaiAiServiceImpl implements ITakaiAiService {
|
|
|
send(sseEmitter, json);
|
|
|
}
|
|
|
}
|
|
|
+ if (com.takai.common.utils.StringUtils.isNotEmpty(type) && "finish".equals(type)) {
|
|
|
+ log.info("deepseek聊天结束");
|
|
|
+ JSONObject json = new JSONObject();
|
|
|
+ json.put("id", id);
|
|
|
+ json.put("event", type);
|
|
|
+ json.put("data", data);
|
|
|
+ log.info("deepseek返回信息:" + json);
|
|
|
+ send(sseEmitter, json);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@Override
|