Half the calls are rejected with openai.InternalServerError: Error code: 500 - {‘error’: {‘message’: 'The server had an error processing your request. Sorry about that! You can retry your request, or contact us…}} when the prompt does not necessitate a tool call.
This happens whether or not some arguments of the tool are ‘required’: True
It does not happen with GPT4o.
Are others seeing the issue or more likely something wrong with our code?
If the model might not feel confident in filling out the provided schema fields, you can also start the root object with a schema that has anyOf, with two alternate schemas – either one based on your data, or one where the AI can reply and can say what the problem was with selecting the schema where data is required.
Another technique is a second function that can escape from function-calling when invoked in error, with “response to user, not to any external tool”.