(
config: CodeExecutionToolConfig,
options: CodeExecutionToolOptions = {},
)
| 70 | } |
| 71 | |
| 72 | export function codeExecutionTool( |
| 73 | config: CodeExecutionToolConfig, |
| 74 | options: CodeExecutionToolOptions = {}, |
| 75 | ): AnthropicCodeExecutionTool { |
| 76 | const { skills } = options |
| 77 | if (skills) { |
| 78 | if (skills.length > 8) { |
| 79 | throw new Error('code_execution supports at most 8 skills per request.') |
| 80 | } |
| 81 | for (const skill of skills) { |
| 82 | if (skill.skill_id.length < 1 || skill.skill_id.length > 64) { |
| 83 | throw new Error('skill_id must be between 1 and 64 characters.') |
| 84 | } |
| 85 | } |
| 86 | } |
| 87 | const metadata: CodeExecutionToolMetadata = { |
| 88 | config, |
| 89 | ...(skills && { skills }), |
| 90 | } |
| 91 | return brandProviderTool<AnthropicCodeExecutionTool>({ |
| 92 | name: 'code_execution', |
| 93 | description: '', |
| 94 | metadata, |
| 95 | }) |
| 96 | } |
no test coverage detected