ollama-ruby 1.12.0 → 1.13.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: d979768964258e0f21d54b480b0afcd23c01ceefb75be3f828cb0440c45cd5d1
4
- data.tar.gz: b07ae78174a0614b146cd3cc7e4aeefc60ab86bc307b1b967f40c04841cce557
3
+ metadata.gz: 521a4b8692c845b11a9927e253e53da2edcc8375d027bf00d19a46926d65b884
4
+ data.tar.gz: 8796169c2f3e2e43386cb14f630f2d9f540a055f237c782c649241dffa7f7d69
5
5
  SHA512:
6
- metadata.gz: 2251a33cfdd40e1c53ebd9edb06a71994c68ef5a27ed82b35d691525459930e771a10dc93a0c8cc665e93980949a5abb60379f274954cee78a3edfeb4d92183e
7
- data.tar.gz: a956187b7c3cb96f9398ed3677e332251b21db0407c21468b04c540e9a1e925a3cb4a4ff7bfe2e946164d80a262e8cd6ce5219cb3bd51625bc39e8841fed2933
6
+ metadata.gz: 481c77743cfd7c169b033a8a3842cb5d6c2e90172b737e146c8bf99e39beb2f4900633c7d44bf5b48713732d0d492f4a3245ea50752b779c0cb75ca444521696
7
+ data.tar.gz: ba733be59a456f04b2e6e3349179d9dc5f4a8cd15bedfdcf9f69981f4b38c8b4c809289eec311dbdf51cf6b0c2eadb9bff332a989aa9134e100897d1632f2c86
data/CHANGES.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # Changes
2
2
 
3
+ ## 2025-12-03 v1.13.0
4
+
5
+ - Updated `Ollama::Image#for_string` method to use `Base64.strict_encode64` for
6
+ image encoding
7
+ - Modified test expectations in `image_spec.rb` with new size **132196** and
8
+ checksum **20420**
9
+ - Updated `message_spec.rb` JSON payload to remove trailing newline from image
10
+ data
11
+ - Enhanced base64 encoding strictness for image handling in Ollama library
12
+
3
13
  ## 2025-11-30 v1.12.0
4
14
 
5
15
  - `ollama_cli`
data/lib/ollama/image.rb CHANGED
@@ -59,7 +59,7 @@ class Ollama::Image
59
59
  # @return [ Ollama::Image ] a new Image instance initialized with the
60
60
  # encoded string data and optional path
61
61
  def for_string(string, path: nil)
62
- for_base64(Base64.encode64(string), path:)
62
+ for_base64(Base64.strict_encode64(string), path:)
63
63
  end
64
64
 
65
65
  # Creates a new Image object from an IO object by reading its contents and
@@ -1,6 +1,6 @@
1
1
  module Ollama
2
2
  # Ollama version
3
- VERSION = '1.12.0'
3
+ VERSION = '1.13.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.12.0 ruby lib
2
+ # stub: ollama-ruby 1.13.0 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "ollama-ruby".freeze
6
- s.version = "1.12.0".freeze
6
+ s.version = "1.13.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]
@@ -21,8 +21,8 @@ describe Ollama::Image do
21
21
  end
22
22
 
23
23
  it 'can be converted to base64 string' do
24
- expect(image.to_s.size).to eq 134400
25
- expect(image.to_s.sum).to eq 42460
24
+ expect(image.to_s.size).to eq 132196
25
+ expect(image.to_s.sum).to eq 20420
26
26
  expect(image.to_s[0, 40]).to eq '/9j/4AAQSkZJRgABAQAASABIAAD/4QBYRXhpZgAA'
27
27
  end
28
28
 
@@ -26,7 +26,7 @@ describe Ollama::Message do
26
26
  images: [ image ],
27
27
  )
28
28
  expect(message.to_json).to eq(
29
- '{"role":"user","content":"hello world","thinking":"which world?","images":["dGVzdA==\n"]}'
29
+ '{"role":"user","content":"hello world","thinking":"which world?","images":["dGVzdA=="]}'
30
30
  )
31
31
  end
32
32
 
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.12.0
4
+ version: 1.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Frank