(toolNames: string[])
| 184 | * Not used for ordinary turns, where the model must be free to answer in prose. |
| 185 | */ |
| 186 | export function toolChoiceJsonSchema(toolNames: string[]): JsonSchemaNode { |
| 187 | return { |
| 188 | type: 'object', |
| 189 | properties: { |
| 190 | name: { type: 'string', enum: [...toolNames] }, |
| 191 | arguments: { type: 'object' }, |
| 192 | }, |
| 193 | required: ['name', 'arguments'], |
| 194 | }; |
| 195 | } |