rig icon indicating copy to clipboard operation
rig copied to clipboard

feat: extractor hooks

Open joshua-mo-143 opened this issue 3 months ago • 2 comments

  • [x] I have looked for existing issues (including closed) about this

Feature Request

We should have a way to validate that a struct validates all arbitrary requirements without leaving the extractor retry loop.

We should also have a way to add introspection to the extractor (like prompt hooks).

Motivation

Increase DX, observability... etc

Proposal

Something like the below:

trait ExtractorHook: Clone + Send + Sync {
     // .. some methods
}

trait ExtractorValidatorHook: Clone + Send + Sync {
    fn validate() -> impl Future<Output = Result<String, Error>>;
}

I wonder if it would be a good idea for us to attach the error as a tool result back to the conversation if we are unable to meet the requirements.

joshua-mo-143 avatar Sep 01 '25 22:09 joshua-mo-143

I'll be happy to work on this one.

Soroushsrd avatar Sep 01 '25 23:09 Soroushsrd