Skip to content

Commit 9d312f0

Browse files
committed
Add debug logging for Anthropic tool format
1 parent f7d2a62 commit 9d312f0

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

packages/agent/src/core/llm/providers/anthropic.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,16 @@ export class AnthropicProvider implements LLMProvider {
7979

8080
// Add tools if provided
8181
if (functions && functions.length > 0) {
82-
(requestOptions as any).tools = functions.map(fn => ({
83-
name: fn.name,
84-
description: fn.description,
85-
input_schema: fn.parameters,
82+
const tools = functions.map(fn => ({
83+
type: 'function',
84+
function: {
85+
name: fn.name,
86+
description: fn.description,
87+
parameters: fn.parameters,
88+
}
8689
}));
90+
console.log('Tools for Anthropic:', JSON.stringify(tools, null, 2));
91+
(requestOptions as any).tools = tools;
8792
}
8893

8994
const response = await this.client.messages.create(requestOptions);

0 commit comments

Comments
 (0)