ollama_chat 0.0.35 → 0.0.36
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 +18 -0
- data/README.md +4 -0
- data/Rakefile +5 -3
- data/docker-compose.yml +1 -1
- data/lib/ollama_chat/chat.rb +11 -7
- data/lib/ollama_chat/dialog.rb +1 -1
- data/lib/ollama_chat/env_config.rb +14 -1
- data/lib/ollama_chat/ollama_chat_config.rb +2 -2
- data/lib/ollama_chat/version.rb +1 -1
- data/ollama_chat.gemspec +3 -4
- metadata +3 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3549c1258a47d46e043e045573d51e41729cc8531ecb5c9746eceb385ff01b99
|
4
|
+
data.tar.gz: cda7120617c155a20326f9a8445207e4b74cbd7faf100ac194b30cdbe4524293
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 88d787dbb1e4e8aa9756b21c5e0a64ab01ab52fdb2ebf84f3f4df6aa65a8b0b4aa03c77c21384ce6e98f156c9dcc9cb711d83d5baf99504e41879f05cc877131
|
7
|
+
data.tar.gz: 55097e08afa04486918e5939062b71d729ec27c14fcc186078f11c631f5c7dba05d8fca6f39a1823abd521acdd6712c06e0f5812c548321cdb3449cae1351549
|
data/CHANGES.md
CHANGED
@@ -1,5 +1,23 @@
|
|
1
1
|
# Changes
|
2
2
|
|
3
|
+
## 2025-10-11 v0.0.36
|
4
|
+
|
5
|
+
- Added `openssl-dev` package to apk packages in Dockerfile
|
6
|
+
- Replaced explicit `_1` parameter syntax with implicit `_1` syntax for
|
7
|
+
compatibility with older Ruby versions
|
8
|
+
- Removed `require 'xdg'` statement from `chat.rb`
|
9
|
+
- Removed `xdg` gem dependency and implemented direct XDG directory usage
|
10
|
+
- Added documentation link to README with a link to the GitHub.io documentation
|
11
|
+
site
|
12
|
+
- Introduced GitHub Actions workflow for static content deployment to GitHub
|
13
|
+
Pages
|
14
|
+
- Updated `gem_hadar` development dependency to version **2.8**
|
15
|
+
- Reordered menu options in dialog prompts to place `[EXIT]` first
|
16
|
+
- Corrected YARD documentation guidelines for `initialize` methods
|
17
|
+
- Updated documentation comments with consistent formatting
|
18
|
+
- Updated Redis (ValKey) image version from **8.1.1** to **8.1.3**
|
19
|
+
- Removed deprecated `REDIS_EXPRING_URL` environment variable from `.envrc`
|
20
|
+
|
3
21
|
## 2025-09-18 v0.0.35
|
4
22
|
|
5
23
|
- Replaced ad-hoc ENV handling with `const_conf` gem for structured
|
data/README.md
CHANGED
@@ -5,6 +5,10 @@
|
|
5
5
|
**ollama_chat** is a chat client, that can be used to connect to an ollama
|
6
6
|
server and enter chat conversations with the LLMs provided by it.
|
7
7
|
|
8
|
+
## Documentation
|
9
|
+
|
10
|
+
Complete API documentation is available at: [GitHub.io](https://flori.github.io/ollama_chat/)
|
11
|
+
|
8
12
|
## Installation (gem)
|
9
13
|
|
10
14
|
To install **ollama_chat**, you can type
|
data/Rakefile
CHANGED
@@ -24,8 +24,7 @@ GemHadar do
|
|
24
24
|
'.yardoc', 'doc', 'tags', 'corpus', 'coverage', '/config/searxng/*',
|
25
25
|
'.starscope.db', 'cscope.out'
|
26
26
|
package_ignore '.all_images.yml', '.tool-versions', '.gitignore', 'VERSION',
|
27
|
-
'.rspec', '.github',
|
28
|
-
|
27
|
+
'.rspec', '.github', '.contexts', '.envrc', '.yardopts'
|
29
28
|
|
30
29
|
readme 'README.md'
|
31
30
|
|
@@ -33,6 +32,10 @@ GemHadar do
|
|
33
32
|
|
34
33
|
executables << 'ollama_chat' << 'ollama_chat_send'
|
35
34
|
|
35
|
+
github_workflows(
|
36
|
+
'static.yml' => {}
|
37
|
+
)
|
38
|
+
|
36
39
|
dependency 'excon', '~> 1.0'
|
37
40
|
dependency 'ollama-ruby', '~> 1.7'
|
38
41
|
dependency 'documentrix', '~> 0.0', '>= 0.0.2'
|
@@ -42,7 +45,6 @@ GemHadar do
|
|
42
45
|
dependency 'redis', '~> 5.0'
|
43
46
|
dependency 'mime-types', '~> 3.0'
|
44
47
|
dependency 'reverse_markdown', '~> 3.0'
|
45
|
-
dependency 'xdg'
|
46
48
|
dependency 'kramdown-ansi', '~> 0.2'
|
47
49
|
dependency 'complex_config', '~> 0.22', '>= 0.22.2'
|
48
50
|
dependency 'tins', '~> 1.41'
|
data/docker-compose.yml
CHANGED
data/lib/ollama_chat/chat.rb
CHANGED
@@ -13,7 +13,6 @@ require 'nokogiri'
|
|
13
13
|
require 'rss'
|
14
14
|
require 'pdf/reader'
|
15
15
|
require 'csv'
|
16
|
-
require 'xdg'
|
17
16
|
require 'socket'
|
18
17
|
require 'shellwords'
|
19
18
|
|
@@ -143,7 +142,7 @@ class OllamaChat::Chat
|
|
143
142
|
# Documentrix::Documents instance.
|
144
143
|
#
|
145
144
|
# @return [Documentrix::Documents] A Documentrix::Documents object containing
|
146
|
-
#
|
145
|
+
# all documents associated with this instance
|
147
146
|
attr_reader :documents
|
148
147
|
|
149
148
|
# Returns the messages set for this object, initializing it lazily if needed.
|
@@ -153,7 +152,7 @@ class OllamaChat::Chat
|
|
153
152
|
# OllamaChat::MessageList instance.
|
154
153
|
#
|
155
154
|
# @return [OllamaChat::MessageList] A MessageList object containing all
|
156
|
-
#
|
155
|
+
# messages associated with this instance
|
157
156
|
attr_reader :messages
|
158
157
|
|
159
158
|
# Returns the links set for this object, initializing it lazily if needed.
|
@@ -202,6 +201,11 @@ class OllamaChat::Chat
|
|
202
201
|
|
203
202
|
private
|
204
203
|
|
204
|
+
# Handles user input commands and processes chat interactions.
|
205
|
+
#
|
206
|
+
# @param content [String] The input content to process
|
207
|
+
# @return [Symbol, String, nil] Returns a symbol indicating next action,
|
208
|
+
# the content to be processed, or nil for no action needed
|
205
209
|
def handle_input(content)
|
206
210
|
case content
|
207
211
|
when %r(^/copy$)
|
@@ -470,7 +474,7 @@ class OllamaChat::Chat
|
|
470
474
|
# specified parameter.
|
471
475
|
#
|
472
476
|
# @param what [ String, nil ] the type of data to clear, defaults to
|
473
|
-
#
|
477
|
+
# 'messages' if nil
|
474
478
|
def clean(what)
|
475
479
|
case what
|
476
480
|
when 'messages', nil
|
@@ -647,7 +651,7 @@ class OllamaChat::Chat
|
|
647
651
|
# configured document collection.
|
648
652
|
#
|
649
653
|
# @return [ Documentrix::Documents, NULL ] the initialized document
|
650
|
-
#
|
654
|
+
# collection if embedding is enabled, otherwise NULL
|
651
655
|
def setup_documents
|
652
656
|
if embedding.on?
|
653
657
|
@embedding_model = config.embedding.model.name
|
@@ -729,7 +733,7 @@ class OllamaChat::Chat
|
|
729
733
|
# expiring keys if a Redis URL is configured.
|
730
734
|
#
|
731
735
|
# @return [ Documentrix::Documents::RedisCache, nil ] the configured Redis
|
732
|
-
#
|
736
|
+
# cache instance or nil if no URL is set.
|
733
737
|
def setup_cache
|
734
738
|
if url = config.redis.expiring.url?
|
735
739
|
ex = config.redis.expiring.ex?.to_i
|
@@ -748,7 +752,7 @@ class OllamaChat::Chat
|
|
748
752
|
# This method exits the program after handling the configuration error
|
749
753
|
#
|
750
754
|
# @param exception [ Exception ] the exception that occurred while reading
|
751
|
-
#
|
755
|
+
# the config file
|
752
756
|
def fix_config(exception)
|
753
757
|
save_conversation('backup.json')
|
754
758
|
STDOUT.puts "When reading the config file, a #{exception.class} "\
|
data/lib/ollama_chat/dialog.rb
CHANGED
@@ -158,7 +158,7 @@ module OllamaChat::Dialog
|
|
158
158
|
if prompts.size == 1
|
159
159
|
system = config.system_prompts.send(prompts.first)
|
160
160
|
else
|
161
|
-
prompts.unshift('[
|
161
|
+
prompts.unshift('[NEW]').unshift('[EXIT]')
|
162
162
|
chosen = OllamaChat::Utils::Chooser.choose(prompts)
|
163
163
|
system =
|
164
164
|
case chosen
|
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'const_conf'
|
2
|
+
require 'pathname'
|
2
3
|
|
3
4
|
module OllamaChat
|
4
5
|
module EnvConfig
|
@@ -7,6 +8,18 @@ module OllamaChat
|
|
7
8
|
description 'Environment config for OllamaChat'
|
8
9
|
prefix ''
|
9
10
|
|
11
|
+
XDG_CONFIG_HOME = set do
|
12
|
+
description 'XDG Configuration directory path'
|
13
|
+
default { '~/.config' }
|
14
|
+
decode { Pathname.new(_1) + 'ollama_chat' }
|
15
|
+
end
|
16
|
+
|
17
|
+
XDG_CACHE_HOME = set do
|
18
|
+
description 'XDG Cache directory path'
|
19
|
+
default { '~/.cache' }
|
20
|
+
decode { Pathname.new(_1) + 'ollama_chat' }
|
21
|
+
end
|
22
|
+
|
10
23
|
PAGER = set do
|
11
24
|
description 'Pager command to use in case terminal lines are exceeded by output'
|
12
25
|
|
@@ -73,7 +86,7 @@ module OllamaChat
|
|
73
86
|
|
74
87
|
DEBUG = set do
|
75
88
|
description 'Enable debugging for chat client'
|
76
|
-
decode {
|
89
|
+
decode { _1.to_i == 1 }
|
77
90
|
default 0
|
78
91
|
end
|
79
92
|
|
@@ -87,7 +87,7 @@ class OllamaChat::OllamaChatConfig
|
|
87
87
|
# @return [ Pathname ] the pathname object representing the configuration
|
88
88
|
# directory
|
89
89
|
def config_dir_path
|
90
|
-
|
90
|
+
OllamaChat::EnvConfig::XDG_CONFIG_HOME
|
91
91
|
end
|
92
92
|
|
93
93
|
# The cache_dir_path method returns the path to the ollama_chat cache
|
@@ -95,7 +95,7 @@ class OllamaChat::OllamaChatConfig
|
|
95
95
|
#
|
96
96
|
# @return [ Pathname ] the pathname object representing the cache directory path
|
97
97
|
def cache_dir_path
|
98
|
-
|
98
|
+
OllamaChat::EnvConfig::XDG_CACHE_HOME
|
99
99
|
end
|
100
100
|
|
101
101
|
# The database_path method constructs the full path to the documents database
|
data/lib/ollama_chat/version.rb
CHANGED
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.36 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.36".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]
|
@@ -24,7 +24,7 @@ Gem::Specification.new do |s|
|
|
24
24
|
|
25
25
|
s.specification_version = 4
|
26
26
|
|
27
|
-
s.add_development_dependency(%q<gem_hadar>.freeze, ["~> 2.
|
27
|
+
s.add_development_dependency(%q<gem_hadar>.freeze, ["~> 2.8".freeze])
|
28
28
|
s.add_development_dependency(%q<all_images>.freeze, ["~> 0.6".freeze])
|
29
29
|
s.add_development_dependency(%q<rspec>.freeze, ["~> 3.2".freeze])
|
30
30
|
s.add_development_dependency(%q<kramdown>.freeze, ["~> 2.0".freeze])
|
@@ -41,7 +41,6 @@ Gem::Specification.new do |s|
|
|
41
41
|
s.add_runtime_dependency(%q<redis>.freeze, ["~> 5.0".freeze])
|
42
42
|
s.add_runtime_dependency(%q<mime-types>.freeze, ["~> 3.0".freeze])
|
43
43
|
s.add_runtime_dependency(%q<reverse_markdown>.freeze, ["~> 3.0".freeze])
|
44
|
-
s.add_runtime_dependency(%q<xdg>.freeze, [">= 0".freeze])
|
45
44
|
s.add_runtime_dependency(%q<kramdown-ansi>.freeze, ["~> 0.2".freeze])
|
46
45
|
s.add_runtime_dependency(%q<complex_config>.freeze, ["~> 0.22".freeze, ">= 0.22.2".freeze])
|
47
46
|
s.add_runtime_dependency(%q<tins>.freeze, ["~> 1.41".freeze])
|
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.36
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Florian Frank
|
@@ -15,14 +15,14 @@ dependencies:
|
|
15
15
|
requirements:
|
16
16
|
- - "~>"
|
17
17
|
- !ruby/object:Gem::Version
|
18
|
-
version: '2.
|
18
|
+
version: '2.8'
|
19
19
|
type: :development
|
20
20
|
prerelease: false
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
22
22
|
requirements:
|
23
23
|
- - "~>"
|
24
24
|
- !ruby/object:Gem::Version
|
25
|
-
version: '2.
|
25
|
+
version: '2.8'
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: all_images
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
@@ -253,20 +253,6 @@ dependencies:
|
|
253
253
|
- - "~>"
|
254
254
|
- !ruby/object:Gem::Version
|
255
255
|
version: '3.0'
|
256
|
-
- !ruby/object:Gem::Dependency
|
257
|
-
name: xdg
|
258
|
-
requirement: !ruby/object:Gem::Requirement
|
259
|
-
requirements:
|
260
|
-
- - ">="
|
261
|
-
- !ruby/object:Gem::Version
|
262
|
-
version: '0'
|
263
|
-
type: :runtime
|
264
|
-
prerelease: false
|
265
|
-
version_requirements: !ruby/object:Gem::Requirement
|
266
|
-
requirements:
|
267
|
-
- - ">="
|
268
|
-
- !ruby/object:Gem::Version
|
269
|
-
version: '0'
|
270
256
|
- !ruby/object:Gem::Dependency
|
271
257
|
name: kramdown-ansi
|
272
258
|
requirement: !ruby/object:Gem::Requirement
|