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

ChannelHeartbeat

class ChannelHeartbeat(BaseModel)
源码Source agentscope/app/channel/_base.py:162–184

渠道心跳,把智能体接入外部消息渠道与企业平台。位于 agentscope.app.channel 包。核心成员包括 is_fresh。

The bus expires a registry namespace as a whole rather than per field, so a node that stops reporting — a worker that restarted under a fresh id, say — leaves its last entry behind while its successor keeps the namespace alive. Readers therefore drop reports older than :data:LIVENESS_TTL_SECS instead of trusting expiry.

属性摘要Attribute Summary

属性Attribute类型Type说明Description值Value
statusChannelStatus
状态字段。
—
reported_atfloat
`reported_at` 字段。
—

方法摘要Method Summary

方法Method说明Description
def is_fresh(now: float) -> bool
判断是否最新。
Whether this report is recent enough to believe.

属性详情Attribute Detail

status

ChannelStatus

状态字段。声明为 ChannelStatus。

The status field.

源码Source agentscope/app/channel/_base.py:173

reported_at

float

reported_at 字段。声明为 float。

The reported at field.

源码Source agentscope/app/channel/_base.py:174

方法详情Method Detail

is_fresh

def is_fresh(now: float) -> bool

判断是否最新。

Whether this report is recent enough to believe.

参数Parameters
名称Name类型Type说明Description
nowfloat当前时间(类型 `float`)。The reader's current epoch time.
返回Returns bool
返回布尔值,表示判断结果。Returns a boolean result.
源码Source agentscope/app/channel/_base.py:178–184
基于官方固定版本源码静态生成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.