| 90 | * @param endsAgentStep - Whether the agent should end its turn after this tool call |
| 91 | */ |
| 92 | export function $getToolCallString<Input>(params: { |
| 93 | toolName: string |
| 94 | inputSchema: z.ZodType<any, Input> | null |
| 95 | input: Input |
| 96 | endsAgentStep: boolean |
| 97 | }): string { |
| 98 | const { toolName, input, endsAgentStep } = params |
| 99 | const obj: Record<string, any> = { |
| 100 | [toolNameParam]: toolName, |
| 101 | ...input, |
| 102 | } |
| 103 | if (endsAgentStep) { |
| 104 | obj[endsAgentStepParam] = endsAgentStep satisfies true |
| 105 | } |
| 106 | return [startToolTag, JSON.stringify(obj, null, 2), endToolTag].join('') |
| 107 | } |
| 108 | |
| 109 | export function $getNativeToolCallExampleString<Input>(params: { |
| 110 | toolName: string |