AS AgentScopeAPI 手册 / API Reference

AgentEntity

@Entity @Table( name = "builder_agent", uniqueConstraints = @UniqueConstraint( name = "ux_builder_agent_owner_agent", columnNames = {"owner_id", "agent_id"}), indexes = { @Index(name = "ix_builder_agent_owner", columnList = "owner_id"), @Index(name = "ix_builder_agent_agent_id", columnList = "agent_id") }) public class AgentEntity
源码Source io/agentscope/builder/web/persistence/jpa/AgentEntity.java:60–433

智能体 Entity,在多次调用之间保存和恢复会话与记忆数据。位于 io.agentscope.builder.web.persistence.jpa 包。核心成员包括 getRowId、setRowId、getOwnerId、setOwnerId、getAgentId、setAgentId。

Persistent representation of a user-custom agent definition. Keyed by the synthetic row_id and uniquely identified by the (owner_id, agent_id) pair.

Relationship to the user table

owner_id is a soft foreign key to UserEntity#getUserId(). JPA does not manage cascading deletes; the application-level io.agentscope.builder.web.api.AdminUserController#delete flow takes responsibility for revoking grants and removing the agents owned by a deleted user. The schema keeps owner_id as an indexed plain column so deployments may add a database-level FOREIGN KEY ... ON DELETE CASCADE via migration scripts when desired.

Storage layout

  • Scalar metadata (name, description, model, runAs, ...) lives in dedicated columns.

  • List-shaped settings (tools allow/deny, skills allow/deny, group-chat mention patterns) are persisted as JSON strings in a single column each. This keeps the schema portable across MySQL / PostgreSQL / H2 without introducing per-list join tables for what are effectively bounded configuration lists, and matches the wire format used by the JSON-file backend so migration in either direction is straightforward.

  • AgentShareEntity is mapped as a one-to-many relationship with orphanRemoval = true; updates to the shares list replace the whole collection atomically inside one transaction.

构造器摘要Constructor Summary

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

方法摘要Method Summary

