diff --git a/packages/assistant-stream/CHANGELOG.md b/packages/assistant-stream/CHANGELOG.md index 081476690..de2ef450a 100644 --- a/packages/assistant-stream/CHANGELOG.md +++ b/packages/assistant-stream/CHANGELOG.md @@ -1,5 +1,11 @@ # assistant-stream +## 0.0.12 + +### Patch Changes + +- ignore unsupported data stream parts + ## 0.0.11 ### Patch Changes diff --git a/packages/assistant-stream/package.json b/packages/assistant-stream/package.json index a471c865f..161502725 100644 --- a/packages/assistant-stream/package.json +++ b/packages/assistant-stream/package.json @@ -1,6 +1,6 @@ { "name": "assistant-stream", - "version": "0.0.11", + "version": "0.0.12", "license": "MIT", "exports": { ".": { diff --git a/packages/assistant-stream/src/core/serialization/DataStream.ts b/packages/assistant-stream/src/core/serialization/DataStream.ts index e279b713e..90122153f 100644 --- a/packages/assistant-stream/src/core/serialization/DataStream.ts +++ b/packages/assistant-stream/src/core/serialization/DataStream.ts @@ -151,6 +151,33 @@ export class DataStreamDecoder { break; } + case "9": { + const { toolCallId, args } = value as { + toolCallId: string; + toolName: string; + args: object; + }; + controller.enqueue({ + type: "tool-call-begin", + toolCallId, + toolName: toolCallId, + }); + controller.enqueue({ + type: "tool-call-delta", + toolCallId, + argsTextDelta: JSON.stringify(args), + }); + break; + } + + case "2": + case "3": + case "8": + case "d": + case "e": { + break; // ignore + } + default: const exhaustiveCheck: string = type; throw new Error(`unsupported chunk type: ${exhaustiveCheck}`);