Response validation plugin #351
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
name: Adding response quality validation for retry
about: response quality validation for retryable error
title: "Adding response quality validation for retry"
labels: ''
assignees: ''
Description
For bad rollouts that makes the final output bad which has quality issues, eg, gibberish, repetitions, etc, fail it with this plugin with customizations. Default no-op
Copied from #344 as forked repro has issue of secrets
Type of change
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration.
Test with current tests and added decorator tests
Checklist:
black .,isort .,flake8 .)Screenshots (if applicable)
If applicable, add screenshots to help showcase your changes.
Additional context
Add any other context about the PR here.
Note
Adds ResponseQualityError (code 103) and a pluggable rollout result post-processor that can trigger backoff retries; updates status/exception mappings and tests.
ResponseQualityErrorwith code103; map inSTATUS_CODE_TO_EXCEPTION.Status.Codeand addStatus.response_quality_error()factory.RolloutResultPostProcessorandNoOpRolloutResultPostProcessor; export viapytest.__init__.RolloutProcessorConfigwith optionalpost_processor.evaluation_test_utils.rollout_processor_with_retry; re-raiseResponseQualityErrorto activate retry logic.ResponseQualityErrorinDEFAULT_RETRYABLE_EXCEPTIONS; minor backoff config/type tweaks.ResponseQualityErrorin retryable set.ResponseQualityErrorbehavior.Written by Cursor Bugbot for commit 873828e. This will update automatically on new commits. Configure here.