Skip to content

fix(fireworks-ai): tolerate empty choices in stream chunks#1629

Open
SAY-5 wants to merge 1 commit into
Portkey-AI:mainfrom
SAY-5:say5/fireworks-empty-choices-1627
Open

fix(fireworks-ai): tolerate empty choices in stream chunks#1629
SAY-5 wants to merge 1 commit into
Portkey-AI:mainfrom
SAY-5:say5/fireworks-empty-choices-1627

Conversation

@SAY-5
Copy link
Copy Markdown

@SAY-5 SAY-5 commented May 2, 2026

Fixes #1627.

FireworksAIChatCompleteStreamChunkTransform indexed parsedChunk.choices[0].index directly. Fireworks emits chunks where choices is empty or absent (e.g. usage-only chunks when stream_options.include_usage is set), and the transform threw Cannot read properties of undefined (reading 'index'). Mirror the fix landed for groq (#1073) and together-ai (#1321): emit choices: [] when the choice is missing, otherwise pass through unchanged. Usage continues to flow through.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unhandled exception in fireworks-ai streaming requests when stream chunk has empty choices

1 participant