Sleep

Example

The following agent will use the sleep tool to pause execution for a given number of seconds.

1from kern.agent import Agent
2from kern.tools.sleep import SleepTools
3
4# Create an Agent with the Sleep tool
5agent = Agent(tools=[SleepTools()], name="Sleep Agent")
6
7# Example 1: Sleep for 2 seconds
8agent.print_response("Sleep for 2 seconds")
9
10# Example 2: Sleep for a longer duration
11agent.print_response("Sleep for 5 seconds")

Toolkit Params

ParameterTypeDefaultDescription
enable_sleepboolTrueEnables sleep functionality
allboolFalseEnables all functionality when set to True

Toolkit Functions

FunctionDescription
sleepPauses execution for a specified number of seconds

Developer Resources