ollama-ruby 1.1.0 → 1.2.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: dc9d143d1e8c579098ebceb971e448266da56836249e48bbaa54fd484801227e
4
- data.tar.gz: 54ca7b0e5d6e9aae5555baf224444d05d674d1a0f9723d8c8ced60c9dd9885ad
3
+ metadata.gz: b77be573fc0b5bf72e9d46c5ff580454cc5a0fe08a77b95cc607f532b06902c3
4
+ data.tar.gz: 9f8fa137acbac201e5fbf615c791258babeac6185f7656ba14574efa9020fc14
5
5
  SHA512:
6
- metadata.gz: 8d38465b67b00c410ef8ade0116478b61ef148bb0f556e36910e9b0402ad6f3dba1720913f42f5785501f536adc8bf2d3c62cad5fb54578527a6c280bf3eaf30
7
- data.tar.gz: 07ff87834a7ad4983295a896260ee7210100c31bc2887bf6ab3732ec32c041d1d8fde0152c94dade0e4d12c4142b75b517aaebde2e214b784963b4cd6d191369
6
+ metadata.gz: 0f589bf0e5db1f682eae38fe481541c58e843c3511960b8d5bd659a0249661baf975b617b0d47768d33fe2fe7555ce71688bf904b0a2a9a2d7d2bfe06a6bb569
7
+ data.tar.gz: 1257d170eaff46b79838861638860c2ddb491bd7ca9d833fba92c841a4c6e366e70eb234bd7f7ebeeb4542ce98748c414eb58f59aca1151bed148ed16f6c2432
data/CHANGES.md CHANGED
@@ -1,5 +1,16 @@
1
1
  # Changes
2
2
 
3
+ ## 2025-06-01 v1.2.0
4
+
5
+ * Added `tool_calls` parameter to the `initialize` method of the `Message` class:
6
+ * `def initialize(tool_calls: nil)`
7
+ * Updated instance variable assignment in the `initialize` method.
8
+ * Added `:thinking` reader attribute to the `Ollama::Message` class:
9
+ * `attr_reader :thinking`
10
+ * Updated `initialize` method in `Ollama::Message` to accept `thinking` option:
11
+ * `def initialize(thinking: false)`
12
+ * Updated spec tests for `Ollama::Message` with new attributes.
13
+
3
14
  ## 2025-06-01 v1.1.0
4
15
 
5
16
  * Added the `think` option to chat and generate commands:
@@ -1,9 +1,11 @@
1
1
  class Ollama::Message
2
2
  include Ollama::DTO
3
3
 
4
- attr_reader :role, :content, :images
4
+ attr_reader :role, :content, :thinking, :images
5
5
 
6
- def initialize(role:, content:, images: nil, **)
7
- @role, @content, @images = role, content, (Array(images) if images)
6
+ def initialize(role:, content:, thinking: nil, images: nil, tool_calls: nil, **)
7
+ @role, @content, @thinking, @images, @tool_calls =
8
+ role, content, thinking, (Array(images) if images),
9
+ (Array(tool_calls) if tool_calls)
8
10
  end
9
11
  end
@@ -1,6 +1,6 @@
1
1
  module Ollama
2
2
  # Ollama version
3
- VERSION = '1.1.0'
3
+ VERSION = '1.2.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.1.0 ruby lib
2
+ # stub: ollama-ruby 1.2.0 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "ollama-ruby".freeze
6
- s.version = "1.1.0".freeze
6
+ s.version = "1.2.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]
@@ -7,9 +7,10 @@ RSpec.describe Ollama::Message do
7
7
 
8
8
  let :message do
9
9
  described_class.new(
10
- role: 'user',
10
+ role: 'user',
11
11
  content: 'hello world',
12
- images: image
12
+ thinking: 'which world?',
13
+ images: image
13
14
  )
14
15
  end
15
16
 
@@ -21,16 +22,17 @@ RSpec.describe Ollama::Message do
21
22
  expect(message.as_json).to eq(
22
23
  role: 'user',
23
24
  content: 'hello world',
25
+ thinking: 'which world?',
24
26
  images: [ image ],
25
27
  )
26
28
  expect(message.to_json).to eq(
27
- '{"role":"user","content":"hello world","images":["dGVzdA==\n"]}'
29
+ '{"role":"user","content":"hello world","thinking":"which world?","images":["dGVzdA==\n"]}'
28
30
  )
29
31
  end
30
32
 
31
33
  it 'can be restored from JSON' do
32
34
  expect(described_class.from_hash(JSON(<<~'end'))).to be_a described_class
33
- {"role":"user","content":"hello world","images":["dGVzdA==\n"]}
35
+ {"role":"user","content":"hello world","thinking":"which world?","images":["dGVzdA==\n"]}
34
36
  end
35
37
  end
36
38
 
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.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Frank