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

Usage

class Usage(BaseModel)
源码Source agentscope/message/_base.py:57–67

用量,在智能体、模型与前端之间传递结构化消息和事件。位于 agentscope.message 包。

The token usage information of a message. Declared in agentscope.message.

属性摘要Attribute Summary

属性Attribute类型Type说明Description值Value
input_tokensint
输入令牌数字段。
—
output_tokensint
输出令牌数字段。
—
cache_input_tokensint
缓存输入令牌数字段。
0
cache_creation_input_tokensint
`cache_creation_input_tokens` 字段。
0

属性详情Attribute Detail

input_tokens

int

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

The input tokens field.

源码Source agentscope/message/_base.py:60

output_tokens

int

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

The output tokens field.

源码Source agentscope/message/_base.py:62

cache_input_tokens

int = 0

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

The cache input tokens field.

源码Source agentscope/message/_base.py:64

cache_creation_input_tokens

int = 0

cache_creation_input_tokens 字段。声明为 int。

The cache creation input tokens field.

源码Source agentscope/message/_base.py:66
基于官方固定版本源码静态生成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.