Class: Pago::V2026_04::Models::LLMMetadata
- Defined in:
- lib/pago/v2026_04/models.rb,
sig/pago/v2026_04/generated.rbs
Constant Summary collapse
- JSON_KEYS =
{ vendor: "vendor", model: "model", prompt: "prompt", response: "response", input_tokens: "input_tokens", cached_input_tokens: "cached_input_tokens", output_tokens: "output_tokens", total_tokens: "total_tokens" }.freeze
- REQUIRED_KEYS =
["vendor", "model", "input_tokens", "output_tokens", "total_tokens"].freeze
Instance Attribute Summary collapse
-
#cached_input_tokens ⇒ Integer
readonly
The number of LLM cached tokens that were used for the event.
-
#input_tokens ⇒ Integer
readonly
The number of LLM input tokens used for the event.
-
#model ⇒ String
readonly
The model used for the event.
-
#output_tokens ⇒ Integer
readonly
The number of LLM output tokens used for the event.
-
#prompt ⇒ String?
readonly
The LLM prompt used for the event.
-
#response ⇒ String?
readonly
The LLM response used for the event.
-
#total_tokens ⇒ Integer
readonly
The total number of LLM tokens used for the event.
-
#vendor ⇒ String
readonly
The vendor of the event.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(vendor:, model:, prompt: ::Pago::UNSET, response: ::Pago::UNSET, input_tokens:, cached_input_tokens: ::Pago::UNSET, output_tokens:, total_tokens:) ⇒ LLMMetadata
constructor
A new instance of LLMMetadata.
Methods inherited from Model
#==, #[], #field_set?, #hash, #inspect, json_keys, required_json_keys, #to_json, #to_json_hash, wrap_raw
Constructor Details
#initialize(vendor:, model:, prompt: ::Pago::UNSET, response: ::Pago::UNSET, input_tokens:, cached_input_tokens: ::Pago::UNSET, output_tokens:, total_tokens:) ⇒ LLMMetadata
Returns a new instance of LLMMetadata.
26221 26222 26223 26224 26225 26226 26227 26228 26229 26230 26231 26232 26233 26234 26235 26236 26237 26238 26239 26240 |
# File 'lib/pago/v2026_04/models.rb', line 26221 def initialize( vendor:, model:, prompt: ::Pago::UNSET, response: ::Pago::UNSET, input_tokens:, cached_input_tokens: ::Pago::UNSET, output_tokens:, total_tokens: ) super() assign(:vendor, vendor) assign(:model, model) assign(:prompt, prompt) assign(:response, response) assign(:input_tokens, input_tokens) assign(:cached_input_tokens, cached_input_tokens) assign(:output_tokens, output_tokens) assign(:total_tokens, total_tokens) end |
Instance Attribute Details
#cached_input_tokens ⇒ Integer (readonly)
The number of LLM cached tokens that were used for the event.
26211 26212 26213 |
# File 'lib/pago/v2026_04/models.rb', line 26211 def cached_input_tokens @cached_input_tokens end |
#input_tokens ⇒ Integer (readonly)
The number of LLM input tokens used for the event.
26207 26208 26209 |
# File 'lib/pago/v2026_04/models.rb', line 26207 def input_tokens @input_tokens end |
#model ⇒ String (readonly)
The model used for the event.
26195 26196 26197 |
# File 'lib/pago/v2026_04/models.rb', line 26195 def model @model end |
#output_tokens ⇒ Integer (readonly)
The number of LLM output tokens used for the event.
26215 26216 26217 |
# File 'lib/pago/v2026_04/models.rb', line 26215 def output_tokens @output_tokens end |
#prompt ⇒ String? (readonly)
The LLM prompt used for the event.
26199 26200 26201 |
# File 'lib/pago/v2026_04/models.rb', line 26199 def prompt @prompt end |
#response ⇒ String? (readonly)
The LLM response used for the event.
26203 26204 26205 |
# File 'lib/pago/v2026_04/models.rb', line 26203 def response @response end |
#total_tokens ⇒ Integer (readonly)
The total number of LLM tokens used for the event.
26219 26220 26221 |
# File 'lib/pago/v2026_04/models.rb', line 26219 def total_tokens @total_tokens end |
#vendor ⇒ String (readonly)
The vendor of the event.
26191 26192 26193 |
# File 'lib/pago/v2026_04/models.rb', line 26191 def vendor @vendor end |
Class Method Details
.from_json(data) ⇒ LLMMetadata?
26244 26245 26246 26247 26248 26249 26250 26251 26252 26253 26254 26255 26256 26257 26258 26259 26260 26261 26262 |
# File 'lib/pago/v2026_04/models.rb', line 26244 def self.from_json(data) data = ::JSON.parse(data) if data.is_a?(String) data = ::Pago::Serde.object(data) return nil if data.nil? wrap_raw( new( vendor: (data.key?("vendor") ? data["vendor"] : ::Pago::UNSET), model: (data.key?("model") ? data["model"] : ::Pago::UNSET), prompt: (data.key?("prompt") ? data["prompt"] : ::Pago::UNSET), response: (data.key?("response") ? data["response"] : ::Pago::UNSET), input_tokens: (data.key?("input_tokens") ? data["input_tokens"] : ::Pago::UNSET), cached_input_tokens: (data.key?("cached_input_tokens") ? data["cached_input_tokens"] : ::Pago::UNSET), output_tokens: (data.key?("output_tokens") ? data["output_tokens"] : ::Pago::UNSET), total_tokens: (data.key?("total_tokens") ? data["total_tokens"] : ::Pago::UNSET) ), data ) end |