@typia/website
    Preparing search index...

    Type Alias IChatGptSchema

    Type schema info for OpenAI function calling.

    IChatGptSchema is a type schema info for OpenAI function calling. The type name "ChatGpt" is intentionally used to avoid confusion with "OpenAPI" specification, even though this is designed for OpenAI models.

    IChatGptSchema basically follows the JSON schema definition of the OpenAPI v3.1 specification; OpenApiV3_1.IJsonSchema. However, it deviates from the standard JSON schema specification and omits many features when used in IChatGptSchema.IConfig.strict mode for OpenAI function calling.

    IChatGptSchema supports all JSON schema features through workaround expressions using JSDoc tags in the description property, so using IChatGptSchema does not degrade function calling performance even in strict mode.

    Here is the list of how IChatGptSchema is different with the OpenAPI v3.1 JSON schema:

    Compared to OpenApi.IJsonSchema, the emended JSON schema specification:

    For reference, if you compose the IChatGptSchema type with the IChatGptSchema.IConfig.reference false option (default is false), only recursively named types are archived into the IChatGptSchema.IParameters.$defs, and others are escaped from the IChatGptSchema.IReference type.

    Also, OpenAI has banned the following constraint properties. Instead, IChatGptSchema fills the IChatGptSchema.description property with workaround expressions using JSDoc tags like "@format uuid" to convey these constraints:

    Additionally, OpenAI cannot define the IChatGptSchema.description property for the IChatGptSchema.IReference type, and does not understand encapsulation of the IChatGptSchema.IAnyOf type. Therefore, the IChatGptSchema.description is written to the parent object type, not the reference type.

    {
    "type": "object",
    "description": "### Description of {@link something} property.\n\n> Hello?",
    "properties": {
    "something": {
    "$ref": "#/$defs/SomeObject"
    }
    }
    }

    Jeongho Nam - https://github.com/samchon

    Specified not only by official documentation, but also by experimental validation. Therefore, definitions may be inaccurate or change in the future. If you find wrong or outdated definitions, please report via issue.