ResponseUsage
@JsonIgnoreProperties(ignoreUnknown = true) @JsonInclude(JsonInclude.Include.NON_NULL) public class ResponseUsage
源码Source
io/agentscope/runtime/protocol/responseapi/model/ResponseUsage.java:25–83响应用量,与模型服务通信并返回生成或向量化结果。位于 io.agentscope.runtime.protocol.responseapi.model 包。核心成员包括 getInputTokens、setInputTokens、getOutputTokens、setOutputTokens、getTotalTokens、setTotalTokens。
A class in io.agentscope.runtime.protocol.responseapi.model that talks to model services and returns generated or embedded output. Declared in io.agentscope.runtime.protocol.responseapi.model.
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public Integer getInputTokens() | 获取输入令牌数。 Returns the input tokens. |
public void setInputTokens(Integer inputTokens) | 设置输入令牌数。 Sets the input tokens. |
public Integer getOutputTokens() | 获取输出令牌数。 Returns the output tokens. |
public void setOutputTokens(Integer outputTokens) | 设置输出令牌数。 Sets the output tokens. |
public Integer getTotalTokens() | 获取总数令牌数。 Returns the total tokens. |
public void setTotalTokens(Integer totalTokens) | 设置总数令牌数。 Sets the total tokens. |
public Map<String, InputTokenDetail> getInputTokensDetails() | 获取输入令牌数详情。 Returns the input tokens details. |
public void setInputTokensDetails(Map<String, InputTokenDetail> inputTokensDetails) | 设置输入令牌数详情。 Sets the input tokens details. |
public Map<String, OutputTokenDetail> getOutputTokensDetails() | 获取输出令牌数详情。 Returns the output tokens details. |
public void setOutputTokensDetails(Map<String, OutputTokenDetail> outputTokensDetails) | 设置输出令牌数详情。 Sets the output tokens details. |
方法详情Method Detail
getInputTokens
public Integer getInputTokens()
获取输入令牌数。
Returns the input tokens.
Integer返回数值结果。Returns a numeric result.
源码Source
io/agentscope/runtime/protocol/responseapi/model/ResponseUsage.java:44–46setInputTokens
public void setInputTokens(Integer inputTokens)
设置输入令牌数。
Sets the input tokens.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
inputTokens | Integer | 输入令牌数(类型 `Integer`)。The input tokens. |
源码Source
io/agentscope/runtime/protocol/responseapi/model/ResponseUsage.java:48–50getOutputTokens
public Integer getOutputTokens()
获取输出令牌数。
Returns the output tokens.
Integer返回数值结果。Returns a numeric result.
源码Source
io/agentscope/runtime/protocol/responseapi/model/ResponseUsage.java:52–54setOutputTokens
public void setOutputTokens(Integer outputTokens)
设置输出令牌数。
Sets the output tokens.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
outputTokens | Integer | 输出令牌数(类型 `Integer`)。The output tokens. |
源码Source
io/agentscope/runtime/protocol/responseapi/model/ResponseUsage.java:56–58getTotalTokens
public Integer getTotalTokens()
获取总数令牌数。
Returns the total tokens.
Integer返回数值结果。Returns a numeric result.
源码Source
io/agentscope/runtime/protocol/responseapi/model/ResponseUsage.java:60–62setTotalTokens
public void setTotalTokens(Integer totalTokens)
设置总数令牌数。
Sets the total tokens.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
totalTokens | Integer | 总数令牌数(类型 `Integer`)。The total tokens. |
源码Source
io/agentscope/runtime/protocol/responseapi/model/ResponseUsage.java:64–66getInputTokensDetails
public Map<String, InputTokenDetail> getInputTokensDetails()
获取输入令牌数详情。
Returns the input tokens details.
Map<String, InputTokenDetail>返回映射。Returns map.
源码Source
io/agentscope/runtime/protocol/responseapi/model/ResponseUsage.java:68–70setInputTokensDetails
public void setInputTokensDetails(Map<String, InputTokenDetail> inputTokensDetails)
设置输入令牌数详情。
Sets the input tokens details.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
inputTokensDetails | Map<String, InputTokenDetail> | 输入令牌数详情(类型 `Map`)。The input tokens details. |
源码Source
io/agentscope/runtime/protocol/responseapi/model/ResponseUsage.java:72–74getOutputTokensDetails
public Map<String, OutputTokenDetail> getOutputTokensDetails()
获取输出令牌数详情。
Returns the output tokens details.
Map<String, OutputTokenDetail>返回映射。Returns map.
源码Source
io/agentscope/runtime/protocol/responseapi/model/ResponseUsage.java:76–78setOutputTokensDetails
public void setOutputTokensDetails(Map<String, OutputTokenDetail> outputTokensDetails)
设置输出令牌数详情。
Sets the output tokens details.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
outputTokensDetails | Map<String, OutputTokenDetail> | 输出令牌数详情(类型 `Map`)。The output tokens details. |
源码Source
io/agentscope/runtime/protocol/responseapi/model/ResponseUsage.java:80–82