Class: RubyLLM::Agents::CachedImageUpscaleResult
- Inherits:
-
Object
- Object
- RubyLLM::Agents::CachedImageUpscaleResult
- Defined in:
- lib/ruby_llm/agents/results/image_upscale_result.rb
Overview
Lightweight result for cached upscales
Instance Attribute Summary collapse
-
#cached_at ⇒ Object
readonly
Returns the value of attribute cached_at.
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#mime_type ⇒ Object
readonly
Returns the value of attribute mime_type.
-
#model_id ⇒ Object
readonly
Returns the value of attribute model_id.
-
#output_size ⇒ Object
readonly
Returns the value of attribute output_size.
-
#scale ⇒ Object
readonly
Returns the value of attribute scale.
-
#total_cost ⇒ Object
readonly
Returns the value of attribute total_cost.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #base64? ⇒ Boolean
- #batch? ⇒ Boolean
- #cached? ⇒ Boolean
- #count ⇒ Object
- #datas ⇒ Object
- #error? ⇒ Boolean
-
#initialize(data) ⇒ CachedImageUpscaleResult
constructor
A new instance of CachedImageUpscaleResult.
- #single? ⇒ Boolean
- #size ⇒ Object
- #success? ⇒ Boolean
- #urls ⇒ Object
Constructor Details
#initialize(data) ⇒ CachedImageUpscaleResult
Returns a new instance of CachedImageUpscaleResult.
219 220 221 222 223 224 225 226 227 228 |
# File 'lib/ruby_llm/agents/results/image_upscale_result.rb', line 219 def initialize(data) @url = data[:url] @data = data[:data] @mime_type = data[:mime_type] @model_id = data[:model_id] @scale = data[:scale] @output_size = data[:output_size] @total_cost = data[:total_cost] @cached_at = data[:cached_at] end |
Instance Attribute Details
#cached_at ⇒ Object (readonly)
Returns the value of attribute cached_at.
216 217 218 |
# File 'lib/ruby_llm/agents/results/image_upscale_result.rb', line 216 def cached_at @cached_at end |
#data ⇒ Object (readonly)
Returns the value of attribute data.
216 217 218 |
# File 'lib/ruby_llm/agents/results/image_upscale_result.rb', line 216 def data @data end |
#mime_type ⇒ Object (readonly)
Returns the value of attribute mime_type.
216 217 218 |
# File 'lib/ruby_llm/agents/results/image_upscale_result.rb', line 216 def mime_type @mime_type end |
#model_id ⇒ Object (readonly)
Returns the value of attribute model_id.
216 217 218 |
# File 'lib/ruby_llm/agents/results/image_upscale_result.rb', line 216 def model_id @model_id end |
#output_size ⇒ Object (readonly)
Returns the value of attribute output_size.
216 217 218 |
# File 'lib/ruby_llm/agents/results/image_upscale_result.rb', line 216 def output_size @output_size end |
#scale ⇒ Object (readonly)
Returns the value of attribute scale.
216 217 218 |
# File 'lib/ruby_llm/agents/results/image_upscale_result.rb', line 216 def scale @scale end |
#total_cost ⇒ Object (readonly)
Returns the value of attribute total_cost.
216 217 218 |
# File 'lib/ruby_llm/agents/results/image_upscale_result.rb', line 216 def total_cost @total_cost end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
216 217 218 |
# File 'lib/ruby_llm/agents/results/image_upscale_result.rb', line 216 def url @url end |
Instance Method Details
#base64? ⇒ Boolean
250 251 252 |
# File 'lib/ruby_llm/agents/results/image_upscale_result.rb', line 250 def base64? !data.nil? end |
#batch? ⇒ Boolean
262 263 264 |
# File 'lib/ruby_llm/agents/results/image_upscale_result.rb', line 262 def batch? false end |
#cached? ⇒ Boolean
238 239 240 |
# File 'lib/ruby_llm/agents/results/image_upscale_result.rb', line 238 def cached? true end |
#count ⇒ Object
254 255 256 |
# File 'lib/ruby_llm/agents/results/image_upscale_result.rb', line 254 def count success? ? 1 : 0 end |
#datas ⇒ Object
246 247 248 |
# File 'lib/ruby_llm/agents/results/image_upscale_result.rb', line 246 def datas success? ? [data].compact : [] end |
#error? ⇒ Boolean
234 235 236 |
# File 'lib/ruby_llm/agents/results/image_upscale_result.rb', line 234 def error? !success? end |
#single? ⇒ Boolean
258 259 260 |
# File 'lib/ruby_llm/agents/results/image_upscale_result.rb', line 258 def single? true end |
#size ⇒ Object
266 267 268 |
# File 'lib/ruby_llm/agents/results/image_upscale_result.rb', line 266 def size output_size end |
#success? ⇒ Boolean
230 231 232 |
# File 'lib/ruby_llm/agents/results/image_upscale_result.rb', line 230 def success? !url.nil? || !data.nil? end |
#urls ⇒ Object
242 243 244 |
# File 'lib/ruby_llm/agents/results/image_upscale_result.rb', line 242 def urls success? ? [url].compact : [] end |