We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f7c11c8 commit 00fb220Copy full SHA for 00fb220
packages/workers-ai-provider/src/streaming.ts
@@ -43,6 +43,19 @@ export function getMappedStream(response: Response) {
43
});
44
}
45
46
+ // Handling number responses for models like Llama4
47
+ if (typeof chunk.response === "number") {
48
+ if (!textId) {
49
+ textId = generateId();
50
+ controller.enqueue({ type: "text-start", id: textId });
51
+ }
52
+ controller.enqueue({
53
+ type: "text-delta",
54
+ id: textId,
55
+ delta: String(chunk.response),
56
+ });
57
58
+
59
// Handle reasoning content
60
const reasoningDelta = chunk?.choices?.[0]?.delta?.reasoning_content;
61
if (reasoningDelta?.length) {
0 commit comments