pub trait PostGenerationAnnotationHook: Send + Sync {
// Required methods
fn id(&self) -> &str;
fn annotate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ctx: &'life1 AnnotationContext<'life2>,
) -> Pin<Box<dyn Future<Output = AnnotationResult> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
}Expand description
Async, end-of-message hook that attaches citation annotations to the finalized assistant text.
Required Methods§
Sourcefn annotate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ctx: &'life1 AnnotationContext<'life2>,
) -> Pin<Box<dyn Future<Output = AnnotationResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn annotate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ctx: &'life1 AnnotationContext<'life2>,
) -> Pin<Box<dyn Future<Output = AnnotationResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Produce annotations (and optional text rewrite) for the finalized message. Must fail open (empty result) on any error.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".