类class
agentscope.messageUsage
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_tokens | int | 输入令牌数字段。 | — |
output_tokens | int | 输出令牌数字段。 | — |
cache_input_tokens | int | 缓存输入令牌数字段。 | 0 |
cache_creation_input_tokens | int | `cache_creation_input_tokens` 字段。 | 0 |
属性详情Attribute Detail
input_tokens
int输入令牌数字段。声明为 int。
The input tokens field.
源码Source
agentscope/message/_base.py:60output_tokens
int输出令牌数字段。声明为 int。
The output tokens field.
源码Source
agentscope/message/_base.py:62cache_input_tokens
int = 0缓存输入令牌数字段。声明为 int。
The cache input tokens field.
源码Source
agentscope/message/_base.py:64cache_creation_input_tokens
int = 0cache_creation_input_tokens 字段。声明为 int。
The cache creation input tokens field.
源码Source
agentscope/message/_base.py:66