Skip to content

Commit

Permalink
cleanedChunk
Browse files Browse the repository at this point in the history
  • Loading branch information
chatbookai committed Jun 2, 2024
1 parent 05e4752 commit 9994198
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions express/src/utils/llms.js
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,6 @@ let ChatBaiduWenxinModel = null
if( chunk && chunk != 'data: [DONE]' && chunk != 'data: [DONE]\n' && !chunk.startsWith('data: [DONE]') ) {
const cleanedChunk = chunk.replace(/^data: /, '');
try {
console.log('cleanedChunk cleanedChunk:', cleanedChunk);
const chunkData = JSON.parse(cleanedChunk);
if (chunkData && chunkData.choices && Array.isArray(chunkData.choices)) {
chunkData.choices.forEach((choice) => {
Expand All @@ -336,7 +335,7 @@ let ChatBaiduWenxinModel = null
}
}
catch (error) {
console.error('chatDeepSeek Error parsing JSON:', error);
console.error('chatDeepSeek Error parsing JSON:', error, "cleanedChunk:", cleanedChunk);
}
}
});
Expand Down

0 comments on commit 9994198

Please sign in to comment.