pub struct OutputContract {
pub schema_id: OutputSchemaId,
pub schema_version: SchemaVersion,
pub dialect: OutputSchemaDialect,
pub schema: OutputSchemaRef,
pub mode: OutputMode,
pub validation: ValidationPolicy,
pub repair: RepairPolicy,
pub retry_budget: RetryBudget,
pub content_policy: ContentCapturePolicy,
pub projection_hint: OutputProjectionHint,
}Expand description
Carries the output contract record payload for journal, event, or fixture surfaces. Creating or cloning it only preserves serialized SDK state; append, publish, replay, or export effects are documented on the runtime and port methods that store it.
Fields§
§schema_id: OutputSchemaIdStable schema id used for typed lineage, lookup, or dedupe.
schema_version: SchemaVersionWire schema version used for compatibility checks.
dialect: OutputSchemaDialectSchema dialect used to interpret the output schema. Validators use it to select the supported JSON-schema subset and compatibility rules.
schema: OutputSchemaRefSchema reference or inline schema used to validate structured output. The runtime resolves this before treating model output as typed data.
mode: OutputModeMode that selects how this operation or contract should behave. Callers use it to choose the explicit execution path instead of relying on hidden defaults.
validation: ValidationPolicyValidation policy applied before output is accepted as typed data. It controls validator selection, bounds, failure visibility, and local validation behavior.
repair: RepairPolicyRepair policy used after structured output validation fails. It controls whether repair is attempted and which policy gates must approve it.
retry_budget: RetryBudgetRetry budget for validation, repair, or adapter attempts. Runtimes use it to stop bounded loops deterministically.
content_policy: ContentCapturePolicyContent-capture policy that governs raw content, summaries, redaction, and retention. Projection, telemetry, and delivery paths must honor it before exposing content.
projection_hint: OutputProjectionHintProvider-facing projection hint for structured output requests. It can guide model prompting but does not replace local validation policy.
Implementations§
Source§impl OutputContract
impl OutputContract
Sourcepub fn for_type<T: TypedOutputModel>() -> Self
pub fn for_type<T: TypedOutputModel>() -> Self
Builds the for type value with the documented defaults. This is data-only and does not perform I/O, call host ports, append journals, publish events, or start processes.
Sourcepub fn strict_json_schema<T: TypedOutputModel>() -> Self
pub fn strict_json_schema<T: TypedOutputModel>() -> Self
Returns an updated value with strict json schema configured. This is data-only and does not perform I/O, call host ports, append journals, publish events, or start processes.
Sourcepub fn fast_lenient<T: TypedOutputModel>() -> Self
pub fn fast_lenient<T: TypedOutputModel>() -> Self
Builds the fast lenient value. This is data construction and performs no I/O, journal append, event publication, or process work.
Sourcepub fn provider_assisted<T: TypedOutputModel>() -> Self
pub fn provider_assisted<T: TypedOutputModel>() -> Self
Builds the provider assisted value. This is data construction and performs no I/O, journal append, event publication, or process work.
Sourcepub fn inline_json_schema(
schema_id: OutputSchemaId,
schema_version: SchemaVersion,
redacted_schema: Value,
) -> Self
pub fn inline_json_schema( schema_id: OutputSchemaId, schema_version: SchemaVersion, redacted_schema: Value, ) -> Self
Builds the inline json schema value. This is data construction and performs no I/O, journal append, event publication, or process work.
Sourcepub fn new(
schema_id: OutputSchemaId,
schema_version: SchemaVersion,
dialect: OutputSchemaDialect,
schema: OutputSchemaRef,
preset: OutputPreset,
) -> Self
pub fn new( schema_id: OutputSchemaId, schema_version: SchemaVersion, dialect: OutputSchemaDialect, schema: OutputSchemaRef, preset: OutputPreset, ) -> Self
Creates a new records::output value with explicit caller-provided inputs. This constructor is data-only and performs no I/O or external side effects.
Sourcepub fn schema_fingerprint(&self) -> ContentHash
pub fn schema_fingerprint(&self) -> ContentHash
Computes the stable schema fingerprint for this records::output value. The computation is deterministic and side-effect free so it can be used in package, journal, or test evidence.
Sourcepub fn validate_shape(&self) -> Result<(), AgentError>
pub fn validate_shape(&self) -> Result<(), AgentError>
Validates the records::output invariants and returns a typed error on failure. Validation is pure and does not perform I/O, dispatch, journal appends, or adapter calls.
Trait Implementations§
Source§impl Clone for OutputContract
impl Clone for OutputContract
Source§fn clone(&self) -> OutputContract
fn clone(&self) -> OutputContract
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OutputContract
impl Debug for OutputContract
Source§impl<'de> Deserialize<'de> for OutputContract
impl<'de> Deserialize<'de> for OutputContract
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for OutputContract
Source§impl From<&OutputContract> for OutputContractSnapshot
impl From<&OutputContract> for OutputContractSnapshot
Source§fn from(contract: &OutputContract) -> Self
fn from(contract: &OutputContract) -> Self
Source§impl From<&OutputContract> for ProviderStructuredOutputHint
impl From<&OutputContract> for ProviderStructuredOutputHint
Source§fn from(contract: &OutputContract) -> Self
fn from(contract: &OutputContract) -> Self
Source§impl PartialEq for OutputContract
impl PartialEq for OutputContract
Source§fn eq(&self, other: &OutputContract) -> bool
fn eq(&self, other: &OutputContract) -> bool
self and other values to be equal, and is used by ==.