方法Method说明Description
public Long getRowId()
获取 `getRowId`。
Returns the row id.
public void setRowId(Long rowId)
设置 `setRowId`。
Sets the row id.
public String getOwnerId()
获取所有者标识。
Returns the owner id.
public void setOwnerId(String ownerId)
设置所有者标识。
Sets the owner id.
public String getAgentId()
获取智能体标识。
Returns the agent id.
public void setAgentId(String agentId)
设置智能体标识。
Sets the agent id.
public String getWorkspacePath()
获取工作区路径。
Returns the workspace path.
public void setWorkspacePath(String workspacePath)
设置工作区路径。
Sets the workspace path.
public String getName()
获取名称。
Returns the name.
public void setName(String name)
设置名称。
Sets the name.
public String getDescription()
获取 `getDescription`。
Returns the description.
public void setDescription(String description)
设置 `setDescription`。
Sets the description.
public String getSysPrompt()
获取 `getSysPrompt`。
Returns the sys prompt.
public void setSysPrompt(String sysPrompt)
设置 `setSysPrompt`。
Sets the sys prompt.
public String getModel()
获取模型。
Returns the model.
public void setModel(String model)
设置模型。
Sets the model.
public Integer getMaxIters()
获取最大迭代次数。
Returns the max iters.
public void setMaxIters(Integer maxIters)
设置最大迭代次数。
Sets the max iters.
public String getToolsJson()
获取工具 JSON。
Returns the tools json.
public void setToolsJson(String toolsJson)
设置工具 JSON。
Sets the tools json.
public String getMcpServersJson()
获取 `getMcpServersJson`。
Returns the mcp servers json.
public void setMcpServersJson(String mcpServersJson)
设置 `setMcpServersJson`。
Sets the mcp servers json.
public String getIdentityName()
获取身份名称。
Returns the identity name.
public void setIdentityName(String identityName)
设置身份名称。
Sets the identity name.
public String getIdentityEmoji()
获取 `getIdentityEmoji`。
Returns the identity emoji.
public void setIdentityEmoji(String identityEmoji)
设置 `setIdentityEmoji`。
Sets the identity emoji.
public String getGroupChatMentionPatternsJson()
获取 `getGroupChatMentionPatternsJson`。
Returns the group chat mention patterns json.
public void setGroupChatMentionPatternsJson(String groupChatMentionPatternsJson)
设置 `setGroupChatMentionPatternsJson`。
Sets the group chat mention patterns json.
public Boolean getGroupChatRequireMention()
获取 `getGroupChatRequireMention`。
Returns the group chat require mention.
public void setGroupChatRequireMention(Boolean groupChatRequireMention)
设置 `setGroupChatRequireMention`。
Sets the group chat require mention.
public String getSkillsJson()
获取技能 JSON。
Returns the skills json.
public void setSkillsJson(String skillsJson)
设置技能 JSON。
Sets the skills json.
public String getMultiagentJson()
获取多智能体 JSON。
Returns the multiagent json.
public void setMultiagentJson(String multiagentJson)
设置多智能体 JSON。
Sets the multiagent json.
public String getRunAs()
获取运行 As。
Returns the run as.
public void setRunAs(String runAs)
设置运行 As。
Sets the run as.
public String getForkOf()
获取 `getForkOf`。
Returns the fork of.
public void setForkOf(String forkOf)
设置 `setForkOf`。
Sets the fork of.
public String getSkillRepositoriesJson()
获取 `getSkillRepositoriesJson`。
Returns the skill repositories json.
public void setSkillRepositoriesJson(String skillRepositoriesJson)
设置 `setSkillRepositoriesJson`。
Sets the skill repositories json.
public String getSandboxMode()
获取沙箱模式。
Returns the sandbox mode.
public void setSandboxMode(String sandboxMode)
设置沙箱模式。
Sets the sandbox mode.
public String getSandboxScope()
获取沙箱范围。
Returns the sandbox scope.
public void setSandboxScope(String sandboxScope)
设置沙箱范围。
Sets the sandbox scope.
public int getHeadVersion()
获取 `getHeadVersion`。
Returns the head version.
public void setHeadVersion(int headVersion)
设置 `setHeadVersion`。
Sets the head version.
public Long getArchivedAt()
获取 `getArchivedAt`。
Returns the archived at.
public void setArchivedAt(Long archivedAt)
设置 `setArchivedAt`。
Sets the archived at.
public String getPermissionPoliciesJson()
获取 `getPermissionPoliciesJson`。
Returns the permission policies json.
public void setPermissionPoliciesJson(String permissionPoliciesJson)
设置 `setPermissionPoliciesJson`。
Sets the permission policies json.
public long getCreatedAt()
获取已创建 At。
Returns the created at.
public void setCreatedAt(long createdAt)
设置已创建 At。
Sets the created at.
public long getUpdatedAt()
获取已更新 At。
Returns the updated at.
public void setUpdatedAt(long updatedAt)
设置已更新 At。
Sets the updated at.
public List<AgentShareEntity> getShares()
获取 `getShares`。
Returns the shares.
public void setShares(List<AgentShareEntity> shares)
设置 `setShares`。
Sets the shares.

构造器详情Constructor Detail

AgentEntity

public AgentEntity()

初始化 AgentEntity 实例。

Creates a new instance.

源码Source io/agentscope/builder/web/persistence/jpa/AgentEntity.java:208

方法详情Method Detail

getRowId

public Long getRowId()

获取 getRowId。

Returns the row id.

返回Returns Long
返回数值结果。Returns a numeric result.
源码Source io/agentscope/builder/web/persistence/jpa/AgentEntity.java:210–212

setRowId

public void setRowId(Long rowId)

设置 setRowId。

Sets the row id.

参数Parameters
名称Name类型Type说明Description
rowIdLongrow 标识(类型 `Long`)。The row id.
源码Source io/agentscope/builder/web/persistence/jpa/AgentEntity.java:214–216

getOwnerId

public String getOwnerId()

获取所有者标识。

Returns the owner id.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/builder/web/persistence/jpa/AgentEntity.java:218–220

setOwnerId

public void setOwnerId(String ownerId)

设置所有者标识。

Sets the owner id.

参数Parameters
名称Name类型Type说明Description
ownerIdString所有者标识(类型 `String`)。The owner id.
源码Source io/agentscope/builder/web/persistence/jpa/AgentEntity.java:222–224

getAgentId

public String getAgentId()

获取智能体标识。

Returns the agent id.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/builder/web/persistence/jpa/AgentEntity.java:226–228

setAgentId

public void setAgentId(String agentId)

设置智能体标识。

Sets the agent id.

参数Parameters
名称Name类型Type说明Description
agentIdString智能体标识(类型 `String`)。The agent id.
源码Source io/agentscope/builder/web/persistence/jpa/AgentEntity.java:230–232

getWorkspacePath

public String getWorkspacePath()

