class RubyLLM::Model::Pricing
A collection that manages and provides access to different categories of pricing information
Constants
- CATEGORIES
Public Class Methods
Source
# File lib/ruby_llm/model/pricing.rb, line 9 def initialize(data) @data = {} CATEGORIES.each do |category| @data[category] = PricingCategory.new(data[category]) if data[category] && !empty_pricing?(data[category]) end end
Public Instance Methods
Source
# File lib/ruby_llm/model/pricing.rb, line 25 def audio_tokens category(:audio_tokens) end
Source
# File lib/ruby_llm/model/pricing.rb, line 29 def embeddings category(:embeddings) end
Source
# File lib/ruby_llm/model/pricing.rb, line 17 def text_tokens category(:text_tokens) end
Source
# File lib/ruby_llm/model/pricing.rb, line 33 def to_h @data.transform_values(&:to_h) end