Skip to content

Commit b5c2563

Browse files
committed
🐛 FIX: Google stream
1 parent b07f0c3 commit b5c2563

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/baseai/src/dev/providers/google/chatComplete.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,7 @@ export const GoogleChatCompleteStreamChunkTransform: (
439439
model: '',
440440
provider: 'google',
441441
choices:
442-
parsedChunk.candidates?.map(generation => {
442+
parsedChunk.candidates?.map((generation, index) => {
443443
let message: ProviderMessage = {
444444
role: 'assistant',
445445
content: ''
@@ -473,7 +473,7 @@ export const GoogleChatCompleteStreamChunkTransform: (
473473
}
474474
return {
475475
delta: message,
476-
index: generation.index,
476+
index: generation.index ?? index,
477477
finish_reason: generation.finishReason
478478
};
479479
}) ?? []

0 commit comments

Comments
 (0)