Class: LaunchDarkly::Server::AI::TokenUsage

Inherits:
Object
  • Object
show all
Defined in:
lib/server/ai/ai_config_tracker.rb

Overview

Tracks token usage for AI operations.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(total: nil, input: nil, output: nil) ⇒ TokenUsage

Returns a new instance of TokenUsage.

Parameters:

  • total (Integer) (defaults to: nil)

    Total number of tokens used.

  • input (Integer) (defaults to: nil)

    Number of tokens in the prompt.

  • output (Integer) (defaults to: nil)

    Number of tokens in the completion.



19
20
21
22
23
# File 'lib/server/ai/ai_config_tracker.rb', line 19

def initialize(total: nil, input: nil, output: nil)
  @total = total
  @input = input
  @output = output
end

Instance Attribute Details

#inputObject (readonly)

Returns the value of attribute input.



12
13
14
# File 'lib/server/ai/ai_config_tracker.rb', line 12

def input
  @input
end

#outputObject (readonly)

Returns the value of attribute output.



12
13
14
# File 'lib/server/ai/ai_config_tracker.rb', line 12

def output
  @output
end

#totalObject (readonly)

Returns the value of attribute total.



12
13
14
# File 'lib/server/ai/ai_config_tracker.rb', line 12

def total
  @total
end