Module: RubyLLM::Accounting::Usage::Result

Included in:
Embedding, Image, Message, Moderation, OCR, Rerank, Speech, Transcription
Defined in:
lib/ruby_llm/accounting/usage.rb

Overview

Shared storage for result objects carrying attempt accounting.

Instance Method Summary collapse

Instance Method Details

#ruby_llm_usage_entriesObject

:nodoc:



26
27
28
# File 'lib/ruby_llm/accounting/usage.rb', line 26

def ruby_llm_usage_entries # :nodoc:
  @ruby_llm_usage_entries ||= []
end

#ruby_llm_usage_entries=(entries) ⇒ Object

:nodoc:



30
31
32
33
# File 'lib/ruby_llm/accounting/usage.rb', line 30

def ruby_llm_usage_entries=(entries) # :nodoc:
  @ruby_llm_usage_entries = Array(entries)
  @ruby_llm_usage_entries.each { |entry| entry.message = self if is_a?(Message) }
end