New Function Calling with "Strict" has a problem with "minimum" integer type

As you know new “strict”: true feature is addded by openai. I’ve realized a bug in this system. When I use “strict”: true, and trying to save my function calling schema on my assistant api, it does not save and give me the following error:

“Invalid schema for function ‘price_calculation’: In context=(‘properties’, ‘price_calculation’, ‘properties’, ‘Stromboli’, ‘items’, ‘properties’, ‘num_singular_toppings’), ‘minimum’ is not permitted”

here is my related part in my schema:

"num_singular_toppings": {
                  "type": "integer",
                  "description": "Number of singular toppings",
                  "minimum": 0
                },

As you know if the type is number or integer, we can use “minimum” feature in json. But open ai does not accept that interestingly when you set “strict”: true. It looks like a bug to me and does not make any sense.

Has anybody realized this? Any idea?

1 Like

I’ll pass it along, but for now you’ll need to remove it and do that check externally.

1 Like

Hi, OAI staff here. Currently we don’t support certain jsonschema keywords for structured outputs, which is documented here. In the meantime, you can add the the restriction (“minimum: 0”) to the “description” of the field to increase the chance the model follows it.

3 Likes