AS AgentScopeAPI 手册 / API Reference

FileEntry

public class FileEntry extends WorkspaceEntry
源码Source io/agentscope/harness/agent/sandbox/layout/FileEntry.java:21–84

文件条目,承载智能体的部署、调度与服务化运行。位于 io.agentscope.harness.agent.sandbox.layout 包,继承自 WorkspaceEntry。核心成员包括 getContent、setContent、getEncoding、setEncoding、FileEntry。

Layout entry that creates a file with inline text content.

构造器摘要Constructor Summary

构造器Constructor说明Description
public FileEntry()
初始化 `FileEntry` 实例。
Creates an empty file entry.
public FileEntry(String content)
初始化 `FileEntry` 实例。
Creates a file entry with the given content.
public FileEntry(String content, String encoding)
初始化 `FileEntry` 实例。
Creates a file entry with the given content and encoding.

方法摘要Method Summary

方法Method说明Description
public String getContent()
返回文件内容。
Returns the file content.
public void setContent(String content)
设置文件内容。
Sets the file content.
public String getEncoding()
获取 `getEncoding`。
Returns the character encoding used to write this file.
public void setEncoding(String encoding)
设置 `setEncoding`。
Sets the character encoding used to write this file.

构造器详情Constructor Detail

FileEntry

public FileEntry()

初始化 FileEntry 实例。

Creates an empty file entry.

源码Source io/agentscope/harness/agent/sandbox/layout/FileEntry.java:27

FileEntry

public FileEntry(String content)

初始化 FileEntry 实例。

Creates a file entry with the given content.

参数Parameters
名称Name类型Type说明Description
contentString内容(类型 `String`)。the file content as a string
源码Source io/agentscope/harness/agent/sandbox/layout/FileEntry.java:34–36

FileEntry

public FileEntry(String content, String encoding)

初始化 FileEntry 实例。

Creates a file entry with the given content and encoding.

参数Parameters
名称Name类型Type说明Description
contentString内容(类型 `String`)。the file content as a string
encodingStringencoding(类型 `String`)。the character encoding to use when writing the file
源码Source io/agentscope/harness/agent/sandbox/layout/FileEntry.java:44–47

方法详情Method Detail

getContent

public String getContent()

返回文件内容。

Returns the file content.

返回Returns String
返回字符串结果。file content string
源码Source io/agentscope/harness/agent/sandbox/layout/FileEntry.java:54–56

setContent

public void setContent(String content)

设置文件内容。

Sets the file content.

参数Parameters
名称Name类型Type说明Description
contentString内容(类型 `String`)。the file content string
源码Source io/agentscope/harness/agent/sandbox/layout/FileEntry.java:63–65

getEncoding

public String getEncoding()

获取 getEncoding。

Returns the character encoding used to write this file.

返回Returns String
返回字符串结果。encoding name (e.g. "UTF-8")
源码Source io/agentscope/harness/agent/sandbox/layout/FileEntry.java:72–74

setEncoding

public void setEncoding(String encoding)

设置 setEncoding。

Sets the character encoding used to write this file.

参数Parameters
名称Name类型Type说明Description
encodingStringencoding(类型 `String`)。encoding name (e.g. "UTF-8")
源码Source io/agentscope/harness/agent/sandbox/layout/FileEntry.java:81–83

继承成员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.