获取工作区路径。

Returns the workspace path.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/builder/web/persistence/jpa/AgentEntity.java:234–236

setWorkspacePath

public void setWorkspacePath(String workspacePath)

设置工作区路径。

Sets the workspace path.

参数Parameters
名称Name类型Type说明Description
workspacePathString工作区路径(类型 `String`)。The workspace path.
源码Source io/agentscope/builder/web/persistence/jpa/AgentEntity.java:238–240

getName

public String getName()

获取名称。

Returns the name.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/builder/web/persistence/jpa/AgentEntity.java:242–244

setName

public void setName(String name)

设置名称。

Sets the name.

参数Parameters
名称Name类型Type说明Description
nameString名称(类型 `String`)。The name.
源码Source io/agentscope/builder/web/persistence/jpa/AgentEntity.java:246–248

getDescription

public String getDescription()

获取 getDescription。

Returns the description.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/builder/web/persistence/jpa/AgentEntity.java:250–252

setDescription

public void setDescription(String description)

设置 setDescription。

Sets the description.

参数Parameters
名称Name类型Type说明Description
descriptionString描述(类型 `String`)。The description.
源码Source io/agentscope/builder/web/persistence/jpa/AgentEntity.java:254–256

getSysPrompt

public String getSysPrompt()

获取 getSysPrompt。

Returns the sys prompt.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/builder/web/persistence/jpa/AgentEntity.java:258–260

setSysPrompt

public void setSysPrompt(String sysPrompt)

设置 setSysPrompt。

Sets the sys prompt.

参数Parameters
名称Name类型Type说明Description
sysPromptStringsys 提示词(类型 `String`)。The sys prompt.
源码Source io/agentscope/builder/web/persistence/jpa/AgentEntity.java:262–264

getModel

public String getModel()

获取模型。

Returns the model.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/builder/web/persistence/jpa/AgentEntity.java:266–268

setModel

public void setModel(String model)

设置模型。

Sets the model.

参数Parameters
名称Name类型Type说明Description
modelString模型实例(类型 `String`)。The model.
源码Source io/agentscope/builder/web/persistence/jpa/AgentEntity.java:270–272

getMaxIters

public Integer getMaxIters()

获取最大迭代次数。

Returns the max iters.

返回Returns Integer
返回数值结果。Returns a numeric result.
源码Source io/agentscope/builder/web/persistence/jpa/AgentEntity.java:274–276

setMaxIters

public void setMaxIters(Integer maxIters)

设置最大迭代次数。

Sets the max iters.

参数Parameters
名称Name类型Type说明Description
maxItersInteger最大迭代次数(类型 `Integer`)。The max iters.
源码Source io/agentscope/builder/web/persistence/jpa/AgentEntity.java:278–280

getToolsJson

public String getToolsJson()

获取工具 JSON。

Returns the tools json.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/builder/web/persistence/jpa/AgentEntity.java:282–284

setToolsJson

public void setToolsJson(String toolsJson)

设置工具 JSON。

Sets the tools json.

参数Parameters
名称Name类型Type说明Description
toolsJsonString工具 JSON(类型 `String`)。The tools json.
源码Source io/agentscope/builder/web/persistence/jpa/AgentEntity.java:286–288

getMcpServersJson

public String getMcpServersJson()

获取 getMcpServersJson。

Returns the mcp servers json.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/builder/web/persistence/jpa/AgentEntity.java:290–292

setMcpServersJson

public void setMcpServersJson(String mcpServersJson)

设置 setMcpServersJson。

Sets the mcp servers json.

参数Parameters
名称Name类型Type说明Description
mcpServersJsonStringMCP Servers JSON(类型 `String`)。The mcp servers json.
源码Source io/agentscope/builder/web/persistence/jpa/AgentEntity.java:294–296

getIdentityName

public String getIdentityName()

获取身份名称。

Returns the identity name.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/builder/web/persistence/jpa/AgentEntity.java:298–300

setIdentityName

public void setIdentityName(String identityName)

设置身份名称。

Sets the identity name.

参数Parameters
名称Name类型Type说明Description
identityNameString身份名称(类型 `String`)。The identity name.
源码Source io/agentscope/builder/web/persistence/jpa/AgentEntity.java:302–304

getIdentityEmoji

public String getIdentityEmoji()

获取 getIdentityEmoji。

Returns the identity emoji.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/builder/web/persistence/jpa/AgentEntity.java:306–308

setIdentityEmoji

