Interface TokenUsage.Builder
-
- All Superinterfaces:
Buildable,CopyableBuilder<TokenUsage.Builder,TokenUsage>,SdkBuilder<TokenUsage.Builder,TokenUsage>,SdkPojo
- Enclosing class:
- TokenUsage
@Mutable @NotThreadSafe public static interface TokenUsage.Builder extends SdkPojo, CopyableBuilder<TokenUsage.Builder,TokenUsage>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TokenUsage.BuildercacheDetails(Collection<CacheDetail> cacheDetails)Detailed breakdown of cache writes by TTL.TokenUsage.BuildercacheDetails(Consumer<CacheDetail.Builder>... cacheDetails)Detailed breakdown of cache writes by TTL.TokenUsage.BuildercacheDetails(CacheDetail... cacheDetails)Detailed breakdown of cache writes by TTL.TokenUsage.BuildercacheReadInputTokens(Integer cacheReadInputTokens)The number of input tokens read from the cache for the request.TokenUsage.BuildercacheWriteInputTokens(Integer cacheWriteInputTokens)The number of input tokens written to the cache for the request.TokenUsage.BuilderinputTokens(Integer inputTokens)The number of tokens sent in the request to the model.TokenUsage.BuilderoutputTokens(Integer outputTokens)The number of tokens that the model generated for the request.TokenUsage.BuildertotalTokens(Integer totalTokens)The total of input tokens and tokens generated by the model.-
Methods inherited from interface software.amazon.awssdk.utils.builder.CopyableBuilder
copy
-
Methods inherited from interface software.amazon.awssdk.utils.builder.SdkBuilder
applyMutation, build
-
Methods inherited from interface software.amazon.awssdk.core.SdkPojo
equalsBySdkFields, sdkFieldNameToField, sdkFields
-
-
-
-
Method Detail
-
inputTokens
TokenUsage.Builder inputTokens(Integer inputTokens)
The number of tokens sent in the request to the model.
- Parameters:
inputTokens- The number of tokens sent in the request to the model.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
outputTokens
TokenUsage.Builder outputTokens(Integer outputTokens)
The number of tokens that the model generated for the request.
- Parameters:
outputTokens- The number of tokens that the model generated for the request.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
totalTokens
TokenUsage.Builder totalTokens(Integer totalTokens)
The total of input tokens and tokens generated by the model.
- Parameters:
totalTokens- The total of input tokens and tokens generated by the model.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
cacheReadInputTokens
TokenUsage.Builder cacheReadInputTokens(Integer cacheReadInputTokens)
The number of input tokens read from the cache for the request.
- Parameters:
cacheReadInputTokens- The number of input tokens read from the cache for the request.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
cacheWriteInputTokens
TokenUsage.Builder cacheWriteInputTokens(Integer cacheWriteInputTokens)
The number of input tokens written to the cache for the request.
- Parameters:
cacheWriteInputTokens- The number of input tokens written to the cache for the request.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
cacheDetails
TokenUsage.Builder cacheDetails(Collection<CacheDetail> cacheDetails)
Detailed breakdown of cache writes by TTL. Empty if no cache creation occurred. Sorted by TTL duration (1h before 5m).
- Parameters:
cacheDetails- Detailed breakdown of cache writes by TTL. Empty if no cache creation occurred. Sorted by TTL duration (1h before 5m).- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
cacheDetails
TokenUsage.Builder cacheDetails(CacheDetail... cacheDetails)
Detailed breakdown of cache writes by TTL. Empty if no cache creation occurred. Sorted by TTL duration (1h before 5m).
- Parameters:
cacheDetails- Detailed breakdown of cache writes by TTL. Empty if no cache creation occurred. Sorted by TTL duration (1h before 5m).- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
cacheDetails
TokenUsage.Builder cacheDetails(Consumer<CacheDetail.Builder>... cacheDetails)
Detailed breakdown of cache writes by TTL. Empty if no cache creation occurred. Sorted by TTL duration (1h before 5m).
This is a convenience method that creates an instance of theCacheDetail.Builderavoiding the need to create one manually viaCacheDetail.builder().When the
Consumercompletes,SdkBuilder.build()is called immediately and its result is passed to#cacheDetails(List.) - Parameters:
cacheDetails- a consumer that will call methods onCacheDetail.Builder- Returns:
- Returns a reference to this object so that method calls can be chained together.
- See Also:
#cacheDetails(java.util.Collection)
-
-