Stream assistant content to chat output

This commit is contained in:
wuyang6
2026-05-14 20:06:55 +08:00
parent 2eeabdeccf
commit 2895425869
3 changed files with 6 additions and 53 deletions
+6 -5
View File
@@ -507,11 +507,12 @@ function writeRuntimeEvent(
});
}
if (event.type === "content_delta" && event.delta) {
writer.write({
type: "reasoning-delta",
id: "reasoning-1",
delta: event.delta,
});
if (!streamState?.textStarted) {
writer.write({ type: "text-start", id: "text-1" });
if (streamState) streamState.textStarted = true;
}
writer.write({ type: "text-delta", id: "text-1", delta: event.delta });
if (streamState) streamState.textStreamed = true;
}
if (event.type === "tool_call_delta") {
const key =