@xsai/stream-text 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +3 -3
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -9,7 +9,7 @@ var XSAIError = class extends Error {
9
9
  };
10
10
 
11
11
  // src/index.ts
12
- import { chat } from "@xsai/shared-chat";
12
+ import { chat, wrapToolResult } from "@xsai/shared-chat";
13
13
 
14
14
  // src/helper.ts
15
15
  var CHUNK_HEADER_PREFIX = "data:";
@@ -198,11 +198,11 @@ var streamText = async (options) => {
198
198
  const tool = options2.tools?.find((tool2) => tool2.function.name === toolCall.function.name);
199
199
  if (tool) {
200
200
  try {
201
- const ret = await tool.execute(toolCall.function.parsed_arguments, {
201
+ const ret = wrapToolResult(await tool.execute(toolCall.function.parsed_arguments, {
202
202
  abortSignal: options2.abortSignal,
203
203
  messages: options2.messages,
204
204
  toolCallId: id
205
- });
205
+ }));
206
206
  state.toolCallResults[id] = ret;
207
207
  step.messages.push({
208
208
  content: ret,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@xsai/stream-text",
3
3
  "type": "module",
4
- "version": "0.1.0",
4
+ "version": "0.1.2",
5
5
  "description": "extra-small AI SDK for Browser, Node.js, Deno, Bun or Edge Runtime.",
6
6
  "author": "Moeru AI",
7
7
  "license": "MIT",