Preserve native validation failure details
This commit is contained in:
@@ -64,8 +64,7 @@ func RunProducer[T any](
|
||||
failure = canceled
|
||||
return
|
||||
}
|
||||
if result == nil || result.Validation.Status == promptkit.ValidationFailed || !result.Validation.IsValid {
|
||||
failure = fmt.Errorf("%w: producer output did not satisfy its native contract", promptkit.ErrValidation)
|
||||
if failure = CheckNativeResult(result, nil); failure != nil {
|
||||
return
|
||||
}
|
||||
candidate, guidance, failure = interpret(ctx, result)
|
||||
@@ -181,7 +180,7 @@ func RunProducer[T any](
|
||||
return zero, contracts.ProducerOutcome{}, canceled
|
||||
}
|
||||
if err != nil {
|
||||
failure = err
|
||||
failure = CheckNativeResult(result, err)
|
||||
} else {
|
||||
evaluate(result)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user