pub struct AgentCall<O> {
pub input: AgentInput,
pub options: O,
pub cancellation: CancellationToken,
pub timeout: Option<Timeout>,
pub hooks: Hooks,
pub sandbox: Option<Arc<dyn Sandbox>>,
}Expand description
Parameters of one agent call.
Fields§
§input: AgentInputThe input.
options: OPer-call options.
cancellation: CancellationTokenCancels the call.
timeout: Option<Timeout>Overrides the agent’s timeouts when set.
hooks: HooksHooks invoked after the agent’s own hooks, then awaited concurrently.
sandbox: Option<Arc<dyn Sandbox>>Sandbox passed to tools.
Implementations§
Source§impl<O> AgentCall<O>
impl<O> AgentCall<O>
Sourcepub fn cancellation(self, token: CancellationToken) -> Self
pub fn cancellation(self, token: CancellationToken) -> Self
Sets the cancellation token.
Sourcepub fn hooks(self, hooks: Hooks) -> Self
pub fn hooks(self, hooks: Hooks) -> Self
Adds hooks (invoked after the agent’s hooks, awaited concurrently).
Sourcepub fn on_step_end(self, f: impl HookFn<StepResult>) -> Self
pub fn on_step_end(self, f: impl HookFn<StepResult>) -> Self
Adds a step-end hook.
Sourcepub fn streaming(self) -> AgentStreamCall<O>
pub fn streaming(self) -> AgentStreamCall<O>
Converts into a streaming call.
Trait Implementations§
Auto Trait Implementations§
impl<O> !RefUnwindSafe for AgentCall<O>
impl<O> !UnwindSafe for AgentCall<O>
impl<O> Freeze for AgentCall<O>where
O: Freeze,
impl<O> Send for AgentCall<O>where
O: Send,
impl<O> Sync for AgentCall<O>where
O: Sync,
impl<O> Unpin for AgentCall<O>where
O: Unpin,
impl<O> UnsafeUnpin for AgentCall<O>where
O: UnsafeUnpin,
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