Class: LLM::Response::Image

Inherits:
LLM::Response show all
Defined in:
lib/llm/response/image.rb

Overview

The LLM::Response::Image class represents an image response. An image response might encapsulate one or more URLs, or a base64 encoded image – depending on the provider.

Instance Method Summary collapse

Methods inherited from LLM::Response

#body, #initialize

Constructor Details

This class inherits a constructor from LLM::Response

Instance Method Details

#imagesArray<OpenStruct>?

Returns one or more image objects, or nil

Returns:



12
13
14
# File 'lib/llm/response/image.rb', line 12

def images
  parsed[:images].any? ? parsed[:images] : nil
end

#urlsArray<String>?

Returns one or more image URLs, or nil

Returns:

  • (Array<String>, nil)


19
20
21
# File 'lib/llm/response/image.rb', line 19

def urls
  parsed[:urls].any? ? parsed[:urls] : nil
end