Skip to content

Commit

Permalink
fix: API3 error
Browse files Browse the repository at this point in the history
  • Loading branch information
ikechan8370 committed Mar 16, 2023
1 parent 01892b6 commit bdd896a
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion utils/message.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,10 @@ export class OfficialChatGPTClient {
let event = events[i]
event = _.trimStart(event, 'data: ')
try {
fullResponse = JSON.parse(event)
let tmp = JSON.parse(event)
if (tmp.message) {
fullResponse = tmp
}
} catch (err) {
console.log(event)
}
Expand Down

0 comments on commit bdd896a

Please sign in to comment.