ShellTools 允许 Agent 与 shell 交互以运行命令。

示例

以下 Agent 将运行一个 shell 命令,并显示当前目录的内容。

请告知 Agent 您的操作系统,以确保它运行正确的命令。

cookbook/tools/shell_tools.py
from agno.agent import Agent
from agno.tools.shell import ShellTools

agent = Agent(tools=[ShellTools()], show_tool_calls=True)
agent.print_response("Show me the contents of the current directory", markdown=True)

工具包中的函数

FunctionDescription
run_shell_command运行一个 shell 命令并返回输出或错误。

开发者资源