Skip to content

Type Alias: GbnfJsonArraySchema

ts
type GbnfJsonArraySchema = {
  type: "array";
  items: GbnfJsonSchema;
  prefixItems: readonly GbnfJsonSchema[];
  minItems: number;
  maxItems: number;
  description: string;
};

Defined in: utils/gbnfJson/types.ts:126

Type declaration

type

ts
readonly type: "array";

items?

ts
readonly optional items: GbnfJsonSchema;

prefixItems?

ts
readonly optional prefixItems: readonly GbnfJsonSchema[];

minItems?

ts
readonly optional minItems: number;

When using minItems and/or maxItems, ensure to inform the model as part of the prompt what your expectations are regarding the length of the array. Not doing this may lead to hallucinations.

maxItems?

ts
readonly optional maxItems: number;

When using minItems and/or maxItems, ensure to inform the model as part of the prompt what your expectations are regarding the length of the array. Not doing this may lead to hallucinations.

description?

ts
readonly optional description: string;

A description of what you expect the model to set this value to.

Only passed to the model when using function calling, and has no effect when using JSON Schema grammar directly.