pub struct NonInteractiveHooks { /* private fields */ }Expand description
Hooks for non-interactive mode with tool safety policy.
Implementations§
Trait Implementations§
Source§impl AgentHooks for NonInteractiveHooks
impl AgentHooks for NonInteractiveHooks
Source§fn convert_to_llm(
&self,
messages: &[AgentMessage],
) -> Result<Vec<Message>, AgentError>
fn convert_to_llm( &self, messages: &[AgentMessage], ) -> Result<Vec<Message>, AgentError>
Convert agent messages to provider-facing messages.
Source§fn before_tool_call(
&self,
ctx: BeforeToolCallContext,
) -> Pin<Box<dyn Future<Output = BeforeToolCallResult> + Send>>
fn before_tool_call( &self, ctx: BeforeToolCallContext, ) -> Pin<Box<dyn Future<Output = BeforeToolCallResult> + Send>>
Hook called before a tool is executed.
Source§fn after_tool_call(
&self,
_ctx: AfterToolCallContext,
) -> Pin<Box<dyn Future<Output = AfterToolCallResult> + Send>>
fn after_tool_call( &self, _ctx: AfterToolCallContext, ) -> Pin<Box<dyn Future<Output = AfterToolCallResult> + Send>>
Hook called after a tool has been executed.
Source§fn should_stop_after_turn(
&self,
_ctx: ShouldStopAfterTurnContext,
) -> Pin<Box<dyn Future<Output = bool> + Send>>
fn should_stop_after_turn( &self, _ctx: ShouldStopAfterTurnContext, ) -> Pin<Box<dyn Future<Output = bool> + Send>>
Decide whether the loop should stop after this turn.
Source§fn prepare_next_turn(
&self,
_ctx: PrepareNextTurnContext,
) -> Pin<Box<dyn Future<Output = Option<AgentLoopTurnUpdate>> + Send>>
fn prepare_next_turn( &self, _ctx: PrepareNextTurnContext, ) -> Pin<Box<dyn Future<Output = Option<AgentLoopTurnUpdate>> + Send>>
Prepare context before the next turn begins.
Source§fn transform_context(
&self,
messages: Vec<AgentMessage>,
_signal: CancellationToken,
) -> Pin<Box<dyn Future<Output = Result<Vec<AgentMessage>, AgentError>> + Send>>
fn transform_context( &self, messages: Vec<AgentMessage>, _signal: CancellationToken, ) -> Pin<Box<dyn Future<Output = Result<Vec<AgentMessage>, AgentError>> + Send>>
Transform messages before conversion to LLM format.
Auto Trait Implementations§
impl Freeze for NonInteractiveHooks
impl RefUnwindSafe for NonInteractiveHooks
impl Send for NonInteractiveHooks
impl Sync for NonInteractiveHooks
impl Unpin for NonInteractiveHooks
impl UnsafeUnpin for NonInteractiveHooks
impl UnwindSafe for NonInteractiveHooks
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more