diff --git a/packages/react/CHANGELOG.md b/packages/react/CHANGELOG.md index 7b158e025..5bb6baacd 100644 --- a/packages/react/CHANGELOG.md +++ b/packages/react/CHANGELOG.md @@ -1,5 +1,11 @@ # @assistant-ui/react +## 0.5.79 + +### Patch Changes + +- feat: allow out of order tool args streaming + ## 0.5.78 ### Patch Changes diff --git a/packages/react/package.json b/packages/react/package.json index 2e30d786d..f4e08a9a0 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -29,7 +29,7 @@ "conversational-ui", "conversational-ai" ], - "version": "0.5.78", + "version": "0.5.79", "license": "MIT", "exports": { ".": { diff --git a/packages/react/src/runtimes/edge/streams/assistantDecoderStream.ts b/packages/react/src/runtimes/edge/streams/assistantDecoderStream.ts index af497233d..b7c172871 100644 --- a/packages/react/src/runtimes/edge/streams/assistantDecoderStream.ts +++ b/packages/react/src/runtimes/edge/streams/assistantDecoderStream.ts @@ -47,18 +47,14 @@ export function assistantDecoderStream() { } case AssistantStreamChunkType.ToolCallDelta: { const { toolCallId, argsTextDelta } = value; - if (currentToolCall?.id !== toolCallId) { - throw new Error( - `Received tool call delta for unknown tool call "${toolCallId}".`, - ); - } + const toolName = toolCallNames.get(toolCallId)!; currentToolCall!.argsText += argsTextDelta; controller.enqueue({ type: "tool-call-delta", toolCallType: "function", - toolCallId: currentToolCall!.id, - toolName: currentToolCall!.name, + toolCallId, + toolName, argsTextDelta: argsTextDelta, }); break;