@xsai/generate-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.
- package/dist/index.js +2 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
|
-
import { chat } from "@xsai/shared-chat";
|
|
2
|
+
import { chat, wrapToolResult } from "@xsai/shared-chat";
|
|
3
3
|
var rawGenerateText = async (options) => chat({
|
|
4
4
|
...options,
|
|
5
5
|
maxSteps: void 0,
|
|
@@ -48,7 +48,7 @@ var rawGenerateText = async (options) => chat({
|
|
|
48
48
|
throw new Error(`Model tried to call unavailable tool '${toolName}. ${availableToolsErrorMsg}.`);
|
|
49
49
|
}
|
|
50
50
|
const parsedArgs = JSON.parse(toolArgs);
|
|
51
|
-
const result = await tool.execute(parsedArgs, { abortSignal: options.abortSignal, messages, toolCallId });
|
|
51
|
+
const result = wrapToolResult(await tool.execute(parsedArgs, { abortSignal: options.abortSignal, messages, toolCallId }));
|
|
52
52
|
toolCalls.push({
|
|
53
53
|
args: toolArgs,
|
|
54
54
|
toolCallId,
|