Skip to main content

Module sleep

Module sleep 

Source
Expand description

The sleep tool: pauses for a bounded number of seconds and stops at once when the call is cancelled.

Structs§

MakeSleepOptions
Options for make_sleep (MakeSleepOptions).
MakeSleepOptionsBuilder
Use builder syntax to set the inputs and finish with build().

Constants§

DEFAULT_MAX_DURATION
The default upper bound on duration, in seconds (DEFAULT_MAX_DURATION).
SLEEP_DESCRIPTION
The description of the default sleep tool (SLEEP_DESCRIPTION), with its 60-second cap.

Functions§

make_sleep
Creates a sleep tool with a configurable cap. The call returns Slept for <duration> seconds, or fails at once when its cancel signal fires.
sleep
The default sleep tool, capped at 60 seconds (sleep).
sleep_description
The model-facing description for a cap of max_duration seconds.