Whitch json schema version should function calling use

I am using jackson-module-jsonSchema to generate JSON schema, but I found that it uses v3 version. It is not the same as the example in OpenAI. For example, for the required field:

"role": {
    "type": "string",
    "required": true,
    "description": "My description to add in schema"
}

In the OpenAI example, the format is at least v4:

"required":["role"]

I found that there are many differences between different versions. Could you please tell me which version is the officially recommended one?

1 Like

Understanding JSON Schema — Understanding JSON Schema 2020-12 documentation Here’s the official reference link of the schema version, as of 2020-12. You need to check with the maintainer of jackson-module-jsonSchema regarding the compatibility.

1 Like

yes, but i want know which version OpenAI best support.

1 Like

The v3 and v4 are both not official version specification of JSON Schema, you should check with the maintainer of the module.

Specification Links | JSON Schema Here’s the official specification, OpenAI adopts the 2020-12 version, which is annotated as Draft 8 patch 1.

3 Likes