Commit 2ae63067 authored by 赵灿灿's avatar 赵灿灿

替换特殊字符

parent 0b27fae0
Pipeline #23561 passed with stages
in 3 minutes and 56 seconds
...@@ -352,7 +352,7 @@ public class LangChainController { ...@@ -352,7 +352,7 @@ public class LangChainController {
logger.info(line); logger.info(line);
if (!line.startsWith("data:CALLBACK#")) { if (!line.startsWith("data:CALLBACK#")) {
if (line.startsWith("data:")) { if (line.startsWith("data:")) {
String data = line.substring(5).trim(); String data = line.substring(5);
if("stop".equals(data)) if("stop".equals(data))
{ {
emitter.send(SseEmitter.event().data("stop"),MediaType.parseMediaType("application/json; charset=UTF-8")); emitter.send(SseEmitter.event().data("stop"),MediaType.parseMediaType("application/json; charset=UTF-8"));
...@@ -361,6 +361,7 @@ public class LangChainController { ...@@ -361,6 +361,7 @@ public class LangChainController {
lineCotent.append(data); lineCotent.append(data);
String sendData=data.replace("attachment#[]#attachment","").replace("source#[]#source","") String sendData=data.replace("attachment#[]#attachment","").replace("source#[]#source","")
.replace("#","").replace("*",""); .replace("#","").replace("*","");
sendData=sendData.replace("$", "#");
emitter.send(SseEmitter.event().data(sendData), MediaType.parseMediaType("application/json; charset=UTF-8")); emitter.send(SseEmitter.event().data(sendData), MediaType.parseMediaType("application/json; charset=UTF-8"));
if(!sendData.startsWith("SUGGEST[")) if(!sendData.startsWith("SUGGEST["))
content.append(sendData); content.append(sendData);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment