Yep, even with a “strict”:“false” function, the AI model just is unable to comply no matter how clear the understanding, because:
This is a tool wrapper that low-iq models have a bad history with…
An alternate strategy is to have a function with an array of the API objects you need, of undetermined length:
This is the function to implement this.
{
"name": "roll_dice",
"description": "Rolls true random dice, supporting multiple dice rolls, returning totals of one trial",
"strict": true,
"parameters": {
"type": "object",
"required": [
"trials"
],
"properties": {
"trials": {
"type": "array",
"description": "Array of trials for rolling dice",
"items": {
"type": "object",
"properties": {
"rolls": {
"type": "number",
"description": "The number of dice to roll"
},
"sides": {
"type": "number",
"description": "The number of sides on each die"
}
},
"required": [
"rolls",
"sides"
],
"additionalProperties": false
}
}
},
"additionalProperties": false
}
}