Skip to content
docsv0.42.1

StructuredOutput

A finite scalar-object format request; it declares shape, never expected values or truth.

StructuredOutput::__construct()

public function __construct(string $name, array $fields):

All named fields are required; nested schemas, constants and extra fields are unsupported.

Parameters

Parameters of __construct()
NameTypeDescription
$namestring
$fieldsarray<string, mixed>Raw scalar-type declarations, validated here (at most 64 fields).

StructuredOutput::toArray()

public function toArray(): array

The explicit OpenAI-compatible wire format, with no prompt or answer values.