Module: LLM::Google::ResponseAdapter::Image
- Defined in:
- lib/llm/providers/google/response_adapter/image.rb
Instance Method Summary collapse
- #images ⇒ Array<StringIO>
-
#urls ⇒ Array<String>
Returns one or more image URLs, or an empty array.
Instance Method Details
#images ⇒ 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 |
#urls ⇒ Array<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
20 |
# File 'lib/llm/providers/google/response_adapter/image.rb', line 20 def urls = [] |