AS AgentScopeAPI 手册 / API Reference

DirEntry

public class DirEntry extends WorkspaceEntry
源码Source io/agentscope/harness/agent/sandbox/layout/DirEntry.java:27–72

目录条目,承载智能体的部署、调度与服务化运行。位于 io.agentscope.harness.agent.sandbox.layout 包,继承自 WorkspaceEntry。核心成员包括 getChildren、setChildren、child、DirEntry。

Layout entry that creates a directory, optionally with nested child entries.

Child entries are a map of filename to WorkspaceEntry and may themselves be nested DirEntry instances, enabling recursive tree-like workspace structures.

构造器摘要Constructor Summary

构造器Constructor说明Description
public DirEntry()
初始化 `DirEntry` 实例。
Creates an empty directory entry.
public DirEntry(Map<String, WorkspaceEntry> children)
初始化 `DirEntry` 实例。
Creates a directory entry with the given children.

方法摘要Method Summary

方法Method说明Description
public Map<String, WorkspaceEntry> getChildren()
返回子级条目 in 此目录。
Returns the child entries in this directory.
public void setChildren(Map<String, WorkspaceEntry> children)
设置子级条目用于此目录。
Sets the child entries for this directory.
public DirEntry child(String name, WorkspaceEntry entry)
执行子级相关操作。
Adds a child entry to this directory.

构造器详情Constructor Detail

DirEntry

public DirEntry()

初始化 DirEntry 实例。

Creates an empty directory entry.

源码Source io/agentscope/harness/agent/sandbox/layout/DirEntry.java:32

DirEntry

public DirEntry(Map<String, WorkspaceEntry> children)

初始化 DirEntry 实例。

Creates a directory entry with the given children.

参数Parameters
名称Name类型Type说明Description
childrenMap<String, WorkspaceEntry>子级名称到子级条目的映射。map of child name to child entry
源码Source io/agentscope/harness/agent/sandbox/layout/DirEntry.java:39–41

方法详情Method Detail

getChildren

public Map<String, WorkspaceEntry> getChildren()

返回子级条目 in 此目录。

Returns the child entries in this directory.

返回Returns Map<String, WorkspaceEntry>
子级名称到子级条目的可变映射。mutable map of child name to child entry
源码Source io/agentscope/harness/agent/sandbox/layout/DirEntry.java:48–50

setChildren

public void setChildren(Map<String, WorkspaceEntry> children)

设置子级条目用于此目录。

Sets the child entries for this directory.

参数Parameters
名称Name类型Type说明Description
childrenMap<String, WorkspaceEntry>子级名称到子级条目的映射。map of child name to child entry
源码Source io/agentscope/harness/agent/sandbox/layout/DirEntry.java:57–59

child

public DirEntry child(String name, WorkspaceEntry entry)

执行子级相关操作。

Adds a child entry to this directory.

参数Parameters
名称Name类型Type说明Description
nameString名称(类型 `String`)。child filename
entryWorkspaceEntry条目(类型 `WorkspaceEntry`)。child entry
返回Returns DirEntry
返回DirEntry。this instance for chaining
源码Source io/agentscope/harness/agent/sandbox/layout/DirEntry.java:68–71

继承成员Inherited Members

继承自Methods inherited from WorkspaceEntry
基于官方固定版本源码静态生成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.