agentscope.app.storageTeamMember
class TeamMember(BaseModel)
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_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`.") |
agent_id | str | 成员智能体's 标识。 | Field(description="The member agent's id.") |
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.") |
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.') |
属性详情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.
agentscope/app/storage/_model/_team.py:23agent_id
str = Field(description="The member agent's id.")成员智能体's 标识。
The member agent's id.
agentscope/app/storage/_model/_team.py:31session_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.
agentscope/app/storage/_model/_team.py:35role
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.
agentscope/app/storage/_model/_team.py:45