Class: ActiveHarness::Pricing::ModelPrice
- Inherits:
-
Struct
- Object
- Struct
- ActiveHarness::Pricing::ModelPrice
- Defined in:
- lib/active_harness/pricing.rb
Overview
Pricing rates for a single model (per-million USD).
Instance Attribute Summary collapse
-
#cache_read_input_per_million ⇒ Object
Returns the value of attribute cache_read_input_per_million.
-
#cache_write_input_per_million ⇒ Object
Returns the value of attribute cache_write_input_per_million.
-
#context_window ⇒ Object
Returns the value of attribute context_window.
-
#id ⇒ Object
Returns the value of attribute id.
-
#input_modalities ⇒ Object
Returns the value of attribute input_modalities.
-
#input_per_million ⇒ Object
Returns the value of attribute input_per_million.
-
#max_output_tokens ⇒ Object
Returns the value of attribute max_output_tokens.
-
#name ⇒ Object
Returns the value of attribute name.
-
#output_modalities ⇒ Object
Returns the value of attribute output_modalities.
-
#output_per_million ⇒ Object
Returns the value of attribute output_per_million.
-
#provider ⇒ Object
Returns the value of attribute provider.
Instance Method Summary collapse
-
#categories ⇒ Object
Capability tags derived from modality data.
- #inspect ⇒ Object
Instance Attribute Details
#cache_read_input_per_million ⇒ Object
Returns the value of attribute cache_read_input_per_million
17 18 19 |
# File 'lib/active_harness/pricing.rb', line 17 def cache_read_input_per_million @cache_read_input_per_million end |
#cache_write_input_per_million ⇒ Object
Returns the value of attribute cache_write_input_per_million
17 18 19 |
# File 'lib/active_harness/pricing.rb', line 17 def cache_write_input_per_million @cache_write_input_per_million end |
#context_window ⇒ Object
Returns the value of attribute context_window
17 18 19 |
# File 'lib/active_harness/pricing.rb', line 17 def context_window @context_window end |
#id ⇒ Object
Returns the value of attribute id
17 18 19 |
# File 'lib/active_harness/pricing.rb', line 17 def id @id end |
#input_modalities ⇒ Object
Returns the value of attribute input_modalities
17 18 19 |
# File 'lib/active_harness/pricing.rb', line 17 def input_modalities @input_modalities end |
#input_per_million ⇒ Object
Returns the value of attribute input_per_million
17 18 19 |
# File 'lib/active_harness/pricing.rb', line 17 def input_per_million @input_per_million end |
#max_output_tokens ⇒ Object
Returns the value of attribute max_output_tokens
17 18 19 |
# File 'lib/active_harness/pricing.rb', line 17 def max_output_tokens @max_output_tokens end |
#name ⇒ Object
Returns the value of attribute name
17 18 19 |
# File 'lib/active_harness/pricing.rb', line 17 def name @name end |
#output_modalities ⇒ Object
Returns the value of attribute output_modalities
17 18 19 |
# File 'lib/active_harness/pricing.rb', line 17 def output_modalities @output_modalities end |
#output_per_million ⇒ Object
Returns the value of attribute output_per_million
17 18 19 |
# File 'lib/active_harness/pricing.rb', line 17 def output_per_million @output_per_million end |
#provider ⇒ Object
Returns the value of attribute provider
17 18 19 |
# File 'lib/active_harness/pricing.rb', line 17 def provider @provider end |
Instance Method Details
#categories ⇒ Object
Capability tags derived from modality data. Possible values: “vision”, “pdf”, “audio”, “video”, “imggen”, “embed”
33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/active_harness/pricing.rb', line 33 def categories inp = input_modalities || [] out = output_modalities || [] cats = [] cats << "vision" if inp.include?("image") cats << "pdf" if inp.include?("pdf") cats << "audio" if inp.include?("audio") || out.include?("audio") cats << "video" if inp.include?("video") || out.include?("video") cats << "imggen" if out.include?("image") cats << "embed" if id.to_s.match?(/embed/i) || name.to_s.match?(/embed/i) cats end |
#inspect ⇒ Object
46 47 48 49 50 51 52 53 |
# File 'lib/active_harness/pricing.rb', line 46 def inspect parts = ["id=#{id.inspect}", "provider=#{provider.inspect}"] parts << "input=$#{input_per_million}/M" if input_per_million parts << "output=$#{output_per_million}/M" if output_per_million parts << "ctx=#{context_window}" if context_window parts << "cats=#{categories.join(',')}" if categories.any? "#<ModelPrice #{parts.join(' ')}>" end |