Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FSValidator ¶
type FSValidator struct {
// contains filtered or unexported fields
}
func (*FSValidator) PrepareValidation ¶ added in v0.4.0
func (v *FSValidator) PrepareValidation(ctx context.Context, contract domain.OutputContract) (PreparedValidation, error)
func (*FSValidator) Validate ¶
func (v *FSValidator) Validate(ctx context.Context, artifact *domain.Artifact, contract domain.OutputContract) (domain.ValidationResult, error)
type PreparedValidation ¶ added in v0.4.0
type PreparedValidation interface {
Validate(ctx context.Context, artifact *domain.Artifact) (domain.ValidationResult, error)
// SchemaDocument returns the root JSON Schema document used for provider
// structured output, or nil for non-schema modes. Returned internal
// immutable state must not be mutated.
SchemaDocument() any
}
PreparedValidation validates artifacts against one frozen output contract. Its cancellation boundary is synchronous: Validate does not detach schema execution, and an observed context error prevents publication of a result.
type StandardValidator ¶
type StandardValidator struct {
// contains filtered or unexported fields
}
StandardValidator provides basic, JSON, and JSON Schema output validation.
func (*StandardValidator) PrepareValidation ¶ added in v0.4.0
func (v *StandardValidator) PrepareValidation(ctx context.Context, contract domain.OutputContract) (PreparedValidation, error)
func (*StandardValidator) Validate ¶
func (v *StandardValidator) Validate(ctx context.Context, artifact *domain.Artifact, contract domain.OutputContract) (domain.ValidationResult, error)
type ValidationPreparer ¶ added in v0.4.0
type ValidationPreparer interface {
PrepareValidation(ctx context.Context, contract domain.OutputContract) (PreparedValidation, error)
}
ValidationPreparer freezes validation resources for one output contract. Preparation reads schemas in context-checked chunks and checks ctx around decoding and compilation. Filesystem and compiler calls remain synchronous, so cancellation becomes authoritative when an in-progress call returns.
type Validator ¶
type Validator interface {
Validate(ctx context.Context, artifact *domain.Artifact, contract domain.OutputContract) (domain.ValidationResult, error)
}
Validator validates the generated artifact based on the output contract. Validation checks ctx around Promptkit-controlled work and synchronous dependency calls. A dependency call already in progress cannot be preempted; after it returns, cancellation takes precedence over its result.