Skip to main content

BeforeModelCallback

Trait BeforeModelCallback 

Source
pub trait BeforeModelCallback: Send + Sync {
    // Required method
    fn on_before_model(&self, ctx: &ModelCallbackContext);
}
Expand description

Callback invoked before a model call

Use this for:

  • Starting LLM spans
  • Logging model requests
  • Request auditing

Required Methods§

Source

fn on_before_model(&self, ctx: &ModelCallbackContext)

Called before a model call starts

Implementors§