(
toolName: T,
input: T extends ToolName
? z.input<(typeof toolParams)[T]['inputSchema']>
: Record<string, any>,
...endsAgentStep: T extends ToolName ? [] : [boolean]
)
| 5 | import type z from 'zod/v4' |
| 6 | |
| 7 | export function getToolCallString<T extends ToolName | (string & {})>( |
| 8 | toolName: T, |
| 9 | input: T extends ToolName |
| 10 | ? z.input<(typeof toolParams)[T]['inputSchema']> |
| 11 | : Record<string, any>, |
| 12 | ...endsAgentStep: T extends ToolName ? [] : [boolean] |
| 13 | ): string { |
| 14 | const endsAgentStepValue = |
| 15 | toolName in toolParams |
| 16 | ? toolParams[toolName as keyof typeof toolParams].endsAgentStep |
| 17 | : endsAgentStep[0] ?? false |
| 18 | return $getToolCallString({ |
| 19 | toolName, |
| 20 | inputSchema: null, |
| 21 | input, |
| 22 | endsAgentStep: endsAgentStepValue, |
| 23 | }) |
| 24 | } |
no test coverage detected