ollama_chat 0.0.26 → 0.0.27
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 +7 -0
- data/Rakefile +5 -1
- data/lib/ollama_chat/utils/cache_fetcher.rb +1 -0
- data/lib/ollama_chat/utils/fetcher.rb +2 -1
- data/lib/ollama_chat/version.rb +1 -1
- data/ollama_chat.gemspec +4 -4
- metadata +3 -12
- 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: c2155f3ea224b97ac3a471848b53530b60308b685b21804a23138ce31e752891
|
4
|
+
data.tar.gz: f96db1b34a1d1a95bad394d6c0ac0ba43f7bc1c481344aa7d0d19565c4889149
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6dfc776afc77a3cfdb3b5ab6d6d4d41e188345c15d4e8341495c00e90d4c03aefef4ac01af1d8ffae4b1a20deb11c8cfe3f063e8d4d11c53aaa8253fd66d5466
|
7
|
+
data.tar.gz: aee0b2f2fe0a17af19d09384df6dca08a3848fb6ebea981d71f93f1e8dc56858e6e293619b1755ea97aaefd2f7174925d50387cb5b9782c976ef477270d4e373
|
data/CHANGES.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
# Changes
|
2
2
|
|
3
|
+
## 2025-09-05 v0.0.27
|
4
|
+
|
5
|
+
- Enhanced cache hit notifications to properly handle content type with
|
6
|
+
fallback to 'unknown'
|
7
|
+
- Modified `OllamaChat::Utils::CacheFetcher` to return `io` for proper content
|
8
|
+
type propagation
|
9
|
+
|
3
10
|
## 2025-08-27 v0.0.26
|
4
11
|
|
5
12
|
- Enhanced `/last` command to support numeric argument, allowing users to
|
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
|
|
@@ -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.27 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.27".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 = ["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])
|
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.27
|
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
|
@@ -413,19 +413,10 @@ extra_rdoc_files:
|
|
413
413
|
- lib/ollama_chat/vim.rb
|
414
414
|
- lib/ollama_chat/web_searching.rb
|
415
415
|
files:
|
416
|
-
- ".all_images.yml"
|
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"
|
424
416
|
- CHANGES.md
|
425
417
|
- Gemfile
|
426
418
|
- README.md
|
427
419
|
- Rakefile
|
428
|
-
- VERSION
|
429
420
|
- bin/ollama_chat
|
430
421
|
- bin/ollama_chat_send
|
431
422
|
- 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
|