AS AgentScopeAPI 手册 / API Reference

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.

返回Returns Integer
返回数值结果。Returns a numeric result.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseUsage.java:44–46

setInputTokens

public void setInputTokens(Integer inputTokens)

设置输入令牌数。

Sets the input tokens.

参数Parameters
名称Name类型Type说明Description
inputTokensInteger输入令牌数(类型 `Integer`)。The input tokens.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseUsage.java:48–50

getOutputTokens

public Integer getOutputTokens()

获取输出令牌数。

Returns the output tokens.

返回Returns Integer
返回数值结果。Returns a numeric result.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseUsage.java:52–54

setOutputTokens

public void setOutputTokens(Integer outputTokens)

设置输出令牌数。

Sets the output tokens.

参数Parameters
名称Name类型Type说明Description
outputTokensInteger输出令牌数(类型 `Integer`)。The output tokens.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseUsage.java:56–58

getTotalTokens

public Integer getTotalTokens()

获取总数令牌数。

Returns the total tokens.

返回Returns Integer
返回数值结果。Returns a numeric result.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseUsage.java:60–62

setTotalTokens

public void setTotalTokens(Integer totalTokens)

设置总数令牌数。

Sets the total tokens.

参数Parameters
名称Name类型Type说明Description
totalTokensInteger总数令牌数(类型 `Integer`)。The total tokens.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseUsage.java:64–66

getInputTokensDetails

public Map<String, InputTokenDetail> getInputTokensDetails()

获取输入令牌数详情。

Returns the input tokens details.

返回Returns Map<String, InputTokenDetail>
返回映射。Returns map.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseUsage.java:68–70

setInputTokensDetails

public void setInputTokensDetails(Map<String, InputTokenDetail> inputTokensDetails)

设置输入令牌数详情。

Sets the input tokens details.

参数Parameters
名称Name类型Type说明Description
inputTokensDetailsMap<String, InputTokenDetail>输入令牌数详情(类型 `Map`)。The input tokens details.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseUsage.java:72–74

getOutputTokensDetails

public Map<String, OutputTokenDetail> getOutputTokensDetails()

获取输出令牌数详情。

Returns the output tokens details.

返回Returns Map<String, OutputTokenDetail>
返回映射。Returns map.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseUsage.java:76–78

setOutputTokensDetails

public void setOutputTokensDetails(Map<String, OutputTokenDetail> outputTokensDetails)

设置输出令牌数详情。

Sets the output tokens details.

参数Parameters
名称Name类型Type说明Description
outputTokensDetailsMap<String, OutputTokenDetail>输出令牌数详情(类型 `Map`)。The output tokens details.
源码Source io/agentscope/runtime/protocol/responseapi/model/ResponseUsage.java:80–82
基于官方固定版本源码静态生成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.