Complete assembled validation and migrate remaining tests
This commit is contained in:
@@ -55,7 +55,7 @@ func TestValidationKeepsSuccessfulBatchesAroundUnavailableBatch(t *testing.T) {
|
||||
validator, _ := NewLLMBackedValidator("editorial_review", LLMValidatorTypeEditorialReview)
|
||||
validator.SetTokenEstimator(perItemEstimator{})
|
||||
req := makeReq(candidates)
|
||||
req.Config.Validation.MaxPromptTokens = 150
|
||||
req.Settings.Validation.MaxPromptTokens = 150
|
||||
req.LLMClient = client
|
||||
result, err := validator.Validate(context.Background(), req)
|
||||
if err != nil {
|
||||
@@ -79,7 +79,7 @@ func TestValidationKeepsSuccessfulBatchesAroundUnavailableBatch(t *testing.T) {
|
||||
nextValidator, _ := NewLLMBackedValidator("meaning_reversal_review", LLMValidatorTypeMeaningReversal)
|
||||
nextValidator.SetTokenEstimator(perItemEstimator{})
|
||||
nextReq := makeReq(survivors)
|
||||
nextReq.Config.Validation.MaxPromptTokens = 150
|
||||
nextReq.Settings.Validation.MaxPromptTokens = 150
|
||||
nextReq.LLMClient = nextClient
|
||||
next, err := nextValidator.Validate(context.Background(), nextReq)
|
||||
if err != nil || len(next.Decisions) != 2 || len(nextClient.calls) != 2 || *nextClient.calls[0].Context.BatchIndex != 0 || *nextClient.calls[1].Context.BatchIndex != 1 {
|
||||
@@ -144,7 +144,7 @@ func TestValidationFatalFailureKeepsEarlierFactsAndStops(t *testing.T) {
|
||||
validator, _ := NewLLMBackedValidator("editorial_review", LLMValidatorTypeEditorialReview)
|
||||
validator.SetTokenEstimator(perItemEstimator{})
|
||||
req := makeReq([]proposals.EnrichedCorrectionProposal{mk(0, "gestures", "Jesters"), mk(1, "gestures", "actors"), mk(2, "gestures", "figures")})
|
||||
req.Config.Validation.MaxPromptTokens = 150
|
||||
req.Settings.Validation.MaxPromptTokens = 150
|
||||
req.LLMClient = client
|
||||
result, err := validator.Validate(context.Background(), req)
|
||||
if !errors.Is(err, cause) || len(result.Decisions) != 1 || len(result.Operations) != 2 || len(client.calls) != 2 {
|
||||
|
||||
Reference in New Issue
Block a user