diff --git a/packages/react/CHANGELOG.md b/packages/react/CHANGELOG.md index aefb6fce5..f304ebfde 100644 --- a/packages/react/CHANGELOG.md +++ b/packages/react/CHANGELOG.md @@ -1,5 +1,11 @@ # @assistant-ui/react +## 0.7.15 + +### Patch Changes + +- fix: toolResultStream should support JSONSchema params + ## 0.7.14 ### Patch Changes diff --git a/packages/react/package.json b/packages/react/package.json index e1c44974b..f30a007de 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -29,7 +29,7 @@ "conversational-ui", "conversational-ai" ], - "version": "0.7.14", + "version": "0.7.15", "license": "MIT", "exports": { ".": { diff --git a/packages/react/src/runtimes/edge/streams/toolResultStream.ts b/packages/react/src/runtimes/edge/streams/toolResultStream.ts index 58e14c938..158448b07 100644 --- a/packages/react/src/runtimes/edge/streams/toolResultStream.ts +++ b/packages/react/src/runtimes/edge/streams/toolResultStream.ts @@ -64,38 +64,38 @@ export function toolResultStream( isError: true, }); return; - } else { - toolCallExecutions.set( - toolCallId, - (async () => { - if (!tool.execute) return; - - try { - const result = await tool.execute(args, { abortSignal }); - - controller.enqueue({ - type: "tool-result", - toolCallType, - toolCallId, - toolName, - result, - }); - } catch (error) { - controller.enqueue({ - type: "tool-result", - toolCallType, - toolCallId, - toolName, - result: "Error: " + error, - isError: true, - }); - } finally { - toolCallExecutions.delete(toolCallId); - } - })(), - ); } } + + toolCallExecutions.set( + toolCallId, + (async () => { + if (!tool.execute) return; + + try { + const result = await tool.execute(args, { abortSignal }); + + controller.enqueue({ + type: "tool-result", + toolCallType, + toolCallId, + toolName, + result, + }); + } catch (error) { + controller.enqueue({ + type: "tool-result", + toolCallType, + toolCallId, + toolName, + result: "Error: " + error, + isError: true, + }); + } finally { + toolCallExecutions.delete(toolCallId); + } + })(), + ); break; }