#[non_exhaustive]pub struct RunOptions {
pub cancellation: CancellationToken,
pub controls: TurnControls,
}Expand description
Everything one Session::run_with_options call can override. Defaults
(RunOptions::default()) reproduce plain Session::run: an
uncancellable turn on the agent’s default model.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.cancellation: CancellationTokenClone this before calling and cancel the clone from elsewhere to
stop the turn — see CancellationToken.
controls: TurnControlsPer-turn model/reasoning overrides — see TurnControls.
Implementations§
Source§impl RunOptions
impl RunOptions
Sourcepub fn new() -> RunOptions
pub fn new() -> RunOptions
Defaults: uncancellable, on the agent’s own model.
Sourcepub fn cancellation(self, token: CancellationToken) -> RunOptions
pub fn cancellation(self, token: CancellationToken) -> RunOptions
Stop the turn from elsewhere — see CancellationToken.
Sourcepub fn controls(self, controls: TurnControls) -> RunOptions
pub fn controls(self, controls: TurnControls) -> RunOptions
Per-turn model/reasoning overrides — see TurnControls.
Trait Implementations§
Source§impl Default for RunOptions
impl Default for RunOptions
Source§fn default() -> RunOptions
fn default() -> RunOptions
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for RunOptions
impl RefUnwindSafe for RunOptions
impl Send for RunOptions
impl Sync for RunOptions
impl Unpin for RunOptions
impl UnsafeUnpin for RunOptions
impl UnwindSafe for RunOptions
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