Expand description
Response quality validation with retry
§Response Quality Gate
QualityGateProvider wraps an inner Box<dyn LlmProvider> and validates
each response against a configurable QualityPolicy. If validation fails,
the request is retried with feedback appended to help the provider correct
its output. After exhausting retries, the last response is returned with
finish_reason set to "quality_gate_exhausted".
§Limitations
- Streaming responses (
complete_stream) are passed through without quality checking, since the full content is not available upfront.
Structs§
- Quality
Gate Provider - Wrapper implementing
LlmProviderthat validates responses and retries on failure. - Quality
Policy - Configurable policy for response quality validation
Enums§
- Quality
Failure - Reason a response failed quality validation