mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-17 09:02:08 +00:00
Fix block indexing in Google provider impl
This commit is contained in:
parent
2296dc4052
commit
9e86079386
1 changed files with 2 additions and 1 deletions
|
|
@ -99,12 +99,13 @@ export const streamGoogle: StreamFunction<"google-generative-ai"> = (
|
||||||
}
|
}
|
||||||
if (isThinking) {
|
if (isThinking) {
|
||||||
currentBlock = { type: "thinking", thinking: "", thinkingSignature: undefined };
|
currentBlock = { type: "thinking", thinking: "", thinkingSignature: undefined };
|
||||||
|
output.content.push(currentBlock);
|
||||||
stream.push({ type: "thinking_start", contentIndex: blockIndex(), partial: output });
|
stream.push({ type: "thinking_start", contentIndex: blockIndex(), partial: output });
|
||||||
} else {
|
} else {
|
||||||
currentBlock = { type: "text", text: "" };
|
currentBlock = { type: "text", text: "" };
|
||||||
|
output.content.push(currentBlock);
|
||||||
stream.push({ type: "text_start", contentIndex: blockIndex(), partial: output });
|
stream.push({ type: "text_start", contentIndex: blockIndex(), partial: output });
|
||||||
}
|
}
|
||||||
output.content.push(currentBlock);
|
|
||||||
}
|
}
|
||||||
if (currentBlock.type === "thinking") {
|
if (currentBlock.type === "thinking") {
|
||||||
currentBlock.thinking += part.text;
|
currentBlock.thinking += part.text;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue