ollama-ruby 1.13.0 → 1.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 521a4b8692c845b11a9927e253e53da2edcc8375d027bf00d19a46926d65b884
4
- data.tar.gz: 8796169c2f3e2e43386cb14f630f2d9f540a055f237c782c649241dffa7f7d69
3
+ metadata.gz: d07a44fbcf79c2fcab881a2e2f2bcbcd42c18d040498e7988abb77e3aa97a6f5
4
+ data.tar.gz: 4ab66fbf6953ca66c3235eb9512ce38b53371d5f2178603ff678d94b30fa9551
5
5
  SHA512:
6
- metadata.gz: 481c77743cfd7c169b033a8a3842cb5d6c2e90172b737e146c8bf99e39beb2f4900633c7d44bf5b48713732d0d492f4a3245ea50752b779c0cb75ca444521696
7
- data.tar.gz: ba733be59a456f04b2e6e3349179d9dc5f4a8cd15bedfdcf9f69981f4b38c8b4c809289eec311dbdf51cf6b0c2eadb9bff332a989aa9134e100897d1632f2c86
6
+ metadata.gz: '08433690e167532e8a98c81b212cb6a82a96329121f376379c56abf5ecfae2e7e11d96ba40875357b6a83796fe018db4b9a3b5148711860400cdbbe290c0e2c1'
7
+ data.tar.gz: bdf0161b3c9ba895ff79927bcd515f346c1582cebddc86f14d7077a16ad39c907a406d1db8a056ac0a7d1f19bdaf58468cbb4acab56d5618112fe875199da540
data/CHANGES.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changes
2
2
 
3
+ ## 2025-12-03 v1.14.0
4
+
5
+ - Added `as_json` method to `Ollama::Image` class that returns base64 string
6
+ for Ollama API compatibility
7
+ - Added test case verifying `image.to_json` produces quoted base64 string
8
+ - Method signature uses `*_args` to accept ignored parameters for JSON
9
+ compatibility
10
+ - Documented method behavior for JSON serialization compatibility
11
+
3
12
  ## 2025-12-03 v1.13.0
4
13
 
5
14
  - Updated `Ollama::Image#for_string` method to use `Base64.strict_encode64` for
data/lib/ollama/image.rb CHANGED
@@ -106,4 +106,14 @@ class Ollama::Image
106
106
  def to_s
107
107
  @data
108
108
  end
109
+
110
+ # Returns the base64-encoded string representation of the image data.
111
+ # When this object is serialized to JSON, it will produce a quoted base64
112
+ # string as required by the Ollama API.
113
+ #
114
+ # @param _args [Array] ignored arguments (for compatibility with JSON serialization)
115
+ # @return [String] the base64-encoded image data
116
+ def as_json(*_args)
117
+ to_s
118
+ end
109
119
  end
@@ -1,6 +1,6 @@
1
1
  module Ollama
2
2
  # Ollama version
3
- VERSION = '1.13.0'
3
+ VERSION = '1.14.0'
4
4
  VERSION_ARRAY = VERSION.split('.').map(&:to_i) # :nodoc:
5
5
  VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
6
6
  VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
data/ollama-ruby.gemspec CHANGED
@@ -1,9 +1,9 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: ollama-ruby 1.13.0 ruby lib
2
+ # stub: ollama-ruby 1.14.0 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "ollama-ruby".freeze
6
- s.version = "1.13.0".freeze
6
+ s.version = "1.14.0".freeze
7
7
 
8
8
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
9
9
  s.require_paths = ["lib".freeze]
@@ -29,4 +29,8 @@ describe Ollama::Image do
29
29
  it 'tracks path of file' do
30
30
  expect(image.path).to eq asset('kitten.jpg')
31
31
  end
32
+
33
+ it 'can be converted into JSON as a quoted base64 string' do
34
+ expect(image.to_json).to eq '"%s"' % image.to_s
35
+ end
32
36
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ollama-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.13.0
4
+ version: 1.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Frank