ollama_chat 0.0.26 → 0.0.28
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/.utilsrc +68 -0
- data/CHANGES.md +98 -40
- data/Rakefile +6 -2
- data/lib/ollama_chat/ollama_chat_config/default_config.yml +1 -1
- data/lib/ollama_chat/server_socket.rb +6 -2
- data/lib/ollama_chat/utils/cache_fetcher.rb +2 -0
- data/lib/ollama_chat/utils/fetcher.rb +2 -1
- data/lib/ollama_chat/version.rb +1 -1
- data/ollama_chat.gemspec +5 -5
- metadata +8 -16
- data/.all_images.yml +0 -16
- data/.contexts/code_comment.rb +0 -25
- data/.contexts/full.rb +0 -31
- data/.contexts/info.rb +0 -17
- data/.contexts/lib.rb +0 -25
- data/.contexts/yard.md +0 -94
- data/.envrc +0 -2
- data/.gitignore +0 -11
- data/VERSION +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e18a688ad95c46f3776624e926def4eca5bd3f138321b2cdeec13f32606aceb
|
4
|
+
data.tar.gz: 68c632100120653785b5f2747db5e5da254550bdd1de80a70cdbf16c1db56e8a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 94621d91d0fcec33e3695768b52ceeea30dc69728d92e0cdf1966751d23abc059df07543efc9ab87e547277050a39b6ea572ab7aab7db639dcc65b19a540c494
|
7
|
+
data.tar.gz: 4780b91d49114e137363b6281cce78ef467d5e2c2a566f311fcc87d65aaad029d80e14cf522db9ba89050700e07a2645ea8f32c2eb0b062c9f4840b1b2bf4dd0
|
data/.utilsrc
ADDED
@@ -0,0 +1,68 @@
|
|
1
|
+
# vim: set ft=ruby:
|
2
|
+
|
3
|
+
search do
|
4
|
+
prune_dirs /\A(\.svn|\.git|\.terraform|CVS|tmp|coverage|corpus|pkg|\.yardoc|doc)\z/
|
5
|
+
skip_files /(\A\.|\.sw[pon]\z|\.(log|fnm|jpg|jpeg|png|pdf|svg)\z|\A(tags|cscope\.out)\z|~\z)/i
|
6
|
+
end
|
7
|
+
|
8
|
+
discover do
|
9
|
+
prune_dirs /\A(\.svn|\.git|\.terraform|\.yardoc|CVS|tmp|coverage|corpus|pkg|\.yardoc|doc)\z/
|
10
|
+
skip_files /(\A\.|\.sw[pon]\z|\.log\z|~\z)/
|
11
|
+
index_expire_after 3_600
|
12
|
+
end
|
13
|
+
|
14
|
+
strip_spaces do
|
15
|
+
prune_dirs /\A(\..*|CVS|pkg|\.yardoc)\z/
|
16
|
+
skip_files /(\A\.|\.sw[pon]\z|\.log\z|~\z)/
|
17
|
+
end
|
18
|
+
|
19
|
+
probe do
|
20
|
+
test_framework :rspec
|
21
|
+
end
|
22
|
+
|
23
|
+
ssh_tunnel do
|
24
|
+
terminal_multiplexer :tmux
|
25
|
+
login_session "/home/#{ENV['USER']}"
|
26
|
+
end
|
27
|
+
|
28
|
+
classify do
|
29
|
+
shift_path_by_default 1
|
30
|
+
end
|
31
|
+
|
32
|
+
code_indexer do
|
33
|
+
verbose false
|
34
|
+
|
35
|
+
gems = %w[
|
36
|
+
amatch
|
37
|
+
base64
|
38
|
+
bigdecimal
|
39
|
+
complex_config
|
40
|
+
date
|
41
|
+
documentrix
|
42
|
+
excon
|
43
|
+
json
|
44
|
+
kramdown-ansi
|
45
|
+
mize
|
46
|
+
more_math
|
47
|
+
ollama-ruby
|
48
|
+
ostruct
|
49
|
+
reverse_markdown
|
50
|
+
rspec
|
51
|
+
rspec-core
|
52
|
+
rspec-expectations
|
53
|
+
rspec-mocks
|
54
|
+
rspec-support
|
55
|
+
search_ui
|
56
|
+
sqlite3
|
57
|
+
stringio
|
58
|
+
term-ansicolor
|
59
|
+
tins
|
60
|
+
unix_socks
|
61
|
+
webmock
|
62
|
+
xdg
|
63
|
+
]
|
64
|
+
|
65
|
+
paths {
|
66
|
+
%w[ lib ] + gems.map { `bundle show #{it}` }.map(&:chomp)
|
67
|
+
}
|
68
|
+
end
|
data/CHANGES.md
CHANGED
@@ -1,5 +1,24 @@
|
|
1
1
|
# Changes
|
2
2
|
|
3
|
+
## 2025-09-08 v0.0.28
|
4
|
+
|
5
|
+
- Replaced `server_socket_runtime_dir` config option with
|
6
|
+
`working_dir_dependent_socket`
|
7
|
+
- Used `Digest::MD5` to generate unique socket names based on working directory
|
8
|
+
- Socket names now follow format `ollama_chat-<hash>.sock` instead of fixed
|
9
|
+
name
|
10
|
+
- Updated `unix_socks` dependency version constraint from >= 0.0.1 to ~> 0.1
|
11
|
+
- Added new `.utilsrc` configuration file for code indexing and search
|
12
|
+
utilities
|
13
|
+
- Added return type documentation to `CacheFetcher#get` method
|
14
|
+
|
15
|
+
## 2025-09-05 v0.0.27
|
16
|
+
|
17
|
+
- Enhanced cache hit notifications to properly handle content type with
|
18
|
+
fallback to 'unknown'
|
19
|
+
- Modified `OllamaChat::Utils::CacheFetcher` to return `io` for proper content
|
20
|
+
type propagation
|
21
|
+
|
3
22
|
## 2025-08-27 v0.0.26
|
4
23
|
|
5
24
|
- Enhanced `/last` command to support numeric argument, allowing users to
|
@@ -42,22 +61,31 @@
|
|
42
61
|
## 2025-08-17 v0.0.24
|
43
62
|
|
44
63
|
- Updated `kramdown-ansi` dependency version constraint from **0.0** to **0.1**
|
45
|
-
- Modified both Rakefile and ollama_chat.gemspec files to reflect new version
|
64
|
+
- Modified both Rakefile and `ollama_chat.gemspec` files to reflect new version
|
46
65
|
constraint for `kramdown-ansi`
|
47
66
|
|
48
67
|
## 2025-08-17 v0.0.23
|
49
68
|
|
50
|
-
- Added `OllamaChat::KramdownANSI` module with `configure_kramdown_ansi_styles`
|
51
|
-
|
69
|
+
- Added `OllamaChat::KramdownANSI` module with `configure_kramdown_ansi_styles`
|
70
|
+
and `kramdown_ansi_parse` methods for consistent Markdown formatting
|
71
|
+
- Replaced direct calls to `Kramdown::ANSI.parse` with
|
72
|
+
`@chat.kramdown_ansi_parse` in `FollowChat` and `MessageList`
|
52
73
|
- Integrated `OllamaChat::KramdownANSI` module into `OllamaChat::Chat` class
|
53
74
|
- Configured `@kramdown_ansi_styles` during chat initialization
|
54
|
-
- Added support for environment variables `KRAMDOWN_ANSI_OLLAMA_CHAT_STYLES`
|
55
|
-
|
56
|
-
-
|
57
|
-
|
58
|
-
-
|
59
|
-
|
60
|
-
- Added
|
75
|
+
- Added support for environment variables `KRAMDOWN_ANSI_OLLAMA_CHAT_STYLES`
|
76
|
+
and `KRAMDOWN_ANSI_STYLES` for styling configuration
|
77
|
+
- Updated tests to mock `kramdown_ansi_parse` instead of direct
|
78
|
+
`Kramdown::ANSI.parse`
|
79
|
+
- Documented environment variables for customizing Markdown formatting with
|
80
|
+
example JSON format
|
81
|
+
- Added `lib/ollama_chat/kramdown_ansi.rb` to `extra_rdoc_files` and `files`
|
82
|
+
list in gemspec
|
83
|
+
- Escaped dot in regex pattern in `parsing_spec.rb` for proper image file
|
84
|
+
matching
|
85
|
+
- Implemented `File.expand_path` to resolve `~` shortcuts before existence
|
86
|
+
check in parsing module
|
87
|
+
- Added error handling for malformed paths by rescuing `ArgumentError`
|
88
|
+
exceptions
|
61
89
|
- Skipped invalid file paths during processing loop using `next` statement
|
62
90
|
- Maintained backward compatibility for standard file paths
|
63
91
|
- Added comprehensive list of supported environment variables in documentation
|
@@ -65,14 +93,19 @@
|
|
65
93
|
## 2025-08-13 v0.0.22
|
66
94
|
|
67
95
|
- Added new `-p` command line flag for enabling source parsing functionality
|
68
|
-
- Enhanced `send_to_server_socket` method to accept and pass a `parse`
|
96
|
+
- Enhanced `send_to_server_socket` method to accept and pass a `parse`
|
97
|
+
parameter
|
69
98
|
- Modified `chat.rb` to handle the `parse` content flag from server messages
|
70
99
|
- Updated documentation in `README.md` with example usage of the new `-p` flag
|
71
|
-
- Added comprehensive tests for the new parsing functionality in
|
72
|
-
|
73
|
-
-
|
100
|
+
- Added comprehensive tests for the new parsing functionality in
|
101
|
+
`server_socket_spec.rb`
|
102
|
+
- Improved method documentation in `server_socket.rb` with detailed parameter
|
103
|
+
descriptions
|
104
|
+
- Replaced `messages.list_conversation(2)` with `messages.show_last` in `/drop`
|
105
|
+
command behavior
|
74
106
|
- Updated `gem_hadar` development dependency from version **1.27** to **2.0**
|
75
|
-
- Simplified SimpleCov setup by using `GemHadar::SimpleCov.start` instead of
|
107
|
+
- Simplified SimpleCov setup by using `GemHadar::SimpleCov.start` instead of
|
108
|
+
manual configuration
|
76
109
|
|
77
110
|
## 2025-08-11 v0.0.21
|
78
111
|
|
@@ -94,7 +127,8 @@
|
|
94
127
|
|
95
128
|
### Documentation
|
96
129
|
|
97
|
-
- Added more YARD-style documentation to all public methods throughout the
|
130
|
+
- Added more YARD-style documentation to all public methods throughout the
|
131
|
+
codebase.
|
98
132
|
|
99
133
|
### Fixed
|
100
134
|
|
@@ -167,8 +201,10 @@
|
|
167
201
|
- **Enhancements**
|
168
202
|
- Improved logging with debug output for received server socket messages.
|
169
203
|
- Refactored server socket handling:
|
170
|
-
- Created `create_socket_server` method for UnixSocks setup with
|
171
|
-
|
204
|
+
- Created `create_socket_server` method for UnixSocks setup with
|
205
|
+
configurable runtime directories.
|
206
|
+
- Updated `send_to_server_socket` and `init_server_socket` methods to use
|
207
|
+
the new helper.
|
172
208
|
- Changed evaluation rate metrics from 'c/s' to 't/s' for better clarity.
|
173
209
|
|
174
210
|
- **Documentation**
|
@@ -226,37 +262,48 @@
|
|
226
262
|
|
227
263
|
* **Think Mode Implementation**:
|
228
264
|
+ Introduced `@think_mode` attribute to read think mode setting from config
|
229
|
-
+ Implemented `remove_think_blocks` method to filter out thought blocks from
|
230
|
-
|
265
|
+
+ Implemented `remove_think_blocks` method to filter out thought blocks from
|
266
|
+
chat messages sent to the LLM model.
|
267
|
+
+ Added conditional logic based on `@think_mode` value to handle different
|
268
|
+
modes
|
231
269
|
* **User Interface Improvements**:
|
232
270
|
+ Added `/think_mode` command to help users understand think mode options
|
233
271
|
+ Updated session output to include current think mode
|
234
|
-
+ Added think mode chooser to OllamaChat::Dialog, allowing users to select
|
272
|
+
+ Added think mode chooser to OllamaChat::Dialog, allowing users to select
|
273
|
+
their preferred think mode
|
235
274
|
* **Output Handling Enhancements**:
|
236
275
|
+ Improved markdown handling for think blocks in OllamaChat::FollowChat class
|
237
|
-
+ Modified output to print clear screen, move home, and user info before
|
276
|
+
+ Modified output to print clear screen, move home, and user info before
|
277
|
+
printing content
|
238
278
|
* **Configuration Updates**:
|
239
279
|
+ Added `think_mode` key with value `"display"` to `default_config.yml`
|
240
280
|
|
241
281
|
## 2025-05-28 v0.0.10
|
242
282
|
|
243
283
|
* Simplify and improve command handling logic.
|
244
|
-
* Update chat input handling to use a single `handle_input` method for all
|
284
|
+
* Update chat input handling to use a single `handle_input` method for all
|
285
|
+
commands.
|
245
286
|
* Add tests for various chat commands, including input handling, document
|
246
287
|
policy selection, summarization, and more.
|
247
|
-
* Improve test coverage for `DocumentCache`, `Information`, and other
|
248
|
-
|
288
|
+
* Improve test coverage for `DocumentCache`, `Information`, and other
|
289
|
+
modules.
|
290
|
+
* Improved handling of commands, e.g. **don't** when sending via
|
291
|
+
`ollama_chat_send` by default.
|
249
292
|
* Added support for sending content to server socket with specific type.
|
250
293
|
|
251
294
|
## 2025-05-26 v0.0.9
|
252
295
|
|
253
296
|
* Improved tag parsing in OllamaChat:
|
254
297
|
* Added regex validation for valid tags to `Documentrix::Utils::Tags`.
|
255
|
-
* Modified `parse_content` method in `OllamaChat::Parsing` to handle valid
|
256
|
-
|
257
|
-
*
|
298
|
+
* Modified `parse_content` method in `OllamaChat::Parsing` to handle valid
|
299
|
+
tag formats.
|
300
|
+
* Updated `scan` methods in `content` processing to more correctly identify
|
301
|
+
tags.
|
302
|
+
* Added option to explicitly open socket for receiving input from
|
303
|
+
`ollama_chat_send`:
|
258
304
|
* Added new command-line option `-S` to enable server socket functionality.
|
259
|
-
* Updated `OllamaChat::Chat` class to include server socket initialization
|
305
|
+
* Updated `OllamaChat::Chat` class to include server socket initialization
|
306
|
+
based on the new option.
|
260
307
|
* Modified usage message in `README.md` and `information.rb` files.
|
261
308
|
|
262
309
|
## 2025-05-23 v0.0.8
|
@@ -298,9 +345,12 @@
|
|
298
345
|
## 2025-04-15 v0.0.6
|
299
346
|
|
300
347
|
* Updated Rakefile to use `ollama-ruby` version **1.0**.
|
301
|
-
* Modified `model_present?` method in `lib/ollama_chat/model_handling.rb` to
|
302
|
-
|
303
|
-
*
|
348
|
+
* Modified `model_present?` method in `lib/ollama_chat/model_handling.rb` to
|
349
|
+
use `ollama.show(model:)`.
|
350
|
+
* Changed `pull_model_from_remote` method in
|
351
|
+
`lib/ollama_chat/model_handling.rb` to use `ollama.pull(model:).
|
352
|
+
* Updated `ollama_chat.gemspec` to use `ollama-ruby` version **1.0** and
|
353
|
+
updated date to **2025-04-14**.
|
304
354
|
* Attempt to capture stderr as well by redirecting stderr to stdout for
|
305
355
|
commands that output to it always or in the error case.
|
306
356
|
* Updated development dependencies in `ollama_chat.gemspec`.
|
@@ -309,7 +359,8 @@
|
|
309
359
|
|
310
360
|
* Updated default config to use environment variable for Searxng URL:
|
311
361
|
* Changed `url` field in `searxng` section of `default_config.yml`.
|
312
|
-
* Replaced hardcoded URL with expression that fetches value from
|
362
|
+
* Replaced hardcoded URL with expression that fetches value from
|
363
|
+
`OLLAMA_SEARXNG_URL` environment variable.
|
313
364
|
* Handle Ollama server disconnection:
|
314
365
|
* Added error handling for `Ollama::Errors::TimeoutError`.
|
315
366
|
* Print error message when connection is lost.
|
@@ -329,18 +380,23 @@
|
|
329
380
|
for web searching with all engines.
|
330
381
|
+ Updated `ollama_chat/chat.rb` to use the new `web_searching` module and
|
331
382
|
updated the `search_web` method to return results from either engine.
|
332
|
-
+ Added specs in `spec/ollama_chat/web_searching_spec.rb` to test the new
|
383
|
+
+ Added specs in `spec/ollama_chat/web_searching_spec.rb` to test the new
|
384
|
+
functionality.
|
333
385
|
* Added ollama chat version display to information module and spec:
|
334
|
-
+ Added `STDOUT.puts` for displaying ollama chat version in
|
335
|
-
|
386
|
+
+ Added `STDOUT.puts` for displaying ollama chat version in
|
387
|
+
`lib/ollama_chat/information.rb`
|
388
|
+
+ Updated test in `spec/ollama_chat/chat_spec.rb` to include new output
|
389
|
+
string
|
336
390
|
* Update chat document redis cache expiration time default to 0.
|
337
391
|
|
338
392
|
## 2025-02-17 v0.0.3
|
339
393
|
|
340
394
|
* Support setting of request headers:
|
341
395
|
* Added `request_headers` option to `default_config.yml
|
342
|
-
* Updated `OllamaChat::SourceFetching` module to pass
|
343
|
-
|
396
|
+
* Updated `OllamaChat::SourceFetching` module to pass
|
397
|
+
`config.request_headers?.to_h` to `Fetcher.get`
|
398
|
+
* Updated `OllamaChat::Utils::Fetcher.get` method to take an optional
|
399
|
+
`headers:` parameter
|
344
400
|
* Updated tests for Fetcher utility to include new headers option
|
345
401
|
* Refactoring
|
346
402
|
* Added `connect_to_ollama_server` method to `spec_helper.rb`
|
@@ -372,8 +428,10 @@
|
|
372
428
|
## 2025-02-02 v0.0.1
|
373
429
|
|
374
430
|
* Renamed `documents` variable to `@documents` in `OllamaChat::Chat`
|
375
|
-
* Modified `add_documents_from_argv` method to accept only `document_list`
|
376
|
-
|
431
|
+
* Modified `add_documents_from_argv` method to accept only `document_list`
|
432
|
+
as argument
|
433
|
+
* Updated spec for `OllamaChat::Chat` to reflect changes in
|
434
|
+
`add_documents_from_argv` method
|
377
435
|
* Use `clamp(1..)` instead of manual checks for `n.to_i` in source fetching
|
378
436
|
* Dropped is now used consistently in the code for message popping
|
379
437
|
* Set up Redis environment and service for development:
|
data/Rakefile
CHANGED
@@ -21,7 +21,11 @@ GemHadar do
|
|
21
21
|
|
22
22
|
test_dir 'spec'
|
23
23
|
ignore '.*.sw[pon]', 'pkg', 'Gemfile.lock', '.AppleDouble', '.bundle',
|
24
|
-
'.yardoc', 'doc', 'tags', 'corpus', 'coverage', '/config/searxng/*'
|
24
|
+
'.yardoc', 'doc', 'tags', 'corpus', 'coverage', '/config/searxng/*',
|
25
|
+
'.starscope.db', 'cscope.out'
|
26
|
+
package_ignore '.all_images.yml', '.tool-versions', '.gitignore', 'VERSION',
|
27
|
+
'.rspec', '.github', *FileList['.contexts/*'], '.envrc'
|
28
|
+
|
25
29
|
|
26
30
|
readme 'README.md'
|
27
31
|
|
@@ -32,7 +36,7 @@ GemHadar do
|
|
32
36
|
dependency 'excon', '~> 1.0'
|
33
37
|
dependency 'ollama-ruby', '~> 1.6'
|
34
38
|
dependency 'documentrix', '~> 0.0', '>= 0.0.2'
|
35
|
-
dependency 'unix_socks', '
|
39
|
+
dependency 'unix_socks', '~> 0.1'
|
36
40
|
dependency 'rss', '~> 0.3'
|
37
41
|
dependency 'term-ansicolor', '~> 1.11'
|
38
42
|
dependency 'redis', '~> 5.0'
|
@@ -64,7 +64,7 @@ redis:
|
|
64
64
|
url: <%= ENV.fetch('REDIS_EXPIRING_URL', 'null') %>
|
65
65
|
ex: 86400
|
66
66
|
chat_history_filename: <%= ENV.fetch('OLLAMA_CHAT_HISTORY', '~/.ollama_chat_history') %>
|
67
|
-
|
67
|
+
working_dir_dependent_socket: true
|
68
68
|
debug: <%= ENV['OLLAMA_CHAT_DEBUG'].to_i == 1 ? true : false %>
|
69
69
|
request_headers:
|
70
70
|
Accept: 'text/*,application/*,image/*'
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'digest/md5'
|
2
|
+
|
1
3
|
# A module that provides server socket functionality for OllamaChat
|
2
4
|
#
|
3
5
|
# The ServerSocket module encapsulates the logic for creating and managing Unix
|
@@ -70,8 +72,10 @@ module OllamaChat::ServerSocket
|
|
70
72
|
if runtime_dir
|
71
73
|
return UnixSocks::Server.new(socket_name: 'ollama_chat.sock', runtime_dir:)
|
72
74
|
end
|
73
|
-
if
|
74
|
-
|
75
|
+
if config.working_dir_dependent_socket
|
76
|
+
path = File.expand_path(Dir.pwd)
|
77
|
+
digest = Digest::MD5.hexdigest(path)
|
78
|
+
UnixSocks::Server.new(socket_name: "ollama_chat-#{digest}.sock")
|
75
79
|
else
|
76
80
|
UnixSocks::Server.new(socket_name: 'ollama_chat.sock')
|
77
81
|
end
|
@@ -34,6 +34,7 @@ class OllamaChat::Utils::CacheFetcher
|
|
34
34
|
# @param url [ String ] the URL used as a key for caching
|
35
35
|
#
|
36
36
|
# @yield [ io ] yields the cached IO object if found
|
37
|
+
# @return [ io ] the cached IO object if found
|
37
38
|
def get(url, &block)
|
38
39
|
block or raise ArgumentError, 'require block argument'
|
39
40
|
body = @cache[key(:body, url)]
|
@@ -45,6 +46,7 @@ class OllamaChat::Utils::CacheFetcher
|
|
45
46
|
io.extend(OllamaChat::Utils::Fetcher::HeaderExtension)
|
46
47
|
io.content_type = content_type
|
47
48
|
block.(io)
|
49
|
+
io
|
48
50
|
end
|
49
51
|
end
|
50
52
|
|
@@ -92,7 +92,8 @@ class OllamaChat::Utils::Fetcher
|
|
92
92
|
cache = OllamaChat::Utils::CacheFetcher.new(cache)
|
93
93
|
cache and infobar.puts "Getting #{url.to_s.inspect} via cache…"
|
94
94
|
if result = cache&.get(url, &block)
|
95
|
-
|
95
|
+
content_type = result&.content_type || 'unknown'
|
96
|
+
infobar.puts "…hit, found #{content_type} content in cache."
|
96
97
|
return result
|
97
98
|
else
|
98
99
|
new(**options).send(:get, url, headers:) do |tmp|
|
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.28 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.28".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]
|
@@ -13,7 +13,7 @@ Gem::Specification.new do |s|
|
|
13
13
|
s.email = "flori@ping.de".freeze
|
14
14
|
s.executables = ["ollama_chat".freeze, "ollama_chat_send".freeze]
|
15
15
|
s.extra_rdoc_files = ["README.md".freeze, "lib/ollama_chat.rb".freeze, "lib/ollama_chat/chat.rb".freeze, "lib/ollama_chat/clipboard.rb".freeze, "lib/ollama_chat/dialog.rb".freeze, "lib/ollama_chat/document_cache.rb".freeze, "lib/ollama_chat/follow_chat.rb".freeze, "lib/ollama_chat/history.rb".freeze, "lib/ollama_chat/information.rb".freeze, "lib/ollama_chat/kramdown_ansi.rb".freeze, "lib/ollama_chat/message_format.rb".freeze, "lib/ollama_chat/message_list.rb".freeze, "lib/ollama_chat/message_output.rb".freeze, "lib/ollama_chat/model_handling.rb".freeze, "lib/ollama_chat/ollama_chat_config.rb".freeze, "lib/ollama_chat/parsing.rb".freeze, "lib/ollama_chat/server_socket.rb".freeze, "lib/ollama_chat/source_fetching.rb".freeze, "lib/ollama_chat/switches.rb".freeze, "lib/ollama_chat/utils.rb".freeze, "lib/ollama_chat/utils/cache_fetcher.rb".freeze, "lib/ollama_chat/utils/chooser.rb".freeze, "lib/ollama_chat/utils/fetcher.rb".freeze, "lib/ollama_chat/utils/file_argument.rb".freeze, "lib/ollama_chat/version.rb".freeze, "lib/ollama_chat/vim.rb".freeze, "lib/ollama_chat/web_searching.rb".freeze]
|
16
|
-
s.files = [".
|
16
|
+
s.files = [".utilsrc".freeze, "CHANGES.md".freeze, "Gemfile".freeze, "README.md".freeze, "Rakefile".freeze, "bin/ollama_chat".freeze, "bin/ollama_chat_send".freeze, "config/searxng/settings.yml".freeze, "docker-compose.yml".freeze, "lib/ollama_chat.rb".freeze, "lib/ollama_chat/chat.rb".freeze, "lib/ollama_chat/clipboard.rb".freeze, "lib/ollama_chat/dialog.rb".freeze, "lib/ollama_chat/document_cache.rb".freeze, "lib/ollama_chat/follow_chat.rb".freeze, "lib/ollama_chat/history.rb".freeze, "lib/ollama_chat/information.rb".freeze, "lib/ollama_chat/kramdown_ansi.rb".freeze, "lib/ollama_chat/message_format.rb".freeze, "lib/ollama_chat/message_list.rb".freeze, "lib/ollama_chat/message_output.rb".freeze, "lib/ollama_chat/model_handling.rb".freeze, "lib/ollama_chat/ollama_chat_config.rb".freeze, "lib/ollama_chat/ollama_chat_config/default_config.yml".freeze, "lib/ollama_chat/parsing.rb".freeze, "lib/ollama_chat/server_socket.rb".freeze, "lib/ollama_chat/source_fetching.rb".freeze, "lib/ollama_chat/switches.rb".freeze, "lib/ollama_chat/utils.rb".freeze, "lib/ollama_chat/utils/cache_fetcher.rb".freeze, "lib/ollama_chat/utils/chooser.rb".freeze, "lib/ollama_chat/utils/fetcher.rb".freeze, "lib/ollama_chat/utils/file_argument.rb".freeze, "lib/ollama_chat/version.rb".freeze, "lib/ollama_chat/vim.rb".freeze, "lib/ollama_chat/web_searching.rb".freeze, "ollama_chat.gemspec".freeze, "redis/redis.conf".freeze, "spec/assets/api_show.json".freeze, "spec/assets/api_tags.json".freeze, "spec/assets/api_version.json".freeze, "spec/assets/conversation.json".freeze, "spec/assets/duckduckgo.html".freeze, "spec/assets/example.atom".freeze, "spec/assets/example.csv".freeze, "spec/assets/example.html".freeze, "spec/assets/example.pdf".freeze, "spec/assets/example.ps".freeze, "spec/assets/example.rb".freeze, "spec/assets/example.rss".freeze, "spec/assets/example.xml".freeze, "spec/assets/kitten.jpg".freeze, "spec/assets/prompt.txt".freeze, "spec/assets/searxng.json".freeze, "spec/ollama_chat/chat_spec.rb".freeze, "spec/ollama_chat/clipboard_spec.rb".freeze, "spec/ollama_chat/follow_chat_spec.rb".freeze, "spec/ollama_chat/information_spec.rb".freeze, "spec/ollama_chat/kramdown_ansi_spec.rb".freeze, "spec/ollama_chat/message_list_spec.rb".freeze, "spec/ollama_chat/message_output_spec.rb".freeze, "spec/ollama_chat/model_handling_spec.rb".freeze, "spec/ollama_chat/parsing_spec.rb".freeze, "spec/ollama_chat/server_socket_spec.rb".freeze, "spec/ollama_chat/source_fetching_spec.rb".freeze, "spec/ollama_chat/switches_spec.rb".freeze, "spec/ollama_chat/utils/cache_fetcher_spec.rb".freeze, "spec/ollama_chat/utils/fetcher_spec.rb".freeze, "spec/ollama_chat/utils/file_argument_spec.rb".freeze, "spec/ollama_chat/web_searching_spec.rb".freeze, "spec/spec_helper.rb".freeze, "tmp/.keep".freeze]
|
17
17
|
s.homepage = "https://github.com/flori/ollama_chat".freeze
|
18
18
|
s.licenses = ["MIT".freeze]
|
19
19
|
s.rdoc_options = ["--title".freeze, "OllamaChat - A command-line interface (CLI) for interacting with an Ollama AI model.".freeze, "--main".freeze, "README.md".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.2".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])
|
@@ -35,7 +35,7 @@ Gem::Specification.new do |s|
|
|
35
35
|
s.add_runtime_dependency(%q<excon>.freeze, ["~> 1.0".freeze])
|
36
36
|
s.add_runtime_dependency(%q<ollama-ruby>.freeze, ["~> 1.6".freeze])
|
37
37
|
s.add_runtime_dependency(%q<documentrix>.freeze, ["~> 0.0".freeze, ">= 0.0.2".freeze])
|
38
|
-
s.add_runtime_dependency(%q<unix_socks>.freeze, ["
|
38
|
+
s.add_runtime_dependency(%q<unix_socks>.freeze, ["~> 0.1".freeze])
|
39
39
|
s.add_runtime_dependency(%q<rss>.freeze, ["~> 0.3".freeze])
|
40
40
|
s.add_runtime_dependency(%q<term-ansicolor>.freeze, ["~> 1.11".freeze])
|
41
41
|
s.add_runtime_dependency(%q<redis>.freeze, ["~> 5.0".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.28
|
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.2'
|
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.2'
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: all_images
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
@@ -173,16 +173,16 @@ dependencies:
|
|
173
173
|
name: unix_socks
|
174
174
|
requirement: !ruby/object:Gem::Requirement
|
175
175
|
requirements:
|
176
|
-
- - "
|
176
|
+
- - "~>"
|
177
177
|
- !ruby/object:Gem::Version
|
178
|
-
version: 0.
|
178
|
+
version: '0.1'
|
179
179
|
type: :runtime
|
180
180
|
prerelease: false
|
181
181
|
version_requirements: !ruby/object:Gem::Requirement
|
182
182
|
requirements:
|
183
|
-
- - "
|
183
|
+
- - "~>"
|
184
184
|
- !ruby/object:Gem::Version
|
185
|
-
version: 0.
|
185
|
+
version: '0.1'
|
186
186
|
- !ruby/object:Gem::Dependency
|
187
187
|
name: rss
|
188
188
|
requirement: !ruby/object:Gem::Requirement
|
@@ -413,19 +413,11 @@ extra_rdoc_files:
|
|
413
413
|
- lib/ollama_chat/vim.rb
|
414
414
|
- lib/ollama_chat/web_searching.rb
|
415
415
|
files:
|
416
|
-
- ".
|
417
|
-
- ".contexts/code_comment.rb"
|
418
|
-
- ".contexts/full.rb"
|
419
|
-
- ".contexts/info.rb"
|
420
|
-
- ".contexts/lib.rb"
|
421
|
-
- ".contexts/yard.md"
|
422
|
-
- ".envrc"
|
423
|
-
- ".gitignore"
|
416
|
+
- ".utilsrc"
|
424
417
|
- CHANGES.md
|
425
418
|
- Gemfile
|
426
419
|
- README.md
|
427
420
|
- Rakefile
|
428
|
-
- VERSION
|
429
421
|
- bin/ollama_chat
|
430
422
|
- bin/ollama_chat_send
|
431
423
|
- config/searxng/settings.yml
|
data/.all_images.yml
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
dockerfile: |-
|
2
|
-
RUN apk add --no-cache build-base git yaml-dev
|
3
|
-
RUN gem install gem_hadar
|
4
|
-
|
5
|
-
script: &script |-
|
6
|
-
echo -e "\e[1m"
|
7
|
-
ruby -v
|
8
|
-
rm -f Gemfile.lock
|
9
|
-
bundle install --jobs=$(getconf _NPROCESSORS_ONLN)
|
10
|
-
echo -e "\e[0m"
|
11
|
-
rake test
|
12
|
-
|
13
|
-
images:
|
14
|
-
ruby:3.4-alpine: *script
|
15
|
-
ruby:3.3-alpine: *script
|
16
|
-
ruby:3.2-alpine: *script
|
data/.contexts/code_comment.rb
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
context do
|
2
|
-
namespace "lib" do
|
3
|
-
Dir['lib/**/*.rb'].each do |filename|
|
4
|
-
file filename, tags: 'lib'
|
5
|
-
end
|
6
|
-
end
|
7
|
-
|
8
|
-
namespace "spec" do
|
9
|
-
Dir['spec/**/*.rb'].each do |filename|
|
10
|
-
file filename, tags: 'spec'
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
file 'README.md', tags: 'documentation'
|
15
|
-
|
16
|
-
file '.contexts/yard.md', tags: [ 'yard', 'cheatsheet' ]
|
17
|
-
|
18
|
-
meta guidelins: <<~EOT
|
19
|
-
# Guidelines for creating YARD documentation
|
20
|
-
|
21
|
-
- Look into the file, with tags yard and cheatsheet for how comment ruby
|
22
|
-
constructs.
|
23
|
-
- In comments above initialize methods never omit @return
|
24
|
-
EOT
|
25
|
-
end
|
data/.contexts/full.rb
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
context do
|
2
|
-
variable project_name: Pathname.pwd.basename
|
3
|
-
|
4
|
-
variable project_version: File.read('VERSION').chomp
|
5
|
-
|
6
|
-
variable branch: `git rev-parse --abbrev-ref HEAD`.chomp
|
7
|
-
|
8
|
-
namespace "structure" do
|
9
|
-
command "tree lib", tags: %w[ project_structure ]
|
10
|
-
end
|
11
|
-
|
12
|
-
namespace "lib" do
|
13
|
-
Dir['lib/**/*.rb'].each do |filename|
|
14
|
-
file filename, tags: 'lib'
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
namespace "spec" do
|
19
|
-
Dir['spec/**/*.rb'].each do |filename|
|
20
|
-
file filename, tags: 'spec'
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
file 'Rakefile', tags: 'gem_hadar'
|
25
|
-
|
26
|
-
file 'README.md', tags: 'documentation'
|
27
|
-
|
28
|
-
meta ruby: RUBY_DESCRIPTION
|
29
|
-
|
30
|
-
meta code_coverage: json('coverage/coverage_context.json')
|
31
|
-
end
|
data/.contexts/info.rb
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
context do
|
2
|
-
variable project_name: Pathname.pwd.basename
|
3
|
-
|
4
|
-
variable project_version: File.read('VERSION').chomp
|
5
|
-
|
6
|
-
variable branch: `git rev-parse --abbrev-ref HEAD`.chomp
|
7
|
-
|
8
|
-
namespace "structure" do
|
9
|
-
command "tree lib", tags: %w[ project_structure ]
|
10
|
-
end
|
11
|
-
|
12
|
-
file 'Rakefile', tags: 'gem_hadar'
|
13
|
-
|
14
|
-
file 'README.md', tags: 'documentation'
|
15
|
-
|
16
|
-
meta ruby: RUBY_DESCRIPTION
|
17
|
-
end
|
data/.contexts/lib.rb
DELETED
@@ -1,25 +0,0 @@
|
|
1
|
-
context do
|
2
|
-
variable project_name: Pathname.pwd.basename
|
3
|
-
|
4
|
-
variable project_version: File.read('VERSION').chomp
|
5
|
-
|
6
|
-
variable branch: `git rev-parse --abbrev-ref HEAD`.chomp
|
7
|
-
|
8
|
-
namespace "structure" do
|
9
|
-
command "tree lib", tags: %w[ project_structure ]
|
10
|
-
end
|
11
|
-
|
12
|
-
namespace "lib" do
|
13
|
-
Dir['lib/**/*.rb'].each do |filename|
|
14
|
-
file filename, tags: 'lib'
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
file 'Rakefile', tags: 'gem_hadar'
|
19
|
-
|
20
|
-
file 'README.md', tags: 'documentation'
|
21
|
-
|
22
|
-
meta ruby: RUBY_DESCRIPTION
|
23
|
-
|
24
|
-
meta code_coverage: json('coverage/coverage_context.json')
|
25
|
-
end
|
data/.contexts/yard.md
DELETED
@@ -1,94 +0,0 @@
|
|
1
|
-
|
2
|
-
# YARD Documentation Example
|
3
|
-
|
4
|
-
**You**, as an AI assistant, are tasked with generating only YARD documentation
|
5
|
-
comments for Ruby code, not executable code itself.
|
6
|
-
|
7
|
-
## Your Documentation Responsibilities
|
8
|
-
|
9
|
-
When generating Ruby documentation, you must:
|
10
|
-
|
11
|
-
### 1. **Generate Only Documentation Comments**
|
12
|
-
- Provide `#` prefixed comment blocks only
|
13
|
-
- Do not generate actual method bodies or class implementations
|
14
|
-
- Do not include executable code like `def`, `class`, `attr_reader`, etc.
|
15
|
-
- Focus solely on the documentation portions
|
16
|
-
|
17
|
-
### 2. **Follow the Exact Structure from Example**
|
18
|
-
Here are the documentation comments from the Document class:
|
19
|
-
|
20
|
-
```ruby
|
21
|
-
# Represents a generic document in a document management system.
|
22
|
-
# @example How to create a document
|
23
|
-
# document = Document.new('Hello World')
|
24
|
-
class Document
|
25
|
-
# @!attribute [r] title
|
26
|
-
# @return [String]
|
27
|
-
attr_reader :title
|
28
|
-
|
29
|
-
# @!attribute [w] description
|
30
|
-
# @return [String]
|
31
|
-
attr_writer :description
|
32
|
-
|
33
|
-
# @!attribute [rw] sections
|
34
|
-
# @api private
|
35
|
-
# @return [Array<Section>]
|
36
|
-
attr_accessor :sections
|
37
|
-
|
38
|
-
# Initializes a new Document instance.
|
39
|
-
# @note This method should be called with care.
|
40
|
-
#
|
41
|
-
# @param title [String] the title of the document
|
42
|
-
# @param description [String] the description of the document
|
43
|
-
# @param options [Hash] additional configuration options
|
44
|
-
# @option options [Boolean] :editable whether the document can be edited
|
45
|
-
# @yieldparam [String] content The content of the document.
|
46
|
-
# @yieldreturn [String] Returns a modified content.
|
47
|
-
#
|
48
|
-
# @raise [ArgumentError] if the title is nil
|
49
|
-
#
|
50
|
-
# @return [Document] a new Document instance
|
51
|
-
def initialize(title, description, options = {})
|
52
|
-
# Do NOT generate executable code
|
53
|
-
end
|
54
|
-
|
55
|
-
# Edits the document content.
|
56
|
-
#
|
57
|
-
# @overload edit(new_content)
|
58
|
-
# @param new_content [String] the new content for the document
|
59
|
-
# @return [Boolean] true if editing was successful, false otherwise
|
60
|
-
#
|
61
|
-
# @overload edit
|
62
|
-
# @yield Gives a block to process the current content.
|
63
|
-
# @yieldreturn [String] Returns the new content after processing.
|
64
|
-
# @return [Boolean] true if editing was successful, false otherwise
|
65
|
-
#
|
66
|
-
# @deprecated Use `modify` method instead.
|
67
|
-
def edit(new_content = nil)
|
68
|
-
# Do NOT generate executable code
|
69
|
-
end
|
70
|
-
|
71
|
-
# @todo Implement a proper save mechanism
|
72
|
-
def save
|
73
|
-
# Do NOT generate executable code
|
74
|
-
end
|
75
|
-
|
76
|
-
# Views the document
|
77
|
-
#
|
78
|
-
# @example Viewing the document title
|
79
|
-
# document.view_title #=> "Sample Document"
|
80
|
-
#
|
81
|
-
# @see #edit
|
82
|
-
# @return [String] the title of the document
|
83
|
-
def view_title
|
84
|
-
# Do NOT generate executable code
|
85
|
-
end
|
86
|
-
end
|
87
|
-
```
|
88
|
-
|
89
|
-
## Key Rule
|
90
|
-
|
91
|
-
**DO NOT GENERATE ANY EXECUTABLE CODE** - only documentation comments that
|
92
|
-
would be placed above actual Ruby methods and classes. The example shows what
|
93
|
-
the documentation comments should look like, not the actual executable Ruby
|
94
|
-
code.
|
data/.envrc
DELETED
data/.gitignore
DELETED
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
0.0.26
|