ArraySchema

org.llm4s.toolapi.ArraySchema
case class ArraySchema[A](description: String, itemSchema: SchemaDefinition[A], minItems: Option[Int], maxItems: Option[Int], uniqueItems: Boolean) extends SchemaDefinition[Seq[A]]

Array schema with item type and size constraints.

Value parameters

description

Human-readable description shown to the LLM

itemSchema

Schema applied to every element of the array

maxItems

Maximum number of elements (inclusive)

minItems

Minimum number of elements (inclusive)

uniqueItems

When true, all elements must be distinct

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait SchemaDefinition[Seq[A]]
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

def toJsonSchema(strict: Boolean): Value

Serialise this schema to a JSON Schema ujson.Value.

Serialise this schema to a JSON Schema ujson.Value.

Value parameters

strict

When true, all object properties are treated as required, matching OpenAI strict-mode tool definitions.

Attributes

def withSizeConstraints(min: Option[Int], max: Option[Int]): ArraySchema[A]

Add minimum and/or maximum array size constraints.

Add minimum and/or maximum array size constraints.

Value parameters

max

Optional maximum number of items

min

Optional minimum number of items

Attributes

def withUniqueItems(unique: Boolean): ArraySchema[A]

Require all array elements to be unique.

Require all array elements to be unique.

Value parameters

unique

true to enforce uniqueness (default)

Attributes

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product