Class: LlmCostTracker::Pricing::EffectivePriceSet

Inherits:
Data
  • Object
show all
Defined in:
lib/llm_cost_tracker/pricing/effective_prices.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#cache_read_inputObject (readonly)

Returns the value of attribute cache_read_input

Returns:

  • (Object)

    the current value of cache_read_input



5
6
7
# File 'lib/llm_cost_tracker/pricing/effective_prices.rb', line 5

def cache_read_input
  @cache_read_input
end

#cache_write_inputObject (readonly)

Returns the value of attribute cache_write_input

Returns:

  • (Object)

    the current value of cache_write_input



5
6
7
# File 'lib/llm_cost_tracker/pricing/effective_prices.rb', line 5

def cache_write_input
  @cache_write_input
end

#inputObject (readonly)

Returns the value of attribute input

Returns:

  • (Object)

    the current value of input



5
6
7
# File 'lib/llm_cost_tracker/pricing/effective_prices.rb', line 5

def input
  @input
end

#outputObject (readonly)

Returns the value of attribute output

Returns:

  • (Object)

    the current value of output



5
6
7
# File 'lib/llm_cost_tracker/pricing/effective_prices.rb', line 5

def output
  @output
end

Instance Method Details

#complete?Boolean

Returns:

  • (Boolean)


15
16
17
# File 'lib/llm_cost_tracker/pricing/effective_prices.rb', line 15

def complete?
  missing_keys.empty?
end

#missing_keysObject



19
20
21
# File 'lib/llm_cost_tracker/pricing/effective_prices.rb', line 19

def missing_keys
  to_h.filter_map { |key, value| key if value.nil? }
end

#to_hObject



6
7
8
9
10
11
12
13
# File 'lib/llm_cost_tracker/pricing/effective_prices.rb', line 6

def to_h
  {
    input: input,
    cache_read_input: cache_read_input,
    cache_write_input: cache_write_input,
    output: output
  }
end