BadRequestError Invalid schema for function

@IntelliJJ I’ll do my best to provide feedback – your Schema is complex and it’s in Dutch, which I do not understand.

  1. Missing "required" property keyword:
    You should specify which, if any, parameter properties are “required”.
    In the example below, I’ve made all of them required. If none are required, then “required” should be an empty list.

  2. Verify implementation of "patternProperties":
    Your implementation of "patternProperties" looks odd. What exactly are you trying to achieve?
    The error you provided points me in the direction of the source of the bug being here.
    Quoting the error: In context=(‘properties’, ‘opleiding’), array schema missing items
    When you define opleiding as being of type array, you should follow it up with items. See an example below from JSON Schema’s docs:

{
  "type": "array",
  "items": {
    "type": "number"
  }
}

  1. Redundant response_format:
    When using tools in OpenAI Chat Completion, the response_format is automatically set to {"type": "json_object"}source. Therefore, you can remove this line of code: response_format={"type": "json_object"},.

  2. Provide example text:
    Could you provide an example input text you’re trying to extract data from?