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. All *_per_million fields are in USD per 1M tokens. audio_input_per_million / audio_output_per_million may represent per-million audio tokens or per-unit (second/char) depending on provider.
Instance Attribute Summary collapse
-
#audio_input_per_million ⇒ Object
Returns the value of attribute audio_input_per_million.
-
#audio_output_per_million ⇒ Object
Returns the value of attribute audio_output_per_million.
-
#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.
-
#image_input_per_million ⇒ Object
Returns the value of attribute image_input_per_million.
-
#image_output_per_million ⇒ Object
Returns the value of attribute image_output_per_million.
-
#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.
-
#web_search_per_request ⇒ Object
Returns the value of attribute web_search_per_request.
Instance Method Summary collapse
-
#categories ⇒ Object
Capability tags derived from modality data.
- #inspect ⇒ Object
Instance Attribute Details
#audio_input_per_million ⇒ Object
Returns the value of attribute audio_input_per_million
20 21 22 |
# File 'lib/active_harness/pricing.rb', line 20 def audio_input_per_million @audio_input_per_million end |
#audio_output_per_million ⇒ Object
Returns the value of attribute audio_output_per_million
20 21 22 |
# File 'lib/active_harness/pricing.rb', line 20 def audio_output_per_million @audio_output_per_million end |
#cache_read_input_per_million ⇒ Object
Returns the value of attribute cache_read_input_per_million
20 21 22 |
# File 'lib/active_harness/pricing.rb', line 20 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
20 21 22 |
# File 'lib/active_harness/pricing.rb', line 20 def cache_write_input_per_million @cache_write_input_per_million end |
#context_window ⇒ Object
Returns the value of attribute context_window
20 21 22 |
# File 'lib/active_harness/pricing.rb', line 20 def context_window @context_window end |
#id ⇒ Object
Returns the value of attribute id
20 21 22 |
# File 'lib/active_harness/pricing.rb', line 20 def id @id end |
#image_input_per_million ⇒ Object
Returns the value of attribute image_input_per_million
20 21 22 |
# File 'lib/active_harness/pricing.rb', line 20 def image_input_per_million @image_input_per_million end |
#image_output_per_million ⇒ Object
Returns the value of attribute image_output_per_million
20 21 22 |
# File 'lib/active_harness/pricing.rb', line 20 def image_output_per_million @image_output_per_million end |
#input_modalities ⇒ Object
Returns the value of attribute input_modalities
20 21 22 |
# File 'lib/active_harness/pricing.rb', line 20 def input_modalities @input_modalities end |
#input_per_million ⇒ Object
Returns the value of attribute input_per_million
20 21 22 |
# File 'lib/active_harness/pricing.rb', line 20 def input_per_million @input_per_million end |
#max_output_tokens ⇒ Object
Returns the value of attribute max_output_tokens
20 21 22 |
# File 'lib/active_harness/pricing.rb', line 20 def max_output_tokens @max_output_tokens end |
#name ⇒ Object
Returns the value of attribute name
20 21 22 |
# File 'lib/active_harness/pricing.rb', line 20 def name @name end |
#output_modalities ⇒ Object
Returns the value of attribute output_modalities
20 21 22 |
# File 'lib/active_harness/pricing.rb', line 20 def output_modalities @output_modalities end |
#output_per_million ⇒ Object
Returns the value of attribute output_per_million
20 21 22 |
# File 'lib/active_harness/pricing.rb', line 20 def output_per_million @output_per_million end |
#provider ⇒ Object
Returns the value of attribute provider
20 21 22 |
# File 'lib/active_harness/pricing.rb', line 20 def provider @provider end |
#web_search_per_request ⇒ Object
Returns the value of attribute web_search_per_request
20 21 22 |
# File 'lib/active_harness/pricing.rb', line 20 def web_search_per_request @web_search_per_request end |
Instance Method Details
#categories ⇒ Object
Capability tags derived from modality data. Possible values: “vision”, “pdf”, “audio”, “video”, “imggen”, “embed”,
"speech", "transcription", "rerank"
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/active_harness/pricing.rb', line 44 def categories inp = Array(input_modalities) out = Array(output_modalities) cats = [] cats << "vision" if inp.include?("image") cats << "pdf" if inp.include?("pdf") cats << "audio" if inp.include?("audio") cats << "video" if inp.include?("video") || out.include?("video") cats << "imggen" if out.include?("image") cats << "speech" if out.include?("speech") cats << "transcription" if out.include?("transcription") cats << "rerank" if out.include?("rerank") cats << "embed" if out.include?("embeddings") cats end |
#inspect ⇒ Object
60 61 62 63 64 65 66 67 |
# File 'lib/active_harness/pricing.rb', line 60 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 |