Class: OpenaiChatgpt::Usage
- Inherits:
-
Object
- Object
- OpenaiChatgpt::Usage
- Defined in:
- lib/openai_chatgpt/usage.rb
Overview
Usage object
Instance Attribute Summary collapse
-
#completion_tokens ⇒ Object
readonly
Returns the value of attribute completion_tokens.
-
#prompt_tokens ⇒ Object
readonly
Returns the value of attribute prompt_tokens.
-
#total_tokens ⇒ Object
readonly
Returns the value of attribute total_tokens.
Instance Method Summary collapse
-
#initialize(obj) ⇒ Usage
constructor
A new instance of Usage.
Constructor Details
#initialize(obj) ⇒ Usage
Returns a new instance of Usage.
8 9 10 11 12 |
# File 'lib/openai_chatgpt/usage.rb', line 8 def initialize(obj) @prompt_tokens = obj.prompt_tokens @completion_tokens = obj.completion_tokens @total_tokens = obj.total_tokens end |
Instance Attribute Details
#completion_tokens ⇒ Object (readonly)
Returns the value of attribute completion_tokens.
6 7 8 |
# File 'lib/openai_chatgpt/usage.rb', line 6 def completion_tokens @completion_tokens end |
#prompt_tokens ⇒ Object (readonly)
Returns the value of attribute prompt_tokens.
6 7 8 |
# File 'lib/openai_chatgpt/usage.rb', line 6 def prompt_tokens @prompt_tokens end |
#total_tokens ⇒ Object (readonly)
Returns the value of attribute total_tokens.
6 7 8 |
# File 'lib/openai_chatgpt/usage.rb', line 6 def total_tokens @total_tokens end |