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

SessionRecord

class SessionRecord(_RecordBase)
源码Source agentscope/app/storage/_model/_session.py:319–453

会话类。位于 agentscope.app.storage 包,继承自 _RecordBase。核心成员包括 source、source_schedule_id、source_channel_id、source_chat_id、source_chat_name。

The session record. Declared in agentscope.app.storage. Extends _RecordBase.

属性摘要Property Summary

属性Property说明Description
sourcedeprecateddeprecated
获取来源。
The origin's tag, under the name it used to have.
source_schedule_iddeprecateddeprecated
获取来源调度标识。
The schedule that created this session, if one did.
source_channel_iddeprecateddeprecated
获取来源渠道标识。
The owning channel, if an inbound message created this.
source_chat_iddeprecateddeprecated
获取来源聊天标识。
The platform chat this session serves, if any.
source_chat_namedeprecateddeprecated
获取来源聊天名称。
That chat's title, when the platform supplied one.

属性摘要Attribute Summary

属性Attribute类型Type说明Description值Value
user_idstr
用户标识字段。
—
agent_idstr
智能体标识字段。
—
originSessionOrigin
来源字段。
Field(default_factory=UserOrigin)
team_idstr | None
团队标识字段。
None
configSessionConfig
配置字段。
—
stateAgentState
状态字段。
Field(default_factory=AgentState)

属性详情Attribute Detail

user_id

str

用户标识字段。声明为 str。

The user id field.

源码Source agentscope/app/storage/_model/_session.py:322

agent_id

str

智能体标识字段。声明为 str。

The agent id field.

源码Source agentscope/app/storage/_model/_session.py:325

origin

SessionOrigin = Field(default_factory=UserOrigin)

来源字段。声明为 SessionOrigin。

The origin field.

源码Source agentscope/app/storage/_model/_session.py:328

team_id

str | None = None

团队标识字段。声明为 str | None。

The team id field.

源码Source agentscope/app/storage/_model/_session.py:340

config

SessionConfig

配置字段。声明为 SessionConfig。

The config field.

源码Source agentscope/app/storage/_model/_session.py:348

state

AgentState = Field(default_factory=AgentState)

状态字段。声明为 AgentState。

The state field.

源码Source agentscope/app/storage/_model/_session.py:452

属性详情Property Detail

source

def source() -> str
deprecateddeprecated

获取来源。

The origin's tag, under the name it used to have.

返回Returns str
返回字符串结果。Returns a string.
源码Source agentscope/app/storage/_model/_session.py:408–410

source_schedule_id

def source_schedule_id() -> str | None
deprecateddeprecated

获取来源调度标识。

The schedule that created this session, if one did.

返回Returns str | None
返回str|None。Returns str none.
源码Source agentscope/app/storage/_model/_session.py:414–420

source_channel_id

def source_channel_id() -> str | None
deprecateddeprecated

获取来源渠道标识。

The owning channel, if an inbound message created this.

返回Returns str | None
返回str|None。Returns str none.
源码Source agentscope/app/storage/_model/_session.py:424–430

source_chat_id

def source_chat_id() -> str | None
deprecateddeprecated

获取来源聊天标识。

The platform chat this session serves, if any.

返回Returns str | None
返回str|None。Returns str none.
源码Source agentscope/app/storage/_model/_session.py:434–440

source_chat_name

def source_chat_name() -> str | None
deprecateddeprecated

获取来源聊天名称。

That chat's title, when the platform supplied one.

返回Returns str | None
返回str|None。Returns str none.
源码Source agentscope/app/storage/_model/_session.py:444–450
基于官方固定版本源码静态生成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.