Expand description
§Response Validator
Validates LLM responses against a set of declarative ValidationRules.
No external regex crate is required; the ValidationRule::MatchesRegex
variant implements simple *-wildcard glob matching internally.
§Quick Start
use tokio_prompt_orchestrator::response_validator::{ResponseValidator, ValidationRule};
let validator = ResponseValidator::new();
let rules = vec![
ValidationRule::MinLength(10),
ValidationRule::MaxLength(500),
ValidationRule::ContainsAll(vec!["Rust".to_string()]),
];
let result = validator.validate("Rust is a systems programming language.", &rules);
assert!(result.passed);Structs§
- Response
Validator - Validates LLM responses against a list of
ValidationRules. - Validation
Result - Aggregate outcome of validating a single response.
- Validation
Violation - A single failed constraint.
Enums§
- Validation
Rule - A single constraint that a response must satisfy.