pub struct InstructionValidator { /* private fields */ }Expand description
Validator for wizard instructions
Implementations§
Source§impl InstructionValidator
impl InstructionValidator
Sourcepub fn new(skills: SkillsExtractor) -> Self
pub fn new(skills: SkillsExtractor) -> Self
Create a new instruction validator
§Arguments
skills- SkillsExtractor instance for accessing Skills content
§Example
use composio_sdk::wizard::{SkillsExtractor, InstructionValidator};
let skills_path = concat!(env!("CARGO_MANIFEST_DIR"), "/skills");
let skills = SkillsExtractor::new(skills_path);
let validator = InstructionValidator::new(skills);Sourcepub fn validate(
&self,
instructions: &str,
) -> Result<ValidationResult, SkillsError>
pub fn validate( &self, instructions: &str, ) -> Result<ValidationResult, SkillsError>
Validate wizard instructions against Skills best practices
Checks for:
- Anti-patterns (❌ examples) in instructions
- Missing critical rules
- Missing high-priority rules (warnings)
§Arguments
instructions- The wizard instructions to validate
§Returns
A ValidationResult containing errors and warnings
§Example
use composio_sdk::wizard::{SkillsExtractor, InstructionValidator};
let skills_path = concat!(env!("CARGO_MANIFEST_DIR"), "/skills");
let skills = SkillsExtractor::new(skills_path);
let validator = InstructionValidator::new(skills);
let instructions = "let session = client.create_session(\"default\");";
let result = validator.validate(instructions).unwrap();
if !result.is_valid() {
println!("{}", result.format());
}Trait Implementations§
Source§impl Clone for InstructionValidator
impl Clone for InstructionValidator
Source§fn clone(&self) -> InstructionValidator
fn clone(&self) -> InstructionValidator
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for InstructionValidator
impl RefUnwindSafe for InstructionValidator
impl Send for InstructionValidator
impl Sync for InstructionValidator
impl Unpin for InstructionValidator
impl UnsafeUnpin for InstructionValidator
impl UnwindSafe for InstructionValidator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more