ArtifactDeliveryTool
public class ArtifactDeliveryTool
源码Source
io/agentscope/harness/agent/tool/ArtifactDeliveryTool.java:37–186Artifact Delivery 工具,封装可被智能体调用的能力。位于 io.agentscope.harness.agent.tool 包。核心成员包括 deliverArtifact、ArtifactDeliveryTool。
Agent-callable deliver_artifact tool: downloads a file from the agent filesystem (e.g. a
sandbox workspace) and delegates the transport to a configured ArtifactDeliveryTarget.
This is the supported way for a sandboxed agent to hand an artifact it produced (report,
document, image, archive) to a destination outside the sandbox. It is only registered when an
ArtifactDeliveryTarget is configured on the builder.
构造器摘要Constructor Summary
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public String deliverArtifact(RuntimeContext runtimeContext, String filePath, String fileName, String description, Boolean force) | 执行 `deliverArtifact` 方法。 Performs the deliver artifact operation. |
构造器详情Constructor Detail
ArtifactDeliveryTool
public ArtifactDeliveryTool(AbstractFilesystem filesystem, ArtifactDeliveryTarget target)
初始化 ArtifactDeliveryTool 实例。
Creates a new instance.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
filesystem | AbstractFilesystem | 文件系统(类型 `AbstractFilesystem`)。The filesystem. |
target | ArtifactDeliveryTarget | 目标(类型 `ArtifactDeliveryTarget`)。The target. |
源码Source
io/agentscope/harness/agent/tool/ArtifactDeliveryTool.java:43–45ArtifactDeliveryTool
public ArtifactDeliveryTool(AbstractFilesystem filesystem, WorkspacePathNormalizer pathNormalizer, ArtifactDeliveryTarget target)
初始化 ArtifactDeliveryTool 实例。
Creates a new instance.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
filesystem | AbstractFilesystem | 文件系统(类型 `AbstractFilesystem`)。The filesystem. |
pathNormalizer | WorkspacePathNormalizer | 路径 Normalizer(类型 `WorkspacePathNormalizer`)。The path normalizer. |
target | ArtifactDeliveryTarget | 目标(类型 `ArtifactDeliveryTarget`)。The target. |
源码Source
io/agentscope/harness/agent/tool/ArtifactDeliveryTool.java:47–54方法详情Method Detail
deliverArtifact
public String deliverArtifact(RuntimeContext runtimeContext, String filePath, String fileName, String description, Boolean force)
执行 deliverArtifact 方法。
Performs the deliver artifact operation.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
runtimeContext | RuntimeContext | 运行时上下文(类型 `RuntimeContext`)。per-call agent runtime injected by the framework (not an LLM argument); may be `null` when no merged context is available |
filePath | String | 文件路径(类型 `String`)。path of the generated file in the workspace, e.g. `outputs/report.docx` |
fileName | String | 文件名称(类型 `String`)。target file name after delivery; defaults to the basename of `filePath`. Must be a plain file name: no path separators, `.` or `..` |
description | String | 描述(类型 `String`)。short description of the artifact |
force | Boolean | force(类型 `Boolean`)。if `false` (default) and a file with the same name already exists at the destination, delivery is rejected and the agent should retry with a new `fileName`; set to `true` to overwrite the existing artifact |
String返回字符串结果。Returns a string.
源码Source
io/agentscope/harness/agent/tool/ArtifactDeliveryTool.java:71–165