AS AgentScopeAPI 手册 / API Reference
类class agentscope.agent

TurnMetrics

class TurnMetrics(BaseModel)
源码Source agentscope/agent/_realtime/_metrics.py:6–62

轮次指标,驱动智能体的推理、工具调用与会话执行。位于 agentscope.agent 包。核心成员包括 endpointing_delay、backend_ttfb、transport_delay、e2e_latency。

All timestamps are :func:time.monotonic readings, in seconds.

属性摘要Property Summary

属性Property说明Description
endpointing_delay
读取 `endpointing_delay` 属性。
Time spent deciding the user had finished.
backend_ttfb
读取 `backend_ttfb` 属性。
Time the backend took to start answering.
transport_delay
获取传输层延迟。
Time between audio leaving the server and reaching the ear.
e2e_latency
获取e 2 e 延迟。
The user stopped speaking until they heard an answer.

属性摘要Attribute Summary

属性Attribute类型Type说明Description值Value
user_speech_end_atfloat | None
用户语音结束 at字段。
None
turn_committed_atfloat | None
`turn_committed_at` 字段。
None
backend_first_audio_atfloat | None
`backend_first_audio_at` 字段。
None
first_audio_played_atfloat | None
`first_audio_played_at` 字段。
None
input_tokensint
输入令牌数字段。
Field(default=0, ge=0)
output_tokensint
输出令牌数字段。
Field(default=0, ge=0)

属性详情Attribute Detail

user_speech_end_at

float | None = None

用户语音结束 at字段。声明为 float | None。

The user speech end at field.

源码Source agentscope/agent/_realtime/_metrics.py:12

turn_committed_at

float | None = None

turn_committed_at 字段。声明为 float | None。

The turn committed at field.

源码Source agentscope/agent/_realtime/_metrics.py:15

backend_first_audio_at

float | None = None

backend_first_audio_at 字段。声明为 float | None。

The backend first audio at field.

源码Source agentscope/agent/_realtime/_metrics.py:18

first_audio_played_at

float | None = None

first_audio_played_at 字段。声明为 float | None。

The first audio played at field.

源码Source agentscope/agent/_realtime/_metrics.py:21

input_tokens

int = Field(default=0, ge=0)

输入令牌数字段。声明为 int。

The input tokens field.

源码Source agentscope/agent/_realtime/_metrics.py:25

output_tokens

int = Field(default=0, ge=0)

输出令牌数字段。声明为 int。

The output tokens field.

源码Source agentscope/agent/_realtime/_metrics.py:26

属性详情Property Detail

endpointing_delay

def endpointing_delay() -> float | None

读取 endpointing_delay 属性。

Time spent deciding the user had finished.

返回Returns float | None
返回float|None。Returns float none.
源码Source agentscope/agent/_realtime/_metrics.py:29–31

backend_ttfb

def backend_ttfb() -> float | None

读取 backend_ttfb 属性。

Time the backend took to start answering.

返回Returns float | None
返回float|None。Returns float none.
源码Source agentscope/agent/_realtime/_metrics.py:34–39

transport_delay

def transport_delay() -> float | None

获取传输层延迟。

Time between audio leaving the server and reaching the ear.

返回Returns float | None
返回float|None。Returns float none.
源码Source agentscope/agent/_realtime/_metrics.py:42–47

e2e_latency

def e2e_latency() -> float | None

获取e 2 e 延迟。

The user stopped speaking until they heard an answer.

返回Returns float | None
返回float|None。Returns float none.
源码Source agentscope/agent/_realtime/_metrics.py:50–55
基于官方固定版本源码静态生成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.