Skip to content

Commit c95a69c

Browse files
committed
Fix tool conversion to use zodToJsonSchema
1 parent 9d312f0 commit c95a69c

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/agent/src/core/toolAgent/toolAgentCore.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { zodToJsonSchema } from 'zod-to-json-schema';
2+
13
import { DEFAULT_CONFIG } from './config.js';
24
import {
35
formatToolCalls,
@@ -59,10 +61,10 @@ export const toolAgent = async (
5961
interactions++;
6062

6163
// Convert tools to function definitions
62-
const functionDefinitions: FunctionDefinition[] = tools.map((tool) => ({
64+
const functionDefinitions = tools.map((tool) => ({
6365
name: tool.name,
6466
description: tool.description,
65-
parameters: tool.parameters,
67+
parameters: tool.parametersJsonSchema || zodToJsonSchema(tool.parameters),
6668
}));
6769

6870
// Prepare the messages for the LLM, including the system message

0 commit comments

Comments
 (0)