ollama_chat 0.0.40 → 0.0.42
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 +20 -0
- data/Rakefile +1 -1
- data/lib/ollama_chat/chat.rb +3 -2
- data/lib/ollama_chat/ollama_chat_config/default_config.yml +3 -1
- data/lib/ollama_chat/version.rb +1 -1
- data/lib/ollama_chat/vim.rb +7 -4
- data/ollama_chat.gemspec +3 -3
- data/spec/ollama_chat/information_spec.rb +8 -0
- data/spec/ollama_chat/message_list_spec.rb +0 -1
- data/spec/ollama_chat/message_output_spec.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b1136200c7d140c7f9509710887e6e0c490336046306a7447ef61dc11f523622
|
|
4
|
+
data.tar.gz: d9275c4b1b86ba2ac94e7a4d6956c87899481abd34d1471e6d77be7c21ef810b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8dee06aacfff1af99076ae81d509f913a61f539071553f6f86af96b3ee0fb3d1c63f39307d85525ff0f14a382ef44bc35132e7930b10589f062b6a40973cc8e3
|
|
7
|
+
data.tar.gz: b0388f8ac5e679f3ffec9e28008a4f9558d2b09c3c73ebedd58b6821fb6cca62dd25aa16712c29ff36c5117cfbd77bf55f5c48b2412993aa70e650fae1326217
|
data/CHANGES.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# Changes
|
|
2
2
|
|
|
3
|
+
## 2025-12-03 v0.0.42
|
|
4
|
+
|
|
5
|
+
- Updated `ollama-ruby` gem dependency from version **1.7** to **1.14**
|
|
6
|
+
- Fixed JSON serialization issues with image data in Ollama messages
|
|
7
|
+
- Ensured proper base64 encoding and formatting of image URLs
|
|
8
|
+
- Added spec for `display_config` method in `OllamaChat::Information` module
|
|
9
|
+
- Replaced explicit `my_pager` variable with `OllamaChat::EnvConfig::PAGER?` lookup
|
|
10
|
+
- Enabled users to customize pager behavior through environment configuration
|
|
11
|
+
- Updated `lib/ollama_chat/ollama_chat_config/default_config.yml` to prevent shell expansion in voice list command
|
|
12
|
+
- Changed `say -v ?` to `say -v '?'` to prevent shell expansion and potential hanging issues
|
|
13
|
+
|
|
14
|
+
## 2025-11-20 v0.0.41
|
|
15
|
+
|
|
16
|
+
- Fixed message output specification and removed duplicate expectation
|
|
17
|
+
- Added `clientserver` configuration option to `vim` section in `default_config.yml`
|
|
18
|
+
- Updated `OllamaChat::Vim` to accept `clientserver:` keyword argument in `initialize`
|
|
19
|
+
- Modified `insert` and `col` methods in `vim.rb` to use `--clientserver` flag
|
|
20
|
+
- Passed `clientserver` from `chat.rb` when creating `OllamaChat::Vim` instance
|
|
21
|
+
- Set default `clientserver` value to **socket**
|
|
22
|
+
|
|
3
23
|
## 2025-11-20 v0.0.40
|
|
4
24
|
|
|
5
25
|
- Improved Vim server name generation to ensure uniqueness by replacing
|
data/Rakefile
CHANGED
data/lib/ollama_chat/chat.rb
CHANGED
|
@@ -340,7 +340,8 @@ class OllamaChat::Chat
|
|
|
340
340
|
:next
|
|
341
341
|
when %r(^/vim(?:\s+(.+))?$)
|
|
342
342
|
if message = messages.last
|
|
343
|
-
|
|
343
|
+
clientserver = config.vim?&.clientserver
|
|
344
|
+
OllamaChat::Vim.new($1, clientserver:).insert message.content
|
|
344
345
|
else
|
|
345
346
|
STDERR.puts "Warning: No message found to insert into Vim"
|
|
346
347
|
end
|
|
@@ -512,7 +513,7 @@ class OllamaChat::Chat
|
|
|
512
513
|
rendered = config.to_s
|
|
513
514
|
Kramdown::ANSI::Pager.pager(
|
|
514
515
|
lines: rendered.count(?\n),
|
|
515
|
-
command:
|
|
516
|
+
command:
|
|
516
517
|
) do |output|
|
|
517
518
|
output.puts rendered
|
|
518
519
|
end
|
|
@@ -37,7 +37,7 @@ system_prompts:
|
|
|
37
37
|
voice:
|
|
38
38
|
enabled: false
|
|
39
39
|
default: Samantha
|
|
40
|
-
list: <%= `say -v ? 2>/dev/null`.lines.map { |l| l.force_encoding('ASCII-8BIT'); l[/^(.+?)\s+[a-z]{2}_[a-zA-Z0-9]{2,}/, 1] }.uniq.sort.to_s %>
|
|
40
|
+
list: <%= `say -v '?' 2>/dev/null`.lines.map { |l| l.force_encoding('ASCII-8BIT'); l[/^(.+?)\s+[a-z]{2}_[a-zA-Z0-9]{2,}/, 1] }.uniq.sort.to_s %>
|
|
41
41
|
markdown: true
|
|
42
42
|
stream: true
|
|
43
43
|
document_policy: importing
|
|
@@ -78,3 +78,5 @@ web_search:
|
|
|
78
78
|
url: 'https://www.duckduckgo.com/html/?q=%{query}'
|
|
79
79
|
searxng:
|
|
80
80
|
url: <%= OllamaChat::EnvConfig::OLLAMA::SEARXNG_URL %>
|
|
81
|
+
vim:
|
|
82
|
+
clientserver: socket
|
data/lib/ollama_chat/version.rb
CHANGED
data/lib/ollama_chat/vim.rb
CHANGED
|
@@ -17,11 +17,14 @@ class OllamaChat::Vim
|
|
|
17
17
|
# @param server_name [String, nil] The name of the Vim server to connect to.
|
|
18
18
|
# If nil or empty, defaults to a server name derived from the current working
|
|
19
19
|
# directory using {default_server_name}
|
|
20
|
+
# @param clientserver [String] The clientserver protocol to use, defaults to 'socket'
|
|
21
|
+
#
|
|
20
22
|
# @return [OllamaChat::Vim] A new Vim instance configured with the specified
|
|
21
23
|
# server name
|
|
22
|
-
def initialize(server_name)
|
|
24
|
+
def initialize(server_name, clientserver: nil)
|
|
23
25
|
server_name.full? or server_name = self.class.default_server_name
|
|
24
|
-
@server_name
|
|
26
|
+
@server_name = server_name
|
|
27
|
+
@clientserver = clientserver || 'socket'
|
|
25
28
|
end
|
|
26
29
|
|
|
27
30
|
# The default_server_name method generates a standardized server name
|
|
@@ -57,7 +60,7 @@ class OllamaChat::Vim
|
|
|
57
60
|
Tempfile.open do |tmp|
|
|
58
61
|
tmp.write(text)
|
|
59
62
|
tmp.flush
|
|
60
|
-
system %{vim --servername "#@server_name" --remote-send "<ESC>:r #{tmp.path}<CR>"}
|
|
63
|
+
system %{vim --clientserver "#@clientserver" --servername "#@server_name" --remote-send "<ESC>:r #{tmp.path}<CR>"}
|
|
61
64
|
end
|
|
62
65
|
end
|
|
63
66
|
|
|
@@ -68,6 +71,6 @@ class OllamaChat::Vim
|
|
|
68
71
|
# the result of `col('.')`, which represents the current column number (1-indexed)
|
|
69
72
|
# of the cursor position.
|
|
70
73
|
def col
|
|
71
|
-
`vim --servername "#@server_name" --remote-expr "col('.')"`.chomp.to_i
|
|
74
|
+
`vim --clientserver "#@clientserver" --servername "#@server_name" --remote-expr "col('.')"`.chomp.to_i
|
|
72
75
|
end
|
|
73
76
|
end
|
data/ollama_chat.gemspec
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
|
2
|
-
# stub: ollama_chat 0.0.
|
|
2
|
+
# stub: ollama_chat 0.0.42 ruby lib
|
|
3
3
|
|
|
4
4
|
Gem::Specification.new do |s|
|
|
5
5
|
s.name = "ollama_chat".freeze
|
|
6
|
-
s.version = "0.0.
|
|
6
|
+
s.version = "0.0.42".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]
|
|
@@ -33,7 +33,7 @@ Gem::Specification.new do |s|
|
|
|
33
33
|
s.add_development_dependency(%q<simplecov>.freeze, [">= 0".freeze])
|
|
34
34
|
s.add_development_dependency(%q<context_spook>.freeze, [">= 0".freeze])
|
|
35
35
|
s.add_runtime_dependency(%q<excon>.freeze, ["~> 1.0".freeze])
|
|
36
|
-
s.add_runtime_dependency(%q<ollama-ruby>.freeze, ["~> 1.
|
|
36
|
+
s.add_runtime_dependency(%q<ollama-ruby>.freeze, ["~> 1.14".freeze])
|
|
37
37
|
s.add_runtime_dependency(%q<documentrix>.freeze, ["~> 0.0".freeze, ">= 0.0.2".freeze])
|
|
38
38
|
s.add_runtime_dependency(%q<unix_socks>.freeze, ["~> 0.1".freeze])
|
|
39
39
|
s.add_runtime_dependency(%q<rss>.freeze, ["~> 0.3".freeze])
|
|
@@ -29,6 +29,14 @@ describe OllamaChat::Information do
|
|
|
29
29
|
expect(chat.info).to be_nil
|
|
30
30
|
end
|
|
31
31
|
|
|
32
|
+
it 'can display display_config' do
|
|
33
|
+
const_conf_as(
|
|
34
|
+
'OllamaChat::EnvConfig::PAGER' => 'cat'
|
|
35
|
+
)
|
|
36
|
+
expect(chat.config).to receive(:to_s).and_return('test configuration')
|
|
37
|
+
expect { chat.send(:display_config) }.not_to raise_error
|
|
38
|
+
end
|
|
39
|
+
|
|
32
40
|
it 'can show display_chat_help' do
|
|
33
41
|
expect(STDOUT).to receive(:puts).with(%r(/info.*show information))
|
|
34
42
|
expect(chat.display_chat_help).to be_nil
|
|
@@ -66,7 +66,6 @@ describe OllamaChat::MessageList do
|
|
|
66
66
|
|
|
67
67
|
it 'can save conversations' do
|
|
68
68
|
expect(list.save_conversation('tmp/test-conversation.json')).to eq list
|
|
69
|
-
expect(list.save_conversation('tmp/test-conversation.json')).to be_nil
|
|
70
69
|
ensure
|
|
71
70
|
FileUtils.rm_f 'tmp/test-conversation.json'
|
|
72
71
|
end
|
|
@@ -11,7 +11,7 @@ describe OllamaChat::MessageOutput do
|
|
|
11
11
|
expect(STDERR).to receive(:puts).with(/No response available to write to "foo.txt"/)
|
|
12
12
|
expect(chat.output('foo.txt')).to be_nil
|
|
13
13
|
chat.instance_variable_get(:@messages).load_conversation(asset('conversation.json'))
|
|
14
|
-
expect(chat).to receive(:
|
|
14
|
+
expect(chat).to receive(:attempt_to_write_file).and_return true
|
|
15
15
|
expect(STDOUT).to receive(:puts).with(/Last response was written to \"foo.txt\"./)
|
|
16
16
|
expect(chat.output('foo.txt')).to eq chat
|
|
17
17
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ollama_chat
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.42
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Florian Frank
|
|
@@ -141,14 +141,14 @@ dependencies:
|
|
|
141
141
|
requirements:
|
|
142
142
|
- - "~>"
|
|
143
143
|
- !ruby/object:Gem::Version
|
|
144
|
-
version: '1.
|
|
144
|
+
version: '1.14'
|
|
145
145
|
type: :runtime
|
|
146
146
|
prerelease: false
|
|
147
147
|
version_requirements: !ruby/object:Gem::Requirement
|
|
148
148
|
requirements:
|
|
149
149
|
- - "~>"
|
|
150
150
|
- !ruby/object:Gem::Version
|
|
151
|
-
version: '1.
|
|
151
|
+
version: '1.14'
|
|
152
152
|
- !ruby/object:Gem::Dependency
|
|
153
153
|
name: documentrix
|
|
154
154
|
requirement: !ruby/object:Gem::Requirement
|