struct OpenAI::Usage
- OpenAI::Usage
- Struct
- Value
- Object
Overview
Usage statistics for the total token usage per completion request
Included Modules
- JSON::Serializable
Extended Modules
- JSON::Schema
Defined in:
openai/api/usage.crConstructors
- .new(prompt_tokens : Int32, completion_tokens : Int32, total_tokens : Int32)
- .new(pull : JSON::PullParser)
Instance Method Summary
-
#completion_tokens : Int32
Number of tokens in the generated completion.
-
#prompt_tokens : Int32
Number of tokens in the prompt.
-
#total_tokens : Int32
Total number of tokens used in the request (prompt + completion).
Constructor Detail
def self.new(prompt_tokens : Int32, completion_tokens : Int32, total_tokens : Int32)
#