However when I enable strict mode on, following error throws:
BadRequestError: Error code: 400 - {‘error’: {‘message’: “Invalid schema for function ‘create_where_clause’: In context=(), ‘oneOf’ is not permitted.”, ‘type’: ‘invalid_request_error’, ‘param’: ‘tools[0].function.parameters’, ‘code’: ‘invalid_function_parameters’}}
Basically OpenAI structured outputs doesn’t currently support oneOf, so you would need to use anyOf instead.
The reason why you get an error in “strict” mode is because in strict mode, a more thorough validation against their JSON Schema Spec support is performed. OpenAI supports only a subset of JSON Schema Spec.
An example of an anyOf schema - the alternate schema gives the AI a place to write a non-response, for example, that it doesn’t have enough info to fill out the main schema.