struct OpenAI::Usage

Overview

Usage statistics for the total token usage per completion request

Included Modules

Extended Modules

Defined in:

openai/api/usage.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(prompt_tokens : Int32, completion_tokens : Int32, total_tokens : Int32) #

[View source]
def self.new(pull : JSON::PullParser) #

[View source]

Instance Method Detail

def completion_tokens : Int32 #

Number of tokens in the generated completion.


[View source]
def prompt_tokens : Int32 #

Number of tokens in the prompt.


[View source]
def total_tokens : Int32 #

Total number of tokens used in the request (prompt + completion).


[View source]