Skip to content

Commit

Permalink
Merge pull request #654 from narengogi/fix/perplexity-streaming
Browse files Browse the repository at this point in the history
fix streaming transformer for perplexity
  • Loading branch information
VisargD authored Oct 8, 2024
2 parents 23a1296 + 98fec27 commit ad419f7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/providers/perplexity-ai/chatComplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,5 +185,8 @@ export const PerplexityAIChatCompleteStreamChunkTransform: (
],
})}` + '\n\n';

if (parsedChunk.choices[0]?.finish_reason)
return returnChunk + `data: [DONE]\n\n`;

return returnChunk;
};

0 comments on commit ad419f7

Please sign in to comment.