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 +4 -4
- data/CHANGES.md +11 -0
- data/lib/ollama/message.rb +5 -3
- data/lib/ollama/version.rb +1 -1
- data/ollama-ruby.gemspec +2 -2
- data/spec/ollama/message_spec.rb +6 -4
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b77be573fc0b5bf72e9d46c5ff580454cc5a0fe08a77b95cc607f532b06902c3
|
4
|
+
data.tar.gz: 9f8fa137acbac201e5fbf615c791258babeac6185f7656ba14574efa9020fc14
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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:
|
data/lib/ollama/message.rb
CHANGED
@@ -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, @
|
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
|
data/lib/ollama/version.rb
CHANGED
data/ollama-ruby.gemspec
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
# stub: ollama-ruby 1.
|
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.
|
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]
|
data/spec/ollama/message_spec.rb
CHANGED
@@ -7,9 +7,10 @@ RSpec.describe Ollama::Message do
|
|
7
7
|
|
8
8
|
let :message do
|
9
9
|
described_class.new(
|
10
|
-
role:
|
10
|
+
role: 'user',
|
11
11
|
content: 'hello world',
|
12
|
-
|
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
|
|