public void setIdentityEmoji(String identityEmoji)

设置 setIdentityEmoji。

Sets the identity emoji.

参数Parameters
名称Name类型Type说明Description
identityEmojiString身份 Emoji(类型 `String`)。The identity emoji.
源码Source io/agentscope/builder/web/persistence/jpa/AgentEntity.java:310–312

getGroupChatMentionPatternsJson

public String getGroupChatMentionPatternsJson()

获取 getGroupChatMentionPatternsJson。

Returns the group chat mention patterns json.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/builder/web/persistence/jpa/AgentEntity.java:314–316

setGroupChatMentionPatternsJson

public void setGroupChatMentionPatternsJson(String groupChatMentionPatternsJson)

设置 setGroupChatMentionPatternsJson。

Sets the group chat mention patterns json.

参数Parameters
名称Name类型Type说明Description
groupChatMentionPatternsJsonString组聊天 Mention Patterns JSON(类型 `String`)。The group chat mention patterns json.
源码Source io/agentscope/builder/web/persistence/jpa/AgentEntity.java:318–320

getGroupChatRequireMention

public Boolean getGroupChatRequireMention()

获取 getGroupChatRequireMention。

Returns the group chat require mention.

返回Returns Boolean
返回布尔值,表示判断结果。Returns a boolean result.
源码Source io/agentscope/builder/web/persistence/jpa/AgentEntity.java:322–324

setGroupChatRequireMention

public void setGroupChatRequireMention(Boolean groupChatRequireMention)

设置 setGroupChatRequireMention。

Sets the group chat require mention.

参数Parameters
名称Name类型Type说明Description
groupChatRequireMentionBoolean组聊天 Require Mention(类型 `Boolean`)。The group chat require mention.
源码Source io/agentscope/builder/web/persistence/jpa/AgentEntity.java:326–328

getSkillsJson

public String getSkillsJson()

获取技能 JSON。

Returns the skills json.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/builder/web/persistence/jpa/AgentEntity.java:330–332

setSkillsJson

public void setSkillsJson(String skillsJson)

设置技能 JSON。

Sets the skills json.

参数Parameters
名称Name类型Type说明Description
skillsJsonString技能 JSON(类型 `String`)。The skills json.
源码Source io/agentscope/builder/web/persistence/jpa/AgentEntity.java:334–336

getMultiagentJson

public String getMultiagentJson()

获取多智能体 JSON。

Returns the multiagent json.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/builder/web/persistence/jpa/AgentEntity.java:338–340

setMultiagentJson

public void setMultiagentJson(String multiagentJson)

设置多智能体 JSON。

Sets the multiagent json.

参数Parameters
名称Name类型Type说明Description
multiagentJsonString多智能体 JSON(类型 `String`)。The multiagent json.
源码Source io/agentscope/builder/web/persistence/jpa/AgentEntity.java:342–344

getRunAs

public String getRunAs()

获取运行 As。

Returns the run as.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/builder/web/persistence/jpa/AgentEntity.java:346–348

setRunAs

public void setRunAs(String runAs)

设置运行 As。

Sets the run as.

参数Parameters
名称Name类型Type说明Description
runAsString运行 As(类型 `String`)。The run as.
源码Source io/agentscope/builder/web/persistence/jpa/AgentEntity.java:350–352

getForkOf

public String getForkOf()

获取 getForkOf。

Returns the fork of.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/builder/web/persistence/jpa/AgentEntity.java:354–356

setForkOf

public void setForkOf(String forkOf)

设置 setForkOf。

Sets the fork of.

参数Parameters
名称Name类型Type说明Description
forkOfStringfork 的(类型 `String`)。The fork of.
源码Source io/agentscope/builder/web/persistence/jpa/AgentEntity.java:358–360

getSkillRepositoriesJson

public String getSkillRepositoriesJson()

获取 getSkillRepositoriesJson。

Returns the skill repositories json.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/builder/web/persistence/jpa/AgentEntity.java:362–364

setSkillRepositoriesJson

public void setSkillRepositoriesJson(String skillRepositoriesJson)

设置 setSkillRepositoriesJson。

Sets the skill repositories json.

参数Parameters
名称Name类型Type说明Description
skillRepositoriesJsonString技能 Repositories JSON(类型 `String`)。The skill repositories json.
源码Source io/agentscope/builder/web/persistence/jpa/AgentEntity.java:366–368

getSandboxMode

public String getSandboxMode()

获取沙箱模式。

