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.