Skip to content

Commit

Permalink
Merge pull request #84 from caipeizhi/main_修复stream偶发的断流
Browse files Browse the repository at this point in the history
修复stream偶发的断流
  • Loading branch information
202252197 committed Apr 18, 2023
2 parents b56d9f6 + 775a858 commit 04b0d04
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/view/pages/chatHome/chatwindow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,21 @@ export default {
let decoded = new TextDecoder().decode(value);
decoded = _this.chatList[currentResLocation].reminder + decoded;
let decodedArray = decoded.split("data: ");
let longstr = "";
decodedArray.forEach(decoded => {
try {
decoded = decoded.trim();
if ( longstr == "" ){
JSON.parse(decoded);
}else{
decoded = longstr + decoded;
longstr = "";
JSON.parse(decoded);
}
}catch ( e ){
longstr = decoded;
decoded = "";
}
if(decoded!==""){
if(decoded.trim()==="[DONE]"){
return;
Expand Down

1 comment on commit 04b0d04

@4everland
Copy link

@4everland 4everland bot commented on 04b0d04 Apr 18, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following parameters

parameters Value
IPFS CID bafybeifr7564ap32bdd4wusfwnenn5ocx5fo5x27pvifcsvarbywqnvezq
Assigned domain https://chatgpt_jcm-oogoivuc-202252197.4everland.app
https://chatgpt_jcm-92.4everland.app
Custom domain

Please sign in to comment.