Object type info.

interface IObject {
    additionalProperties?: boolean | ILlmSchemaV3_1;
    deprecated?: boolean;
    description?: string;
    example?: any;
    examples?: Record<string, any>;
    properties: Record<string, ILlmSchemaV3_1>;
    required: string[];
    title?: string;
    type: "object";
}

Hierarchy (View Summary)

Properties

additionalProperties?: boolean | ILlmSchemaV3_1

Additional properties' info.

The additionalProperties means the type schema info of the additional properties that are not listed in the properties.

If the value is true, it means that the additional properties are not restricted. They can be any type. Otherwise, if the value is IOpenAiSchema type, it means that the additional properties must follow the type schema info.

  • true: Record<string, any>
  • IOpenAiSchema: Record<string, T>
deprecated?: boolean

Whether the type is deprecated or not.

description?: string

Detailed description of the schema.

example?: any

Example value.

examples?: Record<string, any>

List of example values as key-value pairs.

properties: Record<string, ILlmSchemaV3_1>

Properties of the object.

The properties means a list of key-value pairs of the object's regular properties. The key is the name of the regular property, and the value is the type schema info.

If you need additional properties that is represented by dynamic key, you can use the additionalProperties instead.

required: string[]

List of key values of the required properties.

The required means a list of the key values of the required properties. If some property key is not listed in the required list, it means that property is optional. Otherwise some property key exists in the required list, it means that the property must be filled.

Below is an example of the properties and required.

interface SomeObject {
id: string;
email: string;
name?: string;
}

As you can see, id and email properties are required, so that they are listed in the required list.

{
"type": "object",
"properties": {
"id": { "type": "string" },
"email": { "type": "string" },
"name": { "type": "string" }
},
"required": ["id", "email"]
}
title?: string

Title of the schema.

type: "object"

Discriminator value of the type.