Skip to main content

BeforeAgentCallback

Type Alias BeforeAgentCallback 

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

Runs before the agent. Some content with no error is yielded as an event and skips the remaining before-agent callbacks, the agent run, and the after-agent callbacks.

An error takes precedence over content, skips the remaining before-agent callbacks, and is yielded as an Err item. If the caller keeps polling, the agent and after-agent callbacks can still run.

Aliased Typeยง

pub struct BeforeAgentCallback { /* private fields */ }