RunShellCommandTool
public class RunShellCommandTool extends BaseSandboxTool
源码Source
io/agentscope/runtime/sandbox/tools/base/RunShellCommandTool.java:28–71运行 Shell 命令工具,封装可被智能体调用的能力。位于 io.agentscope.runtime.sandbox.tools.base 包,继承自 BaseSandboxTool。核心成员包括 bind、run_shell_command、RunShellCommandTool。
A class in io.agentscope.runtime.sandbox.tools.base that lets agents invoke external capabilities under control. Declared in io.agentscope.runtime.sandbox.tools.base. Extends BaseSandboxTool.
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public RunShellCommandTool() | 初始化 `RunShellCommandTool` 实例。 Creates a new instance. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public SandboxTool bind(Sandbox sandbox) | 设置该参数。 Performs the bind operation. |
public String run_shell_command(String command) | 运行 `run_shell_command`。 Runs the shell command. |
构造器详情Constructor Detail
RunShellCommandTool
public RunShellCommandTool()
初始化 RunShellCommandTool 实例。
Creates a new instance.
源码Source
io/agentscope/runtime/sandbox/tools/base/RunShellCommandTool.java:32–48方法详情Method Detail
bind
public SandboxTool bind(Sandbox sandbox)
设置该参数。
Performs the bind operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
sandbox | Sandbox | 沙箱(类型 `Sandbox`)。The sandbox. |
SandboxTool返回SandboxTool。Returns sandbox tool.
源码Source
io/agentscope/runtime/sandbox/tools/base/RunShellCommandTool.java:50–54run_shell_command
public String run_shell_command(String command)
运行 run_shell_command。
Runs the shell command.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
command | String | 命令(类型 `String`)。The command. |
String返回字符串结果。Returns a string.
源码Source
io/agentscope/runtime/sandbox/tools/base/RunShellCommandTool.java:56–70