totalTokenCount
TypeScriptget totalTokenCount(): numberSwift declarationvar totalTokenCount: Int { get }The total number of tokens involved in this generation, combining input and output counts.
struct · iOS 27.0+ · SDK 27.1
struct UsageInformation about how many tokens were used by a response.
get totalTokenCount(): numberSwift declarationvar totalTokenCount: Int { get }The total number of tokens involved in this generation, combining input and output counts.
static init(input: LanguageModelSession_Usage_Input, output: LanguageModelSession_Usage_Output, metadata?: Record<string, SDKHandle>): LanguageModelSession_UsageSwift declarationinit(input: LanguageModelSession.Usage.Input, output: LanguageModelSession.Usage.Output, metadata: [String : any ConvertibleToGeneratedContent] = [:])Creates a usage value with the given token counts. - Parameters: - input: Token counts for the transcript. - output: Token counts for the response. - metadata: Additional usage statistics from the language model.
get input(): LanguageModelSession_Usage_InputSwift declarationvar input: LanguageModelSession.Usage.InputThe input token counts from the transcript.
set input(value: LanguageModelSession_Usage_Input)Swift declarationvar input: LanguageModelSession.Usage.InputThe input token counts from the transcript.
get output(): LanguageModelSession_Usage_OutputSwift declarationvar output: LanguageModelSession.Usage.OutputThe output token counts from the response.
set output(value: LanguageModelSession_Usage_Output)Swift declarationvar output: LanguageModelSession.Usage.OutputThe output token counts from the response.
get metadata(): Record<string, GeneratedContent>Swift declarationvar metadata: [String : GeneratedContent]Language models that provide other kinds of usage statistics may encode them in metadata.
set metadata(value: Record<string, GeneratedContent>)Swift declarationvar metadata: [String : GeneratedContent]Language models that provide other kinds of usage statistics may encode them in metadata.
No declarations were skipped in this snapshot.