Module: LLM::Google::ResponseAdapter::Image

Defined in:
lib/llm/providers/google/response_adapter/image.rb

Instance Method Summary collapse

Instance Method Details

#imagesArray<StringIO>

Returns:

  • (Array<StringIO>)


7
8
9
10
11
12
# File 'lib/llm/providers/google/response_adapter/image.rb', line 7

def images
  (body.predictions || []).map do
    b64 = _1["bytesBase64Encoded"]
    StringIO.new(b64.unpack1("m0"))
  end
end

#urlsArray<String>

Note:

Gemini’s image generation API does not return URLs, so this method will always return an empty array.

Returns one or more image URLs, or an empty array

Returns:

  • (Array<String>)


20
# File 'lib/llm/providers/google/response_adapter/image.rb', line 20

def urls = []