类class
agentscope.app.channelChannelHeartbeat
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 |
|---|---|---|---|
status | ChannelStatus | 状态字段。 | — |
reported_at | float | `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:173reported_at
floatreported_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 |
|---|---|---|
now | float | 当前时间(类型 `float`)。The reader's current epoch time. |
bool
返回布尔值,表示判断结果。Returns a boolean result.
源码Source
agentscope/app/channel/_base.py:178–184