JsonSchemaFormat class final

Requests JSON output conforming to a specific JSON Schema.

name is a human-readable identifier for the schema (required by the ChatGPT json_schema response format; used in injected instructions for Claude and llamacpp).

schema is a Map<String, dynamic> representing the JSON Schema the model output must conform to.

strict controls whether the model is penalised for deviating from the schema (ChatGPT only; defaults to true).

Inheritance

Constructors

JsonSchemaFormat({required String name, required Map<String, dynamic> schema, bool strict = true})
const

Properties

hashCode int
The hash code for this object.
no setterinherited
name String
A human-readable name for the schema.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
schema Map<String, dynamic>
The JSON Schema the model output must conform to.
final
strict bool
Whether the model should strictly adhere to the schema (ChatGPT only).
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited