We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9d312f0 commit c95a69cCopy full SHA for c95a69c
packages/agent/src/core/toolAgent/toolAgentCore.ts
@@ -1,3 +1,5 @@
1
+import { zodToJsonSchema } from 'zod-to-json-schema';
2
+
3
import { DEFAULT_CONFIG } from './config.js';
4
import {
5
formatToolCalls,
@@ -59,10 +61,10 @@ export const toolAgent = async (
59
61
interactions++;
60
62
63
// Convert tools to function definitions
- const functionDefinitions: FunctionDefinition[] = tools.map((tool) => ({
64
+ const functionDefinitions = tools.map((tool) => ({
65
name: tool.name,
66
description: tool.description,
- parameters: tool.parameters,
67
+ parameters: tool.parametersJsonSchema || zodToJsonSchema(tool.parameters),
68
}));
69
70
// Prepare the messages for the LLM, including the system message
0 commit comments