Returns the sandbox mode.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/builder/web/persistence/jpa/AgentEntity.java:370–372

setSandboxMode

public void setSandboxMode(String sandboxMode)

设置沙箱模式。

Sets the sandbox mode.

参数Parameters
名称Name类型Type说明Description
sandboxModeString沙箱模式(类型 `String`)。The sandbox mode.
源码Source io/agentscope/builder/web/persistence/jpa/AgentEntity.java:374–376

getSandboxScope

public String getSandboxScope()

获取沙箱范围。

Returns the sandbox scope.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/builder/web/persistence/jpa/AgentEntity.java:378–380

setSandboxScope

public void setSandboxScope(String sandboxScope)

设置沙箱范围。

Sets the sandbox scope.

参数Parameters
名称Name类型Type说明Description
sandboxScopeString沙箱范围(类型 `String`)。The sandbox scope.
源码Source io/agentscope/builder/web/persistence/jpa/AgentEntity.java:382–384

getHeadVersion

public int getHeadVersion()

获取 getHeadVersion。

Returns the head version.

返回Returns int
返回数值结果。Returns a numeric result.
源码Source io/agentscope/builder/web/persistence/jpa/AgentEntity.java:386–388

setHeadVersion

public void setHeadVersion(int headVersion)

设置 setHeadVersion。

Sets the head version.

参数Parameters
名称Name类型Type说明Description
headVersioninthead 版本(类型 `int`)。The head version.
源码Source io/agentscope/builder/web/persistence/jpa/AgentEntity.java:390–392

getArchivedAt

public Long getArchivedAt()

获取 getArchivedAt。

Returns the archived at.

返回Returns Long
返回数值结果。Returns a numeric result.
源码Source io/agentscope/builder/web/persistence/jpa/AgentEntity.java:394–396

setArchivedAt

public void setArchivedAt(Long archivedAt)

设置 setArchivedAt。

Sets the archived at.

参数Parameters
名称Name类型Type说明Description
archivedAtLongarchived At(类型 `Long`)。The archived at.
源码Source io/agentscope/builder/web/persistence/jpa/AgentEntity.java:398–400

getPermissionPoliciesJson

public String getPermissionPoliciesJson()

获取 getPermissionPoliciesJson。

Returns the permission policies json.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/builder/web/persistence/jpa/AgentEntity.java:402–404

setPermissionPoliciesJson

public void setPermissionPoliciesJson(String permissionPoliciesJson)

设置 setPermissionPoliciesJson。

Sets the permission policies json.

参数Parameters
名称Name类型Type说明Description
permissionPoliciesJsonString权限 Policies JSON(类型 `String`)。The permission policies json.
源码Source io/agentscope/builder/web/persistence/jpa/AgentEntity.java:406–408

getCreatedAt

public long getCreatedAt()

获取已创建 At。

Returns the created at.

返回Returns long
返回数值结果。Returns a numeric result.
源码Source io/agentscope/builder/web/persistence/jpa/AgentEntity.java:410–412

setCreatedAt

public void setCreatedAt(long createdAt)

设置已创建 At。

Sets the created at.

参数Parameters
名称Name类型Type说明Description
createdAtlong已创建 At(类型 `long`)。The created at.
源码Source io/agentscope/builder/web/persistence/jpa/AgentEntity.java:414–416

getUpdatedAt

public long getUpdatedAt()

获取已更新 At。

Returns the updated at.

返回Returns long
返回数值结果。Returns a numeric result.
源码Source io/agentscope/builder/web/persistence/jpa/AgentEntity.java:418–420

setUpdatedAt

public void setUpdatedAt(long updatedAt)

设置已更新 At。

Sets the updated at.

参数Parameters
名称Name类型Type说明Description
updatedAtlong已更新 At(类型 `long`)。The updated at.
源码Source io/agentscope/builder/web/persistence/jpa/AgentEntity.java:422–424

getShares

public List<AgentShareEntity> getShares()

获取 getShares。

Returns the shares.

返回Returns List<AgentShareEntity>
返回列出。Returns list.
源码Source io/agentscope/builder/web/persistence/jpa/AgentEntity.java:426–428

setShares

public void setShares(List<AgentShareEntity> shares)

设置 setShares。

Sets the shares.

参数Parameters
名称Name类型Type说明Description
sharesList<AgentShareEntity>shares(类型 `List`)。The shares.
源码Source io/agentscope/builder/web/persistence/jpa/AgentEntity.java:430–432
基于官方固定版本源码静态生成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.