Skip to main content

BeforeModelCallback

Type Alias BeforeModelCallback 

Source
pub type BeforeModelCallback = Arc<dyn Fn(Context, LlmRequest) -> BoxFuture<'static, (LlmRequest, Result<Option<LlmResponse>, AgentError>)> + Send + Sync>;
Expand description

Called before sending a request to the model. If it returns Some response or an error, the actual model call is skipped and the returned response/error is used. The request (possibly edited) is always handed back.

Aliased Typeยง

pub struct BeforeModelCallback { /* private fields */ }