Skip to content

feat: extractor hooks #770

@joshua-mo-143

Description

@joshua-mo-143
  • 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.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions