Skip to main content

make_sleep

Function make_sleep 

Source
pub fn make_sleep(options: MakeSleepOptions) -> Result<FunctionTool>
Expand description

Creates a sleep tool with a configurable cap. The call returns Slept for <duration> seconds, or fails at once when its cancel signal fires.

use strands::vended_tools::sleep::{MakeSleepOptions, make_sleep};

let short_sleep = make_sleep(MakeSleepOptions::builder().max_duration(5.0).build())?;
assert!(strands::Tool::description(&short_sleep).contains("max 5"));

ยงErrors

When max_duration is not a positive finite number.