示例
下面的 agent 将使用sleep 工具暂停执行指定的秒数。
cookbook/tools/sleep_tools.py
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
sleep 工具暂停执行指定的秒数。
from agno.agent import Agent
from agno.tools.sleep import SleepTools
# 使用 Sleep 工具创建一个 Agent
agent = Agent(tools=[SleepTools()], name="Sleep Agent")
# 示例 1:暂停 2 秒
agent.print_response("Sleep for 2 seconds")
# 示例 2:暂停更长时间
agent.print_response("Sleep for 5 seconds")
| 参数 | 类型 | 默认值 | 描述 |
|---|---|---|---|
name | str | "sleep" | 工具的名称 |
| 函数 | 描述 |
|---|---|
sleep | 暂停执行指定的秒数 |