Skip to content

Commit

Permalink
fix: groq finish reason mapping
Browse files Browse the repository at this point in the history
  • Loading branch information
narengogi committed Dec 11, 2024
1 parent c8455a4 commit 8de8209
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/providers/groq/chatComplete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ export const GroqChatCompleteStreamChunkTransform: (
if (chunk === '[DONE]') {
return `data: ${chunk}\n\n`;
}
console.log(chunk);

const parsedChunk: GroqStreamChunk = JSON.parse(chunk);
if (parsedChunk['x_groq'] && parsedChunk['x_groq'].usage) {
Expand All @@ -153,7 +154,7 @@ export const GroqChatCompleteStreamChunkTransform: (
index: parsedChunk.choices[0].index || 0,
delta: {},
logprobs: null,
finish_reason: parsedChunk.choices[0].index,
finish_reason: parsedChunk.choices[0].finish_reason,
},
],
usage: {
Expand Down

0 comments on commit 8de8209

Please sign in to comment.