AS AgentScopeAPI 手册 / API Reference
类class agentscope.app.storage

TeamMember

class TeamMember(BaseModel)
源码Source agentscope/app/storage/_model/_team.py:10–53

团队成员,在多次调用之间保存和恢复会话与记忆数据。位于 agentscope.app.storage 包。

Unlike the legacy :attr:TeamData.member_ids, this carries both the agent id AND the session id — required because an invited member's agent (e.g. Monday) can have multiple sessions of its own; the team only wants the one it created when the leader called AgentInvite. The role tag then drives cascade behavior (see :meth:SessionService.delete_team): created members are fully deleted with the team, invited members only lose the borrowed session while their :class:AgentRecord survives.

属性摘要Attribute Summary

属性Attribute类型Type说明Description值Value
owner_idstr
所有者标识字段。
Field(description="Owner of the member's agent definition. For a cross-owner invited member this differs from the team owner; its borrowed session still belongs to :attr:`TeamRecord.user_id`.")
agent_idstr
成员智能体's 标识。
Field(description="The member agent's id.")
session_idstr
会话标识字段。
Field(description="The team-scoped session id for this member. For ``created`` members this is the sole session (1:1 with the agent). For ``invited`` members this is the freshly-minted session that ``AgentInvite`` created in the team owner's namespace — the agent owner's other sessions are unrelated to this team.")
roleLiteral['created', 'invited']
角色字段。
Field(description='How this member joined the team. ``created`` — spawned from a :class:`SubAgentTemplate` via ``AgentCreate``, deleted with the team. ``invited`` — a pre-existing user-owned agent borrowed via ``AgentInvite``, retains its :class:`AgentRecord` when the team is dissolved.')

属性详情Attribute Detail

owner_id

str = Field(description="Owner of the member's agent definition. For a cross-owner invited member this differs from the team owner; its borrowed session still belongs to :attr:`TeamRecord.user_id`.")

所有者标识字段。声明为 str。

Owner of the member's agent definition.

源码Source agentscope/app/storage/_model/_team.py:23

agent_id

str = Field(description="The member agent's id.")

成员智能体's 标识。

The member agent's id.

源码Source agentscope/app/storage/_model/_team.py:31

session_id

str = Field(description="The team-scoped session id for this member. For ``created`` members this is the sole session (1:1 with the agent). For ``invited`` members this is the freshly-minted session that ``AgentInvite`` created in the team owner's namespace — the agent owner's other sessions are unrelated to this team.")

会话标识字段。声明为 str。

The team-scoped session id for this member.

源码Source agentscope/app/storage/_model/_team.py:35

role

Literal['created', 'invited'] = Field(description='How this member joined the team. ``created`` — spawned from a :class:`SubAgentTemplate` via ``AgentCreate``, deleted with the team. ``invited`` — a pre-existing user-owned agent borrowed via ``AgentInvite``, retains its :class:`AgentRecord` when the team is dissolved.')

角色字段。声明为 Literal['created', 'invited']。

How this member joined the team.

源码Source agentscope/app/storage/_model/_team.py:45
基于官方固定版本源码静态生成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.