Skip to main content

Interface: ValueContract<T>

Defined in: packages/core/src/runtime/value-contract.ts:22

Type Parameters​

T​

T

Properties​

output​

readonly output: OutputConfig<T>

Defined in: packages/core/src/runtime/value-contract.ts:24

Original Output configuration, retained for transport adapters.


schema​

readonly schema: ZodType<T>

Defined in: packages/core/src/runtime/value-contract.ts:27

Root schema for exactly the value downstream code receives.

Methods​

check()​

check(value): ValueCheck<T>

Defined in: packages/core/src/runtime/value-contract.ts:42

The schema's verdict on a value that is already a value (a finish tool's argument).

Parameters​

value​

unknown

Returns​

ValueCheck<T>


jsonSchema()​

jsonSchema(): JsonSchema

Defined in: packages/core/src/runtime/value-contract.ts:30

Provider-neutral JSON Schema form, computed lazily for backend preparation.

Returns​

JsonSchema


parse()​

parse(candidate): T

Defined in: packages/core/src/runtime/value-contract.ts:39

The value downstream receives for a backend's candidate; throws when the candidate does not satisfy the declared root. A string candidate is the model's text: JSON for an object or array root, the value itself (quoted or not) for a string root. A primitive root also accepts { value }, the object structured output wraps a primitive in.

Parameters​

candidate​

unknown

Returns​

T