AS AgentScopeAPI 手册 / API Reference

LocalHandsToolExecutor

public final class LocalHandsToolExecutor
源码Source io/agentscope/builder/web/managed/selfhosted/LocalHandsToolExecutor.java:37–393

本地 Hands 工具执行器,承载智能体的部署、调度与服务化运行。位于 io.agentscope.builder.web.managed.selfhosted 包。核心成员包括 workDir、execute、LocalHandsToolExecutor。

Executes the self-hosted hands toolset against a local workspace directory. Used by both the standalone HandsWorkerMain and the in-process development worker.

嵌套类摘要Nested Class Summary

类Class类型Kind说明Description
ToolExecResult记录record
承载工具 Exec 结果数据的记录类型。
Result of a local hands tool execution.

构造器摘要Constructor Summary

构造器Constructor说明Description
public LocalHandsToolExecutor(Path workDir)
初始化 `LocalHandsToolExecutor` 实例。
Creates a new instance.

方法摘要Method Summary

方法Method说明Description
public Path workDir()
用于此会话的工作区根。
Workspace root for this session.
public ToolExecResult execute(String name, Map<String, Object> input)
执行执行相关操作。
Runs one tool call and returns a textual result suitable for `user.tool_result` content.

构造器详情Constructor Detail

LocalHandsToolExecutor

public LocalHandsToolExecutor(Path workDir)

初始化 LocalHandsToolExecutor 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
workDirPathwork 目录(类型 `Path`)。The work dir.
源码Source io/agentscope/builder/web/managed/selfhosted/LocalHandsToolExecutor.java:46–48

方法详情Method Detail

workDir

public Path workDir()

用于此会话的工作区根。

Workspace root for this session.

返回Returns Path
返回路径。Returns path.
源码Source io/agentscope/builder/web/managed/selfhosted/LocalHandsToolExecutor.java:51–53

execute

public ToolExecResult execute(String name, Map<String, Object> input)

执行执行相关操作。

Runs one tool call and returns a textual result suitable for user.tool_result content.

参数Parameters
名称Name类型Type说明Description
nameString名称(类型 `String`)。The name.
inputMap<String, Object>输入消息(类型 `Map`)。The input.
返回Returns ToolExecResult
返回ToolExecResult。Returns tool exec result.
源码Source io/agentscope/builder/web/managed/selfhosted/LocalHandsToolExecutor.java:59–76

嵌套类详情Nested Class Detail

ToolExecResult

public record ToolExecResult(String content, boolean error)

承载工具 Exec 结果数据的记录类型。位于 io.agentscope.builder.web.managed.selfhosted 包。核心成员包括 content、error。

Result of a local hands tool execution.

基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.