Skip to content

Type Alias: GbnfJsonArraySchema<Defs>

ts
type GbnfJsonArraySchema<Defs> = {
  type: "array";
  items?: GbnfJsonSchema<NoInfer<Defs>>;
  prefixItems?: readonly GbnfJsonSchema<NoInfer<Defs>>[];
  minItems?: number;
  maxItems?: number;
  description?: string;
  $defs?: Defs;
};

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

Type Parameters

Type ParameterDefault type
Defs extends GbnfJsonDefList<NoInfer<Defs>>{ }

Properties

type

ts
readonly type: "array";

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


items?

ts
readonly optional items: GbnfJsonSchema<NoInfer<Defs>>;

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


prefixItems?

ts
readonly optional prefixItems: readonly GbnfJsonSchema<NoInfer<Defs>>[];

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


minItems?

ts
readonly optional minItems: number;

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

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;

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

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;

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

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.


$defs?

ts
readonly optional $defs: Defs;

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