Document shared configuration and repair defaults
This commit is contained in:
27
types.go
27
types.go
@@ -492,8 +492,8 @@ type ExecutionTargetPresence struct {
|
||||
|
||||
// OutputContract describes resolved output and validation requirements.
|
||||
//
|
||||
// A non-nil RunRequest.Validation replaces the complete prompt contract. It
|
||||
// does not merge fields. The public Engine performs bounded correction after a
|
||||
// A non-nil RunRequest.Validation input replaces the complete prompt contract.
|
||||
// The public Engine performs bounded correction after a
|
||||
// failed eligible validation when RepairAttempts is positive. A JSON Schema
|
||||
// request replacement requires exactly one of Schema and SchemaPath; other
|
||||
// modes ignore them. A replacement uses the prompt's configured root for
|
||||
@@ -519,15 +519,24 @@ type OutputContract struct {
|
||||
RepairAttempts int `json:"repair_attempts"`
|
||||
}
|
||||
|
||||
// OutputContractInput replaces a prompt's complete output contract. An omitted
|
||||
// repair budget defaults to one for active validation and zero for none;
|
||||
// an explicit zero disables repair. Schema selection follows OutputContract.
|
||||
// OutputContractInput replaces a prompt's complete output contract without
|
||||
// merging fields. A nil repair budget defaults to one for basic, json, and
|
||||
// json_schema validation, or zero for none; an explicit zero disables repair.
|
||||
// The budget is resolved independently of the prompt's configured budget.
|
||||
// Each repair can add a generation call, latency, and usage and may still fail.
|
||||
// Schema selection follows OutputContract. Empty Format defaults to text;
|
||||
// ValidationMode must be set. Valid budgets range from zero to three.
|
||||
type OutputContractInput struct {
|
||||
Format OutputFormat `json:"format"`
|
||||
// Format selects artifact metadata; empty defaults to text.
|
||||
Format OutputFormat `json:"format"`
|
||||
// ValidationMode selects the content check and is required.
|
||||
ValidationMode ValidationMode `json:"validation_mode"`
|
||||
Schema any `json:"schema,omitempty"`
|
||||
SchemaPath string `json:"schema_path"`
|
||||
RepairAttempts *int `json:"repair_attempts,omitempty"`
|
||||
// Schema is an inline JSON Schema selected for json_schema mode.
|
||||
Schema any `json:"schema,omitempty"`
|
||||
// SchemaPath selects a schema under the prompt's configured root.
|
||||
SchemaPath string `json:"schema_path"`
|
||||
// RepairAttempts is an optional additional generation-call budget.
|
||||
RepairAttempts *int `json:"repair_attempts,omitempty"`
|
||||
}
|
||||
|
||||
// ValidationResult represents a completed output check and has a stable JSON
|
||||
|
||||
Reference in New Issue
Block a user