IChatGptSchema is a type schema info of the ChatGPT function calling.
IChatGptSchema basically follows the JSON schema definition of the OpenAPI
v3.1 speciifcation; OpenApiV3_1.IJsonSchema.
However, the IChatGptSchema does not follow the entire specification of the
OpenAPI v3.1. It has own specific restrictions and definitions. Here is the
list of how IChatGptSchema is different with the OpenAPI v3.1 JSON schema.
Also, OpenAI has banned below constraint properties. Instead,
IChatGptSchema fills the IChatGptSchema.__IAttribute.description
property with the comment text like "@format uuid".
Additionally, OpenAI cannot define the description property to the
IChatGptSchema.IReference type, and even does not understand the
capsulization to the IChatGptSchema.IAnyOf type. Therefore, the
description is written to the parent object type, not the reference type.
Specified not only by the official documentation, but also by my
experiments. Therefore, its definitions can be inaccurate or be
changed in the future. If you find any wrong or outdated definitions,
please let me know by issue.
Type schema info of the ChatGPT.
IChatGptSchema
is a type schema info of the ChatGPT function calling.IChatGptSchema
basically follows the JSON schema definition of the OpenAPI v3.1 speciifcation; OpenApiV3_1.IJsonSchema.However, the
IChatGptSchema
does not follow the entire specification of the OpenAPI v3.1. It has own specific restrictions and definitions. Here is the list of howIChatGptSchema
is different with the OpenAPI v3.1 JSON schema.Decompose mixed type: OpenApiV3_1.IJsonSchema.IMixed
Resolve nullable property: OpenApiV3_1.IJsonSchema.__ISignificant.nullable
Tuple type is banned: OpenApiV3_1.IJsonSchema.ITuple.prefixItems
Constant type is banned: OpenApiV3_1.IJsonSchema.IConstant
Merge OpenApiV3_1.IJsonSchema.IOneOf to IChatGptSchema.IAnOf
Merge OpenApiV3_1.IJsonSchema.IAllOf to IChatGptSchema.IObject
Merge OpenApiV3_1.IJsonSchema.IRecursiveReference to IChatGptSchema.IReference
When IChatGptSchema.IConfig.strict mode
If compare with the OpenApi.IJsonSchema, the emended JSON schema specification,
IChatGptSchema.IAnyOf instead of the OpenApi.IJsonSchema.IOneOf
IChatGptSchema.IParameters.$defs instead of the OpenApi.IJsonSchema.IComponents.schemas
IChatGptSchema.IString.enum instead of the OpenApi.IJsonSchema.IConstant
IChatGptSchema.additionalProperties is fixed to
false
No tuple type OpenApi.IJsonSchema.ITuple support
When IChatGptSchema.IConfig.strict mode
For reference, if you've composed the
IChatGptSchema
type with the IChatGptSchema.IConfig.referencefalse
option (default isfalse
), only the recursived named types would be archived into the IChatGptSchema.IParameters.$defs, and the others would be ecaped from the IChatGptSchema.IReference type.Also, OpenAI has banned below constraint properties. Instead,
IChatGptSchema
fills the IChatGptSchema.__IAttribute.description property with the comment text like"@format uuid"
.Additionally, OpenAI cannot define the
description
property to the IChatGptSchema.IReference type, and even does not understand the capsulization to the IChatGptSchema.IAnyOf type. Therefore, thedescription
is written to the parent object type, not the reference type.