ollama_chat 0.0.128 → 0.0.129
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 +57 -0
- data/README.md +7 -7
- data/Rakefile +1 -1
- data/lib/ollama_chat/commands.rb +10 -1
- data/lib/ollama_chat/oc.rb +3 -3
- data/lib/ollama_chat/ollama_chat_config/default_config.yml +4 -9
- data/lib/ollama_chat/rag_handling.rb +15 -7
- data/lib/ollama_chat/source_fetching.rb +2 -2
- data/lib/ollama_chat/tools/execute_shell.rb +1 -1
- data/lib/ollama_chat/tools/get_url.rb +13 -6
- data/lib/ollama_chat/tools/{directory_structure.rb → list_directory.rb} +2 -2
- data/lib/ollama_chat/tools/{gem_path_lookup.rb → lookup_gem_path.rb} +2 -2
- data/lib/ollama_chat/tools/patch_file.rb +7 -5
- data/lib/ollama_chat/tools.rb +2 -3
- data/lib/ollama_chat/version.rb +1 -1
- data/lib/ollama_chat/web_searching.rb +2 -2
- data/ollama_chat.gemspec +6 -6
- data/spec/ollama_chat/rag_handling_spec.rb +3 -3
- data/spec/ollama_chat/tools/get_url_spec.rb +22 -4
- data/spec/ollama_chat/tools/{directory_structure_spec.rb → list_directory_spec.rb} +6 -6
- data/spec/ollama_chat/tools/{gem_path_lookup_spec.rb → lookup_gem_path_spec.rb} +4 -4
- data/spec/ollama_chat/tools/patch_file_spec.rb +12 -4
- data/spec/ollama_chat/web_searching_spec.rb +2 -2
- data/spec/spec_helper.rb +3 -0
- metadata +15 -13
- data/lib/ollama_chat/tools/file_context.rb +0 -90
- data/spec/ollama_chat/tools/file_context_spec.rb +0 -59
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9aae892b3b152a70e519a4d5a6268f046611c55d5b8ecfda66e2e4386a4681db
|
|
4
|
+
data.tar.gz: '038e498781b238aef6f3d6ff595ec3beb50d00b7efd722f8636bcb87a273bbb2'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 740289c0e7fdf453718f120f26fa201f68c1f677777b71e440789df72bb14db52526026114adb06ce15a2ea93b78ce6e39a478bfe77a22c1657692e1a5162445
|
|
7
|
+
data.tar.gz: 1b553c6648636b5088857f199a21cd87b86836c59df746fa50c504569be8609fd0181c3b233dda977a065cefdddfda1cd7ce7640a154a742bef8ab7392513346
|
data/CHANGES.md
CHANGED
|
@@ -1,5 +1,62 @@
|
|
|
1
1
|
# Changes
|
|
2
2
|
|
|
3
|
+
## 2026-10-08 v0.0.129
|
|
4
|
+
|
|
5
|
+
### Features
|
|
6
|
+
|
|
7
|
+
* **`get_url`**: Added support for the `file` scheme and updated the tool
|
|
8
|
+
description to display live allowed schemes.
|
|
9
|
+
* **`get_url`**: Implemented extraction of character card metadata from PNG
|
|
10
|
+
images when `sub_type` is `'png'`.
|
|
11
|
+
* **`patch_file`**: Enabled deletion of line ranges by passing `text: null`.
|
|
12
|
+
Omitting the key now raises an error, while an explicit `nil` value deletes
|
|
13
|
+
the range.
|
|
14
|
+
* **`update_collection`**: Prunes stale sources from the vector store when
|
|
15
|
+
collection patterns are shrunk, ensuring pattern edits propagate cleanly.
|
|
16
|
+
* **`/input`**: Clarified help text to distinguish between smart import
|
|
17
|
+
(content-type detection, HTML→MD, audio→ASR) and raw file reading.
|
|
18
|
+
* **`/conversation clean`**: Expanded help text to list cleanable categories
|
|
19
|
+
(`tools`, `images`, `thinking`, `messages`, `history`, `links`).
|
|
20
|
+
|
|
21
|
+
### Fixes
|
|
22
|
+
|
|
23
|
+
* **`execute_grep`**: Replaced `it` with `_1` in the grep command template to
|
|
24
|
+
fix a Ruby **3.3** deprecation warning regarding the implicit block
|
|
25
|
+
parameter in **3.4**.
|
|
26
|
+
* **`less`/`more` fallback**: Split the combined fallback logic so that
|
|
27
|
+
`less` receives the `-r` flag for raw control characters, while `more`
|
|
28
|
+
remains bare, fixing compatibility with GNU `more` on Debian trixie.
|
|
29
|
+
* **`get_url`**: Fixed `URI.parse` errors for URLs containing spaces by
|
|
30
|
+
encoding them as `%20`.
|
|
31
|
+
* **Web searching prompts**: Corrected swapped prompt references to ensure
|
|
32
|
+
`prompt(:web_summarize)` is used for the 'summarizing' policy and
|
|
33
|
+
`prompt(:web_import)` for the import mode.
|
|
34
|
+
* **`source_fetching`**: Moved the `prompt(:embed)` call earlier to ensure it
|
|
35
|
+
is available for both concurrent and non-concurrent execution paths.
|
|
36
|
+
|
|
37
|
+
### Refactoring
|
|
38
|
+
|
|
39
|
+
* **Tools**: Renamed `directory_structure` to `list_directory` (class
|
|
40
|
+
`DirectoryStructure` → `ListDirectory`).
|
|
41
|
+
* **Tools**: Renamed `gem_path_lookup` to `lookup_gem_path` (class
|
|
42
|
+
`GemPathLookup` → `LookupGemPath`) for verb-first naming consistency.
|
|
43
|
+
* **Tools**: Removed the `file_context` tool, as bulk file context is now
|
|
44
|
+
handled by `/input context` (ContextSpook).
|
|
45
|
+
* **`get_url`**: Reformatted description text for improved readability.
|
|
46
|
+
|
|
47
|
+
### Dependencies
|
|
48
|
+
|
|
49
|
+
* Bumped the minimum version of the `tins` dependency to **1.60.1**.
|
|
50
|
+
|
|
51
|
+
### Testing
|
|
52
|
+
|
|
53
|
+
* Stubbed `Tins::Terminal.columns` and `Tins::Terminal.lines` in
|
|
54
|
+
`spec/spec_helper.rb`.
|
|
55
|
+
* Added specs for PNG character card extraction and updated image spec
|
|
56
|
+
doubles to include `sub_type: 'jpeg'`.
|
|
57
|
+
* Split `patch_file` specs to distinguish between omitted keys (raises) and
|
|
58
|
+
explicit `nil` (deletes).
|
|
59
|
+
|
|
3
60
|
## 2026-10-07 v0.0.128
|
|
4
61
|
|
|
5
62
|
### Features
|
data/README.md
CHANGED
|
@@ -524,18 +524,18 @@ context, manipulate files, and retrieve external information.
|
|
|
524
524
|
|
|
525
525
|
| Category | Tools | Description |
|
|
526
526
|
| :--- | :--- | :--- |
|
|
527
|
-
| **Filesystem** | `read_file`, `write_file`, `patch_file`, `delete_file`, `move_file`, `
|
|
528
|
-
| **Ruby/Dev** | `resolve_tag`, `execute_ri`, `
|
|
527
|
+
| **Filesystem** | `read_file`, `write_file`, `patch_file`, `delete_file`, `move_file`, `list_directory`, `execute_grep`, `execute_shell` | Read, write, and search files within allowed directories; run shell commands as a last resort. |
|
|
528
|
+
| **Ruby/Dev** | `resolve_tag`, `execute_ri`, `lookup_gem_path`, `run_tests`, `eval_ruby` | Introspect Ruby code, check documentation, and run test suites. |
|
|
529
529
|
| **Web/External** | `search_web`, `get_url`, `browse`, `get_rfc`, `get_cve`, `get_endoflife`, `get_ghr`, `get_jira_issue`, `execute_jira_twg` | Access the internet, fetch specific URLs, and look up technical standards; run Jira CLI queries via `twg`. |
|
|
530
530
|
| **System/Util** | `get_time`, `get_location`, `get_current_weather`, `generate_password`, `compute_bmi`, `roll_dice` | General utility functions for time, location, and simple calculations. |
|
|
531
531
|
| **Editor/Clip** | `copy_to_clipboard`, `paste_from_clipboard`, `paste_into_editor`, `open_file_in_editor` | Bridge the gap between the chat and the system clipboard or editor. |
|
|
532
|
-
| **Knowledge** | `search_knowledge`, `
|
|
532
|
+
| **Knowledge** | `search_knowledge`, `lookup_group` | Semantic search for specific snippets, or retrieving prior message groups by UUID. |
|
|
533
533
|
| **Multimodal** | `generate_image` | Generate images via a local ComfyUI server. |
|
|
534
534
|
|
|
535
|
-
***Note on Knowledge Tools**: Use `search_knowledge` for
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
535
|
+
***Note on Knowledge Tools**: Use `search_knowledge` for low-token
|
|
536
|
+
semantic discovery. For comprehensive project context, use the
|
|
537
|
+
`/input context` command instead of loading files into the tool
|
|
538
|
+
call context window.*
|
|
539
539
|
|
|
540
540
|
## External Dependencies
|
|
541
541
|
|
data/Rakefile
CHANGED
|
@@ -49,7 +49,7 @@ GemHadar do
|
|
|
49
49
|
dependency 'reverse_markdown', '~> 3.0'
|
|
50
50
|
dependency 'kramdown-ansi', '~> 0.5'
|
|
51
51
|
dependency 'complex_config', '~> 0.22', '>= 0.22.2'
|
|
52
|
-
dependency 'tins', '~> 1.60'
|
|
52
|
+
dependency 'tins', '~> 1.60', '>= 1.60.1'
|
|
53
53
|
dependency 'search_ui', '>= 0.2'
|
|
54
54
|
dependency 'amatch', '~> 0.4'
|
|
55
55
|
dependency 'pdf-reader', '~> 2.0'
|
data/lib/ollama_chat/commands.rb
CHANGED
|
@@ -380,6 +380,12 @@ module OllamaChat::Commands
|
|
|
380
380
|
💾 Manage conversation content:
|
|
381
381
|
- save/load: Export/import as .json or .jsonl
|
|
382
382
|
- clean: Interactively clean conversation content
|
|
383
|
+
- tools: tool call content
|
|
384
|
+
- images: added images
|
|
385
|
+
- thinking: reasoning content
|
|
386
|
+
- messages: all messages ⇒ tools, images, thinking
|
|
387
|
+
- history: command history
|
|
388
|
+
- links: remembered URLs
|
|
383
389
|
- compact: Summarize old messages, keep recent
|
|
384
390
|
- compact summary: Show last compaction summary
|
|
385
391
|
- summarize: Per-message narrative (-s sentence)
|
|
@@ -867,7 +873,10 @@ module OllamaChat::Commands
|
|
|
867
873
|
EOT
|
|
868
874
|
help: <<~EOT
|
|
869
875
|
📥 Import content (read, summarize, embed, context)
|
|
870
|
-
|
|
876
|
+
Subcommands: path, context, embedding, summary
|
|
877
|
+
(no subcommand) → smart import (HTML→MD, audio→ASR,
|
|
878
|
+
image→context, PNG char cards)
|
|
879
|
+
path → raw file read (no parsing)
|
|
871
880
|
Options: -p (pattern), -w [words], -a (all),
|
|
872
881
|
-c [collection], -t [tags], -e (edit),
|
|
873
882
|
-m (monochrome), -i (summary instruction),
|
data/lib/ollama_chat/oc.rb
CHANGED
|
@@ -41,10 +41,10 @@ module OC
|
|
|
41
41
|
description 'Pager command to use in case terminal lines are exceeded by output'
|
|
42
42
|
|
|
43
43
|
default do
|
|
44
|
-
if fallback_pager = `which 2>/dev/null less`.full?(:chomp)
|
|
45
|
-
`which 2>/dev/null more`.full?(:chomp)
|
|
46
|
-
then
|
|
44
|
+
if fallback_pager = `which 2>/dev/null less`.full?(:chomp)
|
|
47
45
|
fallback_pager << ' -r'
|
|
46
|
+
elsif fallback_pager = `which 2>/dev/null more`.full?(:chomp)
|
|
47
|
+
fallback_pager
|
|
48
48
|
end
|
|
49
49
|
end
|
|
50
50
|
end
|
|
@@ -584,13 +584,7 @@ tools:
|
|
|
584
584
|
get_location:
|
|
585
585
|
result_display_timeout: 3
|
|
586
586
|
default: true
|
|
587
|
-
|
|
588
|
-
default: false
|
|
589
|
-
require_confirmation: false
|
|
590
|
-
result_display_timeout: 3
|
|
591
|
-
allowed:
|
|
592
|
-
- './spec'
|
|
593
|
-
directory_structure:
|
|
587
|
+
list_directory:
|
|
594
588
|
default: true
|
|
595
589
|
require_confirmation: false
|
|
596
590
|
result_display_timeout: 3
|
|
@@ -601,7 +595,7 @@ tools:
|
|
|
601
595
|
default: true
|
|
602
596
|
result_display_timeout: 3
|
|
603
597
|
cmd: |
|
|
604
|
-
grep #{'-i' if ignore_case} -m #{max_results} -r #{before.full? { "-B %u " %
|
|
598
|
+
grep #{'-i' if ignore_case} -m #{max_results} -r #{before.full? { "-B %u " % _1 }}#{after.full? { "-A %u " % _1 }}#{context.full? { "-C %u " % _1 }}#{pattern} #{path}
|
|
605
599
|
execute_shell:
|
|
606
600
|
default: false
|
|
607
601
|
require_confirmation: false # Preflight confirm is skipped, but in-tool it's mandatory.
|
|
@@ -645,7 +639,8 @@ tools:
|
|
|
645
639
|
schemes:
|
|
646
640
|
- http
|
|
647
641
|
- https
|
|
648
|
-
|
|
642
|
+
- file
|
|
643
|
+
lookup_gem_path:
|
|
649
644
|
result_display_timeout: 3
|
|
650
645
|
default: true
|
|
651
646
|
lookup_group:
|
|
@@ -547,22 +547,30 @@ module OllamaChat::RAGHandling
|
|
|
547
547
|
feedback("Collection #{collection.inspect} not found in database.", type: :warn)
|
|
548
548
|
return ''
|
|
549
549
|
end
|
|
550
|
+
|
|
551
|
+
matched_sources = nil
|
|
552
|
+
if patterns = col.patterns.full?
|
|
553
|
+
matched_sources = all_file_set(patterns).map(&:to_s).to_set
|
|
554
|
+
end
|
|
555
|
+
|
|
550
556
|
sources = {}
|
|
551
557
|
seen = {}
|
|
552
558
|
@documents.each_record do |record|
|
|
553
559
|
source = @documents.normalize_source(record.source) or next
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
560
|
+
if matched_sources.nil? || matched_sources.member?(source)
|
|
561
|
+
seen.key?(source) and next
|
|
562
|
+
seen[source] = true
|
|
563
|
+
unless @documents.source_modified?(source)
|
|
564
|
+
infobar.puts "Source #{source.to_s.inspect} is unmodified. => Skipping."
|
|
565
|
+
next
|
|
566
|
+
end
|
|
567
|
+
sources[source] = record.tags_set
|
|
559
568
|
end
|
|
560
|
-
sources[source] = record.tags_set
|
|
561
569
|
@documents.source_remove(source)
|
|
562
570
|
end
|
|
563
571
|
|
|
564
572
|
if patterns = col.patterns.full?
|
|
565
|
-
new_sources = all_file_set(patterns).map(&:to_s).reject { seen.key?(_1) }
|
|
573
|
+
new_sources = all_file_set(patterns).map(&:to_s).reject { seen.key?(_1) }.to_set
|
|
566
574
|
new_sources.each { seen[_1] = true }
|
|
567
575
|
new_sources.each { sources[_1] = [] }
|
|
568
576
|
end
|
|
@@ -288,12 +288,12 @@ module OllamaChat::SourceFetching
|
|
|
288
288
|
# to the tags array to apply to that source
|
|
289
289
|
# @return [Array<String>] results from each successful embed call
|
|
290
290
|
def bulk_embed_sources(sources_tags)
|
|
291
|
-
|
|
291
|
+
prompt = prompt(:embed)
|
|
292
|
+
return sources_tags.map { |s, tags| embed(s, prompt:, tags:) }.compact if
|
|
292
293
|
sources_tags.size <= 1 or config.embedding.concurrency <= 1
|
|
293
294
|
|
|
294
295
|
results = []
|
|
295
296
|
mutex = Mutex.new
|
|
296
|
-
prompt = prompt(:embed)
|
|
297
297
|
Tins::Limited.new(config.embedding.concurrency, name: 'embed').process do |l|
|
|
298
298
|
sources_tags.each do |s, tags|
|
|
299
299
|
l.execute do
|
|
@@ -38,7 +38,7 @@ class OllamaChat::Tools::ExecuteShell
|
|
|
38
38
|
then a mandatory y/n/i confirm prompt gates execution.
|
|
39
39
|
Last resort: use ONLY when no dedicated tool covers
|
|
40
40
|
the task (e.g. `git commit`, `bundle install`, `make`).
|
|
41
|
-
Prefer `execute_grep`, `
|
|
41
|
+
Prefer `execute_grep`, `list_directory`, `read_file`,
|
|
42
42
|
`patch_file` over shell equivalents. Only invoke when
|
|
43
43
|
the user explicitly requests it or you have proposed
|
|
44
44
|
the command to the user beforehand. Runs in the current
|
|
@@ -22,9 +22,10 @@ class OllamaChat::Tools::GetURL
|
|
|
22
22
|
function: Tool::Function.new(
|
|
23
23
|
name:,
|
|
24
24
|
description: <<~EOT,
|
|
25
|
-
Web fetcher – Downloads any web resource (HTML, Markdown, plain text,
|
|
26
|
-
at url and makes its contents available to the model. Good
|
|
27
|
-
documentation snippets or viewing generated images.
|
|
25
|
+
Web fetcher – Downloads any web resource (HTML, Markdown, plain text,
|
|
26
|
+
or images) at url and makes its contents available to the model. Good
|
|
27
|
+
for pulling documentation snippets or viewing generated images.
|
|
28
|
+
Allowed schemes: #{Array(tool_config.schemes?).map(&:to_s).join(', ')}
|
|
28
29
|
EOT
|
|
29
30
|
parameters: Tool::Function::Parameters.new(
|
|
30
31
|
type: 'object',
|
|
@@ -46,8 +47,10 @@ class OllamaChat::Tools::GetURL
|
|
|
46
47
|
typically transform the source content into a text-based
|
|
47
48
|
representation
|
|
48
49
|
(e.g., HTML to Markdown, PDF to text) before processing.
|
|
49
|
-
- 'ignoring': Returns the raw content without any
|
|
50
|
-
|
|
50
|
+
- 'ignoring': Returns the raw content without any
|
|
51
|
+
transformation (best for raw text, logs, or code).
|
|
52
|
+
- 'importing': Processes content (e.g., HTML to Markdown) and
|
|
53
|
+
adds it to the chat context.
|
|
51
54
|
- 'embedding': Processes the content for vector storage.
|
|
52
55
|
- 'summarizing': Returns a condensed summary of the content.
|
|
53
56
|
EOT
|
|
@@ -104,7 +107,7 @@ class OllamaChat::Tools::GetURL
|
|
|
104
107
|
|
|
105
108
|
allowed_schemes = Array(tool_config.schemes?).map(&:to_s)
|
|
106
109
|
|
|
107
|
-
url = URI.parse(args.url.to_s)
|
|
110
|
+
url = URI.parse(args.url.to_s.gsub(' ', '%20'))
|
|
108
111
|
unless allowed_schemes.include?(url.scheme)
|
|
109
112
|
raise OllamaChat::ToolFunctionArgumentError,
|
|
110
113
|
"scheme #{url.scheme.inspect} not allowed "\
|
|
@@ -120,6 +123,10 @@ class OllamaChat::Tools::GetURL
|
|
|
120
123
|
case source_io&.content_type&.media_type
|
|
121
124
|
when 'image'
|
|
122
125
|
chat.add_image(chat.images, source_io, source)
|
|
126
|
+
if source_io&.content_type&.sub_type == 'png'
|
|
127
|
+
source_io.rewind
|
|
128
|
+
content = chat.parse_png(source_io).full?(:join, ?\n)
|
|
129
|
+
end
|
|
123
130
|
when 'text', 'application', nil
|
|
124
131
|
case document_policy
|
|
125
132
|
when 'ignoring'
|
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
#
|
|
7
7
|
# The tool supports traversing directories and returns a structured
|
|
8
8
|
# representation of the file system hierarchy.
|
|
9
|
-
class OllamaChat::Tools::
|
|
9
|
+
class OllamaChat::Tools::ListDirectory
|
|
10
10
|
include OllamaChat::Tools::Concern
|
|
11
11
|
include OllamaChat::Utils::AnalyzeDirectory
|
|
12
12
|
|
|
13
13
|
# @return [String] the registered name for this tool
|
|
14
|
-
def self.register_name = '
|
|
14
|
+
def self.register_name = 'list_directory'
|
|
15
15
|
|
|
16
16
|
# Creates and returns a tool definition for retrieving directory structure.
|
|
17
17
|
#
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
# This tool allows the chat client to find the installation paths of gems
|
|
4
4
|
# on the system. It integrates with the Ollama tool calling system to
|
|
5
5
|
# provide gem path information to the language model.
|
|
6
|
-
class OllamaChat::Tools::
|
|
6
|
+
class OllamaChat::Tools::LookupGemPath
|
|
7
7
|
include OllamaChat::Tools::Concern
|
|
8
8
|
|
|
9
9
|
# @return [String] the registered name for this tool
|
|
10
|
-
def self.register_name = '
|
|
10
|
+
def self.register_name = 'lookup_gem_path'
|
|
11
11
|
|
|
12
12
|
# Creates and returns a tool definition for gem path lookup.
|
|
13
13
|
#
|
|
@@ -71,7 +71,8 @@ class OllamaChat::Tools::PatchFile
|
|
|
71
71
|
type: 'array',
|
|
72
72
|
description: <<~EOT,
|
|
73
73
|
A list of edits. Each edit must contain start_line, end_line,
|
|
74
|
-
and text.
|
|
74
|
+
and text. Set `text` to null to delete the line range
|
|
75
|
+
without replacement.
|
|
75
76
|
EOT
|
|
76
77
|
items: Tool::Function::Parameters::Property.new(
|
|
77
78
|
type: 'object',
|
|
@@ -86,7 +87,8 @@ class OllamaChat::Tools::PatchFile
|
|
|
86
87
|
type: 'integer', description: '1-indexed end line'
|
|
87
88
|
),
|
|
88
89
|
text: Tool::Function::Parameters::Property.new(
|
|
89
|
-
type: 'string',
|
|
90
|
+
type: 'string',
|
|
91
|
+
description: 'The replacement text. Set to null to delete the range.'
|
|
90
92
|
),
|
|
91
93
|
},
|
|
92
94
|
)
|
|
@@ -234,7 +236,7 @@ class OllamaChat::Tools::PatchFile
|
|
|
234
236
|
s_idx = edit[:start_line] - 1
|
|
235
237
|
e_idx = edit[:end_line] - 1
|
|
236
238
|
|
|
237
|
-
lines[s_idx..e_idx] = [edit[:text]]
|
|
239
|
+
lines[s_idx..e_idx] = edit[:text].nil? ? [] : [edit[:text]]
|
|
238
240
|
end
|
|
239
241
|
|
|
240
242
|
lines * ?\n
|
|
@@ -251,8 +253,8 @@ class OllamaChat::Tools::PatchFile
|
|
|
251
253
|
e[:start_line] or raise OllamaChat::ToolFunctionArgumentError,
|
|
252
254
|
"Edit ##{i + 1} is missing a start_line"
|
|
253
255
|
e[:end_line] ||= e[:start_line]
|
|
254
|
-
e
|
|
255
|
-
"Edit ##{i + 1} is missing
|
|
256
|
+
e.key?(:text) or raise OllamaChat::ToolFunctionArgumentError,
|
|
257
|
+
"Edit ##{i + 1} is missing the text key; set it to null to delete"
|
|
256
258
|
if e[:start_line] < 1 || e[:end_line] > 1 && e[:end_line] > file_size || e[:start_line] > e[:end_line]
|
|
257
259
|
raise OllamaChat::ToolFunctionArgumentError,
|
|
258
260
|
"Invalid range for edit ##{i + 1}: lines #{e[:start_line]}-#{e[:end_line]} (File size: #{file_size})"
|
data/lib/ollama_chat/tools.rb
CHANGED
|
@@ -90,15 +90,14 @@ require 'ollama_chat/tools/browse'
|
|
|
90
90
|
require 'ollama_chat/tools/compute_bmi'
|
|
91
91
|
require 'ollama_chat/tools/copy_to_clipboard'
|
|
92
92
|
require 'ollama_chat/tools/delete_file'
|
|
93
|
-
require 'ollama_chat/tools/directory_structure'
|
|
94
93
|
require 'ollama_chat/tools/eval_ruby'
|
|
95
94
|
require 'ollama_chat/tools/execute_grep'
|
|
96
95
|
require 'ollama_chat/tools/execute_ri'
|
|
97
96
|
require 'ollama_chat/tools/execute_shell'
|
|
98
97
|
require 'ollama_chat/tools/execute_jira_twg'
|
|
99
|
-
require 'ollama_chat/tools/file_context'
|
|
100
98
|
require 'ollama_chat/tools/forget'
|
|
101
|
-
require 'ollama_chat/tools/
|
|
99
|
+
require 'ollama_chat/tools/list_directory'
|
|
100
|
+
require 'ollama_chat/tools/lookup_gem_path'
|
|
102
101
|
require 'ollama_chat/tools/generate_image'
|
|
103
102
|
require 'ollama_chat/tools/generate_password'
|
|
104
103
|
require 'ollama_chat/tools/get_current_weather'
|
data/lib/ollama_chat/version.rb
CHANGED
|
@@ -78,7 +78,7 @@ module OllamaChat::WebSearching
|
|
|
78
78
|
end
|
|
79
79
|
prompt.named_placeholders_interpolate({query:})
|
|
80
80
|
elsif document_policy.selected == 'summarizing'
|
|
81
|
-
prompt = prompt(:
|
|
81
|
+
prompt = prompt(:web_summarize).to_s
|
|
82
82
|
results = urls.each_with_object('') do |url, content|
|
|
83
83
|
summarize(url).full? do |c|
|
|
84
84
|
content << c.ask_and_send_or_self(:read)
|
|
@@ -86,7 +86,7 @@ module OllamaChat::WebSearching
|
|
|
86
86
|
end
|
|
87
87
|
prompt.named_placeholders_interpolate({query:, results:})
|
|
88
88
|
else
|
|
89
|
-
prompt = prompt(:
|
|
89
|
+
prompt = prompt(:web_import).to_s
|
|
90
90
|
results = urls.each_with_object('') do |url, content|
|
|
91
91
|
import(url).full? do |c|
|
|
92
92
|
content << c.ask_and_send_or_self(:read)
|
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.129 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.129".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]
|
|
@@ -12,15 +12,15 @@ Gem::Specification.new do |s|
|
|
|
12
12
|
s.description = "The app provides a command-line interface (CLI) to an Ollama AI model,\nallowing users to engage in text-based conversations and generate\nhuman-like responses. Users can import data from local files or web pages,\nwhich are then processed through three different modes: fully importing the\ncontent into the conversation context, summarizing the information for\nconcise reference, or storing it in an embedding vector database for later\nretrieval based on the conversation.\n".freeze
|
|
13
13
|
s.email = "flori@ping.de".freeze
|
|
14
14
|
s.executables = ["ollama_chat".freeze, "ollama_chat_send".freeze, "ollama_chat_log".freeze]
|
|
15
|
-
s.extra_rdoc_files = ["README.md".freeze, "lib/ollama_chat.rb".freeze, "lib/ollama_chat/asr.rb".freeze, "lib/ollama_chat/chat.rb".freeze, "lib/ollama_chat/clipboard.rb".freeze, "lib/ollama_chat/collection_search.rb".freeze, "lib/ollama_chat/command_concern.rb".freeze, "lib/ollama_chat/commands.rb".freeze, "lib/ollama_chat/compaction.rb".freeze, "lib/ollama_chat/config_handling.rb".freeze, "lib/ollama_chat/conversation.rb".freeze, "lib/ollama_chat/database.rb".freeze, "lib/ollama_chat/database/duplicatable.rb".freeze, "lib/ollama_chat/database/migrations.rb".freeze, "lib/ollama_chat/database/migrations/001_initial_schema.rb".freeze, "lib/ollama_chat/database/migrations/002_add_links_to_sessions.rb".freeze, "lib/ollama_chat/database/migrations/003_add_history_to_sessions.rb".freeze, "lib/ollama_chat/database/migrations/004_add_profile_to_model_options.rb".freeze, "lib/ollama_chat/database/migrations/005_add_context_format_to_sessions.rb".freeze, "lib/ollama_chat/database/migrations/006_rename_system_prompt_context_to_system.rb".freeze, "lib/ollama_chat/database/migrations/007_add_collections_table.rb".freeze, "lib/ollama_chat/database/migrations/008_drop_think_mode_constraint.rb".freeze, "lib/ollama_chat/database/migrations/009_add_app_states_table.rb".freeze, "lib/ollama_chat/database/migrations/010_add_enabled_to_collections.rb".freeze, "lib/ollama_chat/database/migrations/011_add_trigger_to_sessions.rb".freeze, "lib/ollama_chat/database/models/app_state.rb".freeze, "lib/ollama_chat/database/models/collection.rb".freeze, "lib/ollama_chat/database/models/favourite.rb".freeze, "lib/ollama_chat/database/models/model_options.rb".freeze, "lib/ollama_chat/database/models/prompt.rb".freeze, "lib/ollama_chat/database/models/session.rb".freeze, "lib/ollama_chat/database/session_locking.rb".freeze, "lib/ollama_chat/dialog.rb".freeze, "lib/ollama_chat/document_cache.rb".freeze, "lib/ollama_chat/favourites_management.rb".freeze, "lib/ollama_chat/feedback.rb".freeze, "lib/ollama_chat/file_editing.rb".freeze, "lib/ollama_chat/follow_chat.rb".freeze, "lib/ollama_chat/history.rb".freeze, "lib/ollama_chat/http_handling.rb".freeze, "lib/ollama_chat/information.rb".freeze, "lib/ollama_chat/input_content.rb".freeze, "lib/ollama_chat/invidious.rb".freeze, "lib/ollama_chat/kramdown_ansi.rb".freeze, "lib/ollama_chat/links_set.rb".freeze, "lib/ollama_chat/location_handling.rb".freeze, "lib/ollama_chat/logging.rb".freeze, "lib/ollama_chat/message.rb".freeze, "lib/ollama_chat/message_editing.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/oc.rb".freeze, "lib/ollama_chat/ollama_chat_config.rb".freeze, "lib/ollama_chat/pager.rb".freeze, "lib/ollama_chat/parsing.rb".freeze, "lib/ollama_chat/personae_management.rb".freeze, "lib/ollama_chat/prompt_handling.rb".freeze, "lib/ollama_chat/prompt_management.rb".freeze, "lib/ollama_chat/rag_handling.rb".freeze, "lib/ollama_chat/redis_cache.rb".freeze, "lib/ollama_chat/say.rb".freeze, "lib/ollama_chat/server_socket.rb".freeze, "lib/ollama_chat/session_management.rb".freeze, "lib/ollama_chat/source_fetching.rb".freeze, "lib/ollama_chat/speaker.rb".freeze, "lib/ollama_chat/state_selectors.rb".freeze, "lib/ollama_chat/switches.rb".freeze, "lib/ollama_chat/system_prompt_management.rb".freeze, "lib/ollama_chat/think_control.rb".freeze, "lib/ollama_chat/token_estimator.rb".freeze, "lib/ollama_chat/token_estimator/crude.rb".freeze, "lib/ollama_chat/tool_calling.rb".freeze, "lib/ollama_chat/tools.rb".freeze, "lib/ollama_chat/tools/browse.rb".freeze, "lib/ollama_chat/tools/compute_bmi.rb".freeze, "lib/ollama_chat/tools/concern.rb".freeze, "lib/ollama_chat/tools/copy_to_clipboard.rb".freeze, "lib/ollama_chat/tools/delete_file.rb".freeze, "lib/ollama_chat/tools/
|
|
16
|
-
s.files = [".utilsrc".freeze, "CHANGES.md".freeze, "Gemfile".freeze, "LICENSE".freeze, "README.md".freeze, "Rakefile".freeze, "bin/ollama_chat".freeze, "bin/ollama_chat_log".freeze, "bin/ollama_chat_send".freeze, "config/searxng/settings.yml".freeze, "config/sherlock.md".freeze, "docker-compose.yml".freeze, "lib/ollama_chat.rb".freeze, "lib/ollama_chat/asr.rb".freeze, "lib/ollama_chat/chat.rb".freeze, "lib/ollama_chat/clipboard.rb".freeze, "lib/ollama_chat/collection_search.rb".freeze, "lib/ollama_chat/command_concern.rb".freeze, "lib/ollama_chat/commands.rb".freeze, "lib/ollama_chat/compaction.rb".freeze, "lib/ollama_chat/config_handling.rb".freeze, "lib/ollama_chat/conversation.rb".freeze, "lib/ollama_chat/database.rb".freeze, "lib/ollama_chat/database/duplicatable.rb".freeze, "lib/ollama_chat/database/migrations.rb".freeze, "lib/ollama_chat/database/migrations/001_initial_schema.rb".freeze, "lib/ollama_chat/database/migrations/002_add_links_to_sessions.rb".freeze, "lib/ollama_chat/database/migrations/003_add_history_to_sessions.rb".freeze, "lib/ollama_chat/database/migrations/004_add_profile_to_model_options.rb".freeze, "lib/ollama_chat/database/migrations/005_add_context_format_to_sessions.rb".freeze, "lib/ollama_chat/database/migrations/006_rename_system_prompt_context_to_system.rb".freeze, "lib/ollama_chat/database/migrations/007_add_collections_table.rb".freeze, "lib/ollama_chat/database/migrations/008_drop_think_mode_constraint.rb".freeze, "lib/ollama_chat/database/migrations/009_add_app_states_table.rb".freeze, "lib/ollama_chat/database/migrations/010_add_enabled_to_collections.rb".freeze, "lib/ollama_chat/database/migrations/011_add_trigger_to_sessions.rb".freeze, "lib/ollama_chat/database/models/app_state.rb".freeze, "lib/ollama_chat/database/models/collection.rb".freeze, "lib/ollama_chat/database/models/favourite.rb".freeze, "lib/ollama_chat/database/models/model_options.rb".freeze, "lib/ollama_chat/database/models/prompt.rb".freeze, "lib/ollama_chat/database/models/session.rb".freeze, "lib/ollama_chat/database/session_locking.rb".freeze, "lib/ollama_chat/dialog.rb".freeze, "lib/ollama_chat/document_cache.rb".freeze, "lib/ollama_chat/favourites_management.rb".freeze, "lib/ollama_chat/feedback.rb".freeze, "lib/ollama_chat/file_editing.rb".freeze, "lib/ollama_chat/follow_chat.rb".freeze, "lib/ollama_chat/history.rb".freeze, "lib/ollama_chat/http_handling.rb".freeze, "lib/ollama_chat/information.rb".freeze, "lib/ollama_chat/input_content.rb".freeze, "lib/ollama_chat/invidious.rb".freeze, "lib/ollama_chat/kramdown_ansi.rb".freeze, "lib/ollama_chat/links_set.rb".freeze, "lib/ollama_chat/location_handling.rb".freeze, "lib/ollama_chat/logging.rb".freeze, "lib/ollama_chat/message.rb".freeze, "lib/ollama_chat/message_editing.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/oc.rb".freeze, "lib/ollama_chat/ollama_chat_config.rb".freeze, "lib/ollama_chat/ollama_chat_config/default_config.yml".freeze, "lib/ollama_chat/pager.rb".freeze, "lib/ollama_chat/parsing.rb".freeze, "lib/ollama_chat/personae_management.rb".freeze, "lib/ollama_chat/prompt_handling.rb".freeze, "lib/ollama_chat/prompt_management.rb".freeze, "lib/ollama_chat/rag_handling.rb".freeze, "lib/ollama_chat/redis_cache.rb".freeze, "lib/ollama_chat/say.rb".freeze, "lib/ollama_chat/server_socket.rb".freeze, "lib/ollama_chat/session_management.rb".freeze, "lib/ollama_chat/source_fetching.rb".freeze, "lib/ollama_chat/speaker.rb".freeze, "lib/ollama_chat/state_selectors.rb".freeze, "lib/ollama_chat/switches.rb".freeze, "lib/ollama_chat/system_prompt_management.rb".freeze, "lib/ollama_chat/think_control.rb".freeze, "lib/ollama_chat/token_estimator.rb".freeze, "lib/ollama_chat/token_estimator/crude.rb".freeze, "lib/ollama_chat/tool_calling.rb".freeze, "lib/ollama_chat/tools.rb".freeze, "lib/ollama_chat/tools/browse.rb".freeze, "lib/ollama_chat/tools/compute_bmi.rb".freeze, "lib/ollama_chat/tools/concern.rb".freeze, "lib/ollama_chat/tools/copy_to_clipboard.rb".freeze, "lib/ollama_chat/tools/delete_file.rb".freeze, "lib/ollama_chat/tools/directory_structure.rb".freeze, "lib/ollama_chat/tools/eval_ruby.rb".freeze, "lib/ollama_chat/tools/execute_grep.rb".freeze, "lib/ollama_chat/tools/execute_jira_twg.rb".freeze, "lib/ollama_chat/tools/execute_ri.rb".freeze, "lib/ollama_chat/tools/execute_shell.rb".freeze, "lib/ollama_chat/tools/file_context.rb".freeze, "lib/ollama_chat/tools/forget.rb".freeze, "lib/ollama_chat/tools/gem_path_lookup.rb".freeze, "lib/ollama_chat/tools/generate_image.rb".freeze, "lib/ollama_chat/tools/generate_password.rb".freeze, "lib/ollama_chat/tools/get_current_weather.rb".freeze, "lib/ollama_chat/tools/get_cve.rb".freeze, "lib/ollama_chat/tools/get_endoflife.rb".freeze, "lib/ollama_chat/tools/get_ghr.rb".freeze, "lib/ollama_chat/tools/get_jira_issue.rb".freeze, "lib/ollama_chat/tools/get_location.rb".freeze, "lib/ollama_chat/tools/get_rfc.rb".freeze, "lib/ollama_chat/tools/get_time.rb".freeze, "lib/ollama_chat/tools/get_url.rb".freeze, "lib/ollama_chat/tools/lookup_group.rb".freeze, "lib/ollama_chat/tools/memorize.rb".freeze, "lib/ollama_chat/tools/move_file.rb".freeze, "lib/ollama_chat/tools/open_file_in_editor.rb".freeze, "lib/ollama_chat/tools/paste_from_clipboard.rb".freeze, "lib/ollama_chat/tools/paste_into_editor.rb".freeze, "lib/ollama_chat/tools/patch_file.rb".freeze, "lib/ollama_chat/tools/read_file.rb".freeze, "lib/ollama_chat/tools/resolve_tag.rb".freeze, "lib/ollama_chat/tools/roll_dice.rb".freeze, "lib/ollama_chat/tools/run_tests.rb".freeze, "lib/ollama_chat/tools/search_knowledge.rb".freeze, "lib/ollama_chat/tools/search_web.rb".freeze, "lib/ollama_chat/tools/write_file.rb".freeze, "lib/ollama_chat/tts.rb".freeze, "lib/ollama_chat/utils.rb".freeze, "lib/ollama_chat/utils/analyze_directory.rb".freeze, "lib/ollama_chat/utils/audio_player.rb".freeze, "lib/ollama_chat/utils/backup.rb".freeze, "lib/ollama_chat/utils/cache_fetcher.rb".freeze, "lib/ollama_chat/utils/chooser.rb".freeze, "lib/ollama_chat/utils/excon_logger.rb".freeze, "lib/ollama_chat/utils/fetcher.rb".freeze, "lib/ollama_chat/utils/json_jsonl_io.rb".freeze, "lib/ollama_chat/utils/log_rotation.rb".freeze, "lib/ollama_chat/utils/log_viewer.rb".freeze, "lib/ollama_chat/utils/ordered_queue.rb".freeze, "lib/ollama_chat/utils/path_completer.rb".freeze, "lib/ollama_chat/utils/path_validator.rb".freeze, "lib/ollama_chat/utils/png_metadata_extractor.rb".freeze, "lib/ollama_chat/utils/strip_ansi.rb".freeze, "lib/ollama_chat/utils/tag_resolver.rb".freeze, "lib/ollama_chat/utils/utf8_converter.rb".freeze, "lib/ollama_chat/utils/value_formatter.rb".freeze, "lib/ollama_chat/uuid_v7.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_ps.json".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/conversation.jsonl".freeze, "spec/assets/deep/deeper/empty.txt".freeze, "spec/assets/deep/deeper/not-empty.txt".freeze, "spec/assets/deep/empty.txt".freeze, "spec/assets/duckduckgo.html".freeze, "spec/assets/example.atom".freeze, "spec/assets/example.csv".freeze, "spec/assets/example.epub".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/example_with_quote.html".freeze, "spec/assets/fluffy.png".freeze, "spec/assets/kitten.jpg".freeze, "spec/assets/linux.oga".freeze, "spec/assets/miyu.png".freeze, "spec/assets/pirateweather.json".freeze, "spec/assets/prompt.txt".freeze, "spec/assets/searxng.json".freeze, "spec/ollama_chat/asr_spec.rb".freeze, "spec/ollama_chat/chat_spec.rb".freeze, "spec/ollama_chat/clipboard_spec.rb".freeze, "spec/ollama_chat/collection_search_spec.rb".freeze, "spec/ollama_chat/command_concern_spec.rb".freeze, "spec/ollama_chat/commands_spec.rb".freeze, "spec/ollama_chat/compaction_spec.rb".freeze, "spec/ollama_chat/config_handling_spec.rb".freeze, "spec/ollama_chat/conversation_spec.rb".freeze, "spec/ollama_chat/database/models/favourite_spec.rb".freeze, "spec/ollama_chat/favourites_management_spec.rb".freeze, "spec/ollama_chat/file_editing_spec.rb".freeze, "spec/ollama_chat/follow_chat_spec.rb".freeze, "spec/ollama_chat/history_spec.rb".freeze, "spec/ollama_chat/http_handling_spec.rb".freeze, "spec/ollama_chat/information_spec.rb".freeze, "spec/ollama_chat/input_content_spec.rb".freeze, "spec/ollama_chat/invidious_spec.rb".freeze, "spec/ollama_chat/kramdown_ansi_spec.rb".freeze, "spec/ollama_chat/message_editing_spec.rb".freeze, "spec/ollama_chat/message_list_spec.rb".freeze, "spec/ollama_chat/message_output_spec.rb".freeze, "spec/ollama_chat/message_spec.rb".freeze, "spec/ollama_chat/model_handling_spec.rb".freeze, "spec/ollama_chat/parsing_spec.rb".freeze, "spec/ollama_chat/prompt_handling_spec.rb".freeze, "spec/ollama_chat/prompt_management_spec.rb".freeze, "spec/ollama_chat/rag_handling_spec.rb".freeze, "spec/ollama_chat/redis_cache_spec.rb".freeze, "spec/ollama_chat/server_socket_spec.rb".freeze, "spec/ollama_chat/session_management_spec.rb".freeze, "spec/ollama_chat/source_fetching_spec.rb".freeze, "spec/ollama_chat/speaker_spec.rb".freeze, "spec/ollama_chat/state_selectors_spec.rb".freeze, "spec/ollama_chat/switches_spec.rb".freeze, "spec/ollama_chat/system_prompt_management_spec.rb".freeze, "spec/ollama_chat/think_control_spec.rb".freeze, "spec/ollama_chat/token_estimator_spec.rb".freeze, "spec/ollama_chat/tool_calling_spec.rb".freeze, "spec/ollama_chat/tools/browse_spec.rb".freeze, "spec/ollama_chat/tools/compute_bmi_spec.rb".freeze, "spec/ollama_chat/tools/concern_spec.rb".freeze, "spec/ollama_chat/tools/copy_to_clipboard_spec.rb".freeze, "spec/ollama_chat/tools/delete_file_spec.rb".freeze, "spec/ollama_chat/tools/directory_structure_spec.rb".freeze, "spec/ollama_chat/tools/execute_grep_spec.rb".freeze, "spec/ollama_chat/tools/execute_jira_twg_spec.rb".freeze, "spec/ollama_chat/tools/execute_ri_spec.rb".freeze, "spec/ollama_chat/tools/execute_shell_spec.rb".freeze, "spec/ollama_chat/tools/file_context_spec.rb".freeze, "spec/ollama_chat/tools/forget_spec.rb".freeze, "spec/ollama_chat/tools/gem_path_lookup_spec.rb".freeze, "spec/ollama_chat/tools/generate_image_spec.rb".freeze, "spec/ollama_chat/tools/generate_password_spec.rb".freeze, "spec/ollama_chat/tools/get_current_weather_spec.rb".freeze, "spec/ollama_chat/tools/get_cve_spec.rb".freeze, "spec/ollama_chat/tools/get_endoflife_spec.rb".freeze, "spec/ollama_chat/tools/get_ghr_spec.rb".freeze, "spec/ollama_chat/tools/get_jira_issue_spec.rb".freeze, "spec/ollama_chat/tools/get_location_spec.rb".freeze, "spec/ollama_chat/tools/get_rfc_spec.rb".freeze, "spec/ollama_chat/tools/get_time_spec.rb".freeze, "spec/ollama_chat/tools/get_url_spec.rb".freeze, "spec/ollama_chat/tools/lookup_group_spec.rb".freeze, "spec/ollama_chat/tools/memorize_spec.rb".freeze, "spec/ollama_chat/tools/move_file_spec.rb".freeze, "spec/ollama_chat/tools/open_file_in_editor_spec.rb".freeze, "spec/ollama_chat/tools/paste_from_clipboard_spec.rb".freeze, "spec/ollama_chat/tools/paste_into_editor_spec.rb".freeze, "spec/ollama_chat/tools/patch_file_spec.rb".freeze, "spec/ollama_chat/tools/read_file_spec.rb".freeze, "spec/ollama_chat/tools/resolve_tag_spec.rb".freeze, "spec/ollama_chat/tools/roll_dice_spec.rb".freeze, "spec/ollama_chat/tools/run_tests_spec.rb".freeze, "spec/ollama_chat/tools/search_knowledge_spec.rb".freeze, "spec/ollama_chat/tools/search_web_spec.rb".freeze, "spec/ollama_chat/tools/write_file_spec.rb".freeze, "spec/ollama_chat/tts_spec.rb".freeze, "spec/ollama_chat/utils/analyze_directory_spec.rb".freeze, "spec/ollama_chat/utils/audio_player_spec.rb".freeze, "spec/ollama_chat/utils/cache_fetcher_spec.rb".freeze, "spec/ollama_chat/utils/excon_logger_spec.rb".freeze, "spec/ollama_chat/utils/fetcher_spec.rb".freeze, "spec/ollama_chat/utils/log_rotation_spec.rb".freeze, "spec/ollama_chat/utils/log_viewer_spec.rb".freeze, "spec/ollama_chat/utils/ordered_queue_spec.rb".freeze, "spec/ollama_chat/utils/path_completer_spec.rb".freeze, "spec/ollama_chat/utils/png_metadata_extractor_spec.rb".freeze, "spec/ollama_chat/vim_spec.rb".freeze, "spec/ollama_chat/web_searching_spec.rb".freeze, "spec/spec_helper.rb".freeze, "tmp/.keep".freeze]
|
|
15
|
+
s.extra_rdoc_files = ["README.md".freeze, "lib/ollama_chat.rb".freeze, "lib/ollama_chat/asr.rb".freeze, "lib/ollama_chat/chat.rb".freeze, "lib/ollama_chat/clipboard.rb".freeze, "lib/ollama_chat/collection_search.rb".freeze, "lib/ollama_chat/command_concern.rb".freeze, "lib/ollama_chat/commands.rb".freeze, "lib/ollama_chat/compaction.rb".freeze, "lib/ollama_chat/config_handling.rb".freeze, "lib/ollama_chat/conversation.rb".freeze, "lib/ollama_chat/database.rb".freeze, "lib/ollama_chat/database/duplicatable.rb".freeze, "lib/ollama_chat/database/migrations.rb".freeze, "lib/ollama_chat/database/migrations/001_initial_schema.rb".freeze, "lib/ollama_chat/database/migrations/002_add_links_to_sessions.rb".freeze, "lib/ollama_chat/database/migrations/003_add_history_to_sessions.rb".freeze, "lib/ollama_chat/database/migrations/004_add_profile_to_model_options.rb".freeze, "lib/ollama_chat/database/migrations/005_add_context_format_to_sessions.rb".freeze, "lib/ollama_chat/database/migrations/006_rename_system_prompt_context_to_system.rb".freeze, "lib/ollama_chat/database/migrations/007_add_collections_table.rb".freeze, "lib/ollama_chat/database/migrations/008_drop_think_mode_constraint.rb".freeze, "lib/ollama_chat/database/migrations/009_add_app_states_table.rb".freeze, "lib/ollama_chat/database/migrations/010_add_enabled_to_collections.rb".freeze, "lib/ollama_chat/database/migrations/011_add_trigger_to_sessions.rb".freeze, "lib/ollama_chat/database/models/app_state.rb".freeze, "lib/ollama_chat/database/models/collection.rb".freeze, "lib/ollama_chat/database/models/favourite.rb".freeze, "lib/ollama_chat/database/models/model_options.rb".freeze, "lib/ollama_chat/database/models/prompt.rb".freeze, "lib/ollama_chat/database/models/session.rb".freeze, "lib/ollama_chat/database/session_locking.rb".freeze, "lib/ollama_chat/dialog.rb".freeze, "lib/ollama_chat/document_cache.rb".freeze, "lib/ollama_chat/favourites_management.rb".freeze, "lib/ollama_chat/feedback.rb".freeze, "lib/ollama_chat/file_editing.rb".freeze, "lib/ollama_chat/follow_chat.rb".freeze, "lib/ollama_chat/history.rb".freeze, "lib/ollama_chat/http_handling.rb".freeze, "lib/ollama_chat/information.rb".freeze, "lib/ollama_chat/input_content.rb".freeze, "lib/ollama_chat/invidious.rb".freeze, "lib/ollama_chat/kramdown_ansi.rb".freeze, "lib/ollama_chat/links_set.rb".freeze, "lib/ollama_chat/location_handling.rb".freeze, "lib/ollama_chat/logging.rb".freeze, "lib/ollama_chat/message.rb".freeze, "lib/ollama_chat/message_editing.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/oc.rb".freeze, "lib/ollama_chat/ollama_chat_config.rb".freeze, "lib/ollama_chat/pager.rb".freeze, "lib/ollama_chat/parsing.rb".freeze, "lib/ollama_chat/personae_management.rb".freeze, "lib/ollama_chat/prompt_handling.rb".freeze, "lib/ollama_chat/prompt_management.rb".freeze, "lib/ollama_chat/rag_handling.rb".freeze, "lib/ollama_chat/redis_cache.rb".freeze, "lib/ollama_chat/say.rb".freeze, "lib/ollama_chat/server_socket.rb".freeze, "lib/ollama_chat/session_management.rb".freeze, "lib/ollama_chat/source_fetching.rb".freeze, "lib/ollama_chat/speaker.rb".freeze, "lib/ollama_chat/state_selectors.rb".freeze, "lib/ollama_chat/switches.rb".freeze, "lib/ollama_chat/system_prompt_management.rb".freeze, "lib/ollama_chat/think_control.rb".freeze, "lib/ollama_chat/token_estimator.rb".freeze, "lib/ollama_chat/token_estimator/crude.rb".freeze, "lib/ollama_chat/tool_calling.rb".freeze, "lib/ollama_chat/tools.rb".freeze, "lib/ollama_chat/tools/browse.rb".freeze, "lib/ollama_chat/tools/compute_bmi.rb".freeze, "lib/ollama_chat/tools/concern.rb".freeze, "lib/ollama_chat/tools/copy_to_clipboard.rb".freeze, "lib/ollama_chat/tools/delete_file.rb".freeze, "lib/ollama_chat/tools/eval_ruby.rb".freeze, "lib/ollama_chat/tools/execute_grep.rb".freeze, "lib/ollama_chat/tools/execute_jira_twg.rb".freeze, "lib/ollama_chat/tools/execute_ri.rb".freeze, "lib/ollama_chat/tools/execute_shell.rb".freeze, "lib/ollama_chat/tools/forget.rb".freeze, "lib/ollama_chat/tools/generate_image.rb".freeze, "lib/ollama_chat/tools/generate_password.rb".freeze, "lib/ollama_chat/tools/get_current_weather.rb".freeze, "lib/ollama_chat/tools/get_cve.rb".freeze, "lib/ollama_chat/tools/get_endoflife.rb".freeze, "lib/ollama_chat/tools/get_ghr.rb".freeze, "lib/ollama_chat/tools/get_jira_issue.rb".freeze, "lib/ollama_chat/tools/get_location.rb".freeze, "lib/ollama_chat/tools/get_rfc.rb".freeze, "lib/ollama_chat/tools/get_time.rb".freeze, "lib/ollama_chat/tools/get_url.rb".freeze, "lib/ollama_chat/tools/list_directory.rb".freeze, "lib/ollama_chat/tools/lookup_gem_path.rb".freeze, "lib/ollama_chat/tools/lookup_group.rb".freeze, "lib/ollama_chat/tools/memorize.rb".freeze, "lib/ollama_chat/tools/move_file.rb".freeze, "lib/ollama_chat/tools/open_file_in_editor.rb".freeze, "lib/ollama_chat/tools/paste_from_clipboard.rb".freeze, "lib/ollama_chat/tools/paste_into_editor.rb".freeze, "lib/ollama_chat/tools/patch_file.rb".freeze, "lib/ollama_chat/tools/read_file.rb".freeze, "lib/ollama_chat/tools/resolve_tag.rb".freeze, "lib/ollama_chat/tools/roll_dice.rb".freeze, "lib/ollama_chat/tools/run_tests.rb".freeze, "lib/ollama_chat/tools/search_knowledge.rb".freeze, "lib/ollama_chat/tools/search_web.rb".freeze, "lib/ollama_chat/tools/write_file.rb".freeze, "lib/ollama_chat/tts.rb".freeze, "lib/ollama_chat/utils.rb".freeze, "lib/ollama_chat/utils/analyze_directory.rb".freeze, "lib/ollama_chat/utils/audio_player.rb".freeze, "lib/ollama_chat/utils/backup.rb".freeze, "lib/ollama_chat/utils/cache_fetcher.rb".freeze, "lib/ollama_chat/utils/chooser.rb".freeze, "lib/ollama_chat/utils/excon_logger.rb".freeze, "lib/ollama_chat/utils/fetcher.rb".freeze, "lib/ollama_chat/utils/json_jsonl_io.rb".freeze, "lib/ollama_chat/utils/log_rotation.rb".freeze, "lib/ollama_chat/utils/log_viewer.rb".freeze, "lib/ollama_chat/utils/ordered_queue.rb".freeze, "lib/ollama_chat/utils/path_completer.rb".freeze, "lib/ollama_chat/utils/path_validator.rb".freeze, "lib/ollama_chat/utils/png_metadata_extractor.rb".freeze, "lib/ollama_chat/utils/strip_ansi.rb".freeze, "lib/ollama_chat/utils/tag_resolver.rb".freeze, "lib/ollama_chat/utils/utf8_converter.rb".freeze, "lib/ollama_chat/utils/value_formatter.rb".freeze, "lib/ollama_chat/uuid_v7.rb".freeze, "lib/ollama_chat/version.rb".freeze, "lib/ollama_chat/vim.rb".freeze, "lib/ollama_chat/web_searching.rb".freeze]
|
|
16
|
+
s.files = [".utilsrc".freeze, "CHANGES.md".freeze, "Gemfile".freeze, "LICENSE".freeze, "README.md".freeze, "Rakefile".freeze, "bin/ollama_chat".freeze, "bin/ollama_chat_log".freeze, "bin/ollama_chat_send".freeze, "config/searxng/settings.yml".freeze, "config/sherlock.md".freeze, "docker-compose.yml".freeze, "lib/ollama_chat.rb".freeze, "lib/ollama_chat/asr.rb".freeze, "lib/ollama_chat/chat.rb".freeze, "lib/ollama_chat/clipboard.rb".freeze, "lib/ollama_chat/collection_search.rb".freeze, "lib/ollama_chat/command_concern.rb".freeze, "lib/ollama_chat/commands.rb".freeze, "lib/ollama_chat/compaction.rb".freeze, "lib/ollama_chat/config_handling.rb".freeze, "lib/ollama_chat/conversation.rb".freeze, "lib/ollama_chat/database.rb".freeze, "lib/ollama_chat/database/duplicatable.rb".freeze, "lib/ollama_chat/database/migrations.rb".freeze, "lib/ollama_chat/database/migrations/001_initial_schema.rb".freeze, "lib/ollama_chat/database/migrations/002_add_links_to_sessions.rb".freeze, "lib/ollama_chat/database/migrations/003_add_history_to_sessions.rb".freeze, "lib/ollama_chat/database/migrations/004_add_profile_to_model_options.rb".freeze, "lib/ollama_chat/database/migrations/005_add_context_format_to_sessions.rb".freeze, "lib/ollama_chat/database/migrations/006_rename_system_prompt_context_to_system.rb".freeze, "lib/ollama_chat/database/migrations/007_add_collections_table.rb".freeze, "lib/ollama_chat/database/migrations/008_drop_think_mode_constraint.rb".freeze, "lib/ollama_chat/database/migrations/009_add_app_states_table.rb".freeze, "lib/ollama_chat/database/migrations/010_add_enabled_to_collections.rb".freeze, "lib/ollama_chat/database/migrations/011_add_trigger_to_sessions.rb".freeze, "lib/ollama_chat/database/models/app_state.rb".freeze, "lib/ollama_chat/database/models/collection.rb".freeze, "lib/ollama_chat/database/models/favourite.rb".freeze, "lib/ollama_chat/database/models/model_options.rb".freeze, "lib/ollama_chat/database/models/prompt.rb".freeze, "lib/ollama_chat/database/models/session.rb".freeze, "lib/ollama_chat/database/session_locking.rb".freeze, "lib/ollama_chat/dialog.rb".freeze, "lib/ollama_chat/document_cache.rb".freeze, "lib/ollama_chat/favourites_management.rb".freeze, "lib/ollama_chat/feedback.rb".freeze, "lib/ollama_chat/file_editing.rb".freeze, "lib/ollama_chat/follow_chat.rb".freeze, "lib/ollama_chat/history.rb".freeze, "lib/ollama_chat/http_handling.rb".freeze, "lib/ollama_chat/information.rb".freeze, "lib/ollama_chat/input_content.rb".freeze, "lib/ollama_chat/invidious.rb".freeze, "lib/ollama_chat/kramdown_ansi.rb".freeze, "lib/ollama_chat/links_set.rb".freeze, "lib/ollama_chat/location_handling.rb".freeze, "lib/ollama_chat/logging.rb".freeze, "lib/ollama_chat/message.rb".freeze, "lib/ollama_chat/message_editing.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/oc.rb".freeze, "lib/ollama_chat/ollama_chat_config.rb".freeze, "lib/ollama_chat/ollama_chat_config/default_config.yml".freeze, "lib/ollama_chat/pager.rb".freeze, "lib/ollama_chat/parsing.rb".freeze, "lib/ollama_chat/personae_management.rb".freeze, "lib/ollama_chat/prompt_handling.rb".freeze, "lib/ollama_chat/prompt_management.rb".freeze, "lib/ollama_chat/rag_handling.rb".freeze, "lib/ollama_chat/redis_cache.rb".freeze, "lib/ollama_chat/say.rb".freeze, "lib/ollama_chat/server_socket.rb".freeze, "lib/ollama_chat/session_management.rb".freeze, "lib/ollama_chat/source_fetching.rb".freeze, "lib/ollama_chat/speaker.rb".freeze, "lib/ollama_chat/state_selectors.rb".freeze, "lib/ollama_chat/switches.rb".freeze, "lib/ollama_chat/system_prompt_management.rb".freeze, "lib/ollama_chat/think_control.rb".freeze, "lib/ollama_chat/token_estimator.rb".freeze, "lib/ollama_chat/token_estimator/crude.rb".freeze, "lib/ollama_chat/tool_calling.rb".freeze, "lib/ollama_chat/tools.rb".freeze, "lib/ollama_chat/tools/browse.rb".freeze, "lib/ollama_chat/tools/compute_bmi.rb".freeze, "lib/ollama_chat/tools/concern.rb".freeze, "lib/ollama_chat/tools/copy_to_clipboard.rb".freeze, "lib/ollama_chat/tools/delete_file.rb".freeze, "lib/ollama_chat/tools/eval_ruby.rb".freeze, "lib/ollama_chat/tools/execute_grep.rb".freeze, "lib/ollama_chat/tools/execute_jira_twg.rb".freeze, "lib/ollama_chat/tools/execute_ri.rb".freeze, "lib/ollama_chat/tools/execute_shell.rb".freeze, "lib/ollama_chat/tools/forget.rb".freeze, "lib/ollama_chat/tools/generate_image.rb".freeze, "lib/ollama_chat/tools/generate_password.rb".freeze, "lib/ollama_chat/tools/get_current_weather.rb".freeze, "lib/ollama_chat/tools/get_cve.rb".freeze, "lib/ollama_chat/tools/get_endoflife.rb".freeze, "lib/ollama_chat/tools/get_ghr.rb".freeze, "lib/ollama_chat/tools/get_jira_issue.rb".freeze, "lib/ollama_chat/tools/get_location.rb".freeze, "lib/ollama_chat/tools/get_rfc.rb".freeze, "lib/ollama_chat/tools/get_time.rb".freeze, "lib/ollama_chat/tools/get_url.rb".freeze, "lib/ollama_chat/tools/list_directory.rb".freeze, "lib/ollama_chat/tools/lookup_gem_path.rb".freeze, "lib/ollama_chat/tools/lookup_group.rb".freeze, "lib/ollama_chat/tools/memorize.rb".freeze, "lib/ollama_chat/tools/move_file.rb".freeze, "lib/ollama_chat/tools/open_file_in_editor.rb".freeze, "lib/ollama_chat/tools/paste_from_clipboard.rb".freeze, "lib/ollama_chat/tools/paste_into_editor.rb".freeze, "lib/ollama_chat/tools/patch_file.rb".freeze, "lib/ollama_chat/tools/read_file.rb".freeze, "lib/ollama_chat/tools/resolve_tag.rb".freeze, "lib/ollama_chat/tools/roll_dice.rb".freeze, "lib/ollama_chat/tools/run_tests.rb".freeze, "lib/ollama_chat/tools/search_knowledge.rb".freeze, "lib/ollama_chat/tools/search_web.rb".freeze, "lib/ollama_chat/tools/write_file.rb".freeze, "lib/ollama_chat/tts.rb".freeze, "lib/ollama_chat/utils.rb".freeze, "lib/ollama_chat/utils/analyze_directory.rb".freeze, "lib/ollama_chat/utils/audio_player.rb".freeze, "lib/ollama_chat/utils/backup.rb".freeze, "lib/ollama_chat/utils/cache_fetcher.rb".freeze, "lib/ollama_chat/utils/chooser.rb".freeze, "lib/ollama_chat/utils/excon_logger.rb".freeze, "lib/ollama_chat/utils/fetcher.rb".freeze, "lib/ollama_chat/utils/json_jsonl_io.rb".freeze, "lib/ollama_chat/utils/log_rotation.rb".freeze, "lib/ollama_chat/utils/log_viewer.rb".freeze, "lib/ollama_chat/utils/ordered_queue.rb".freeze, "lib/ollama_chat/utils/path_completer.rb".freeze, "lib/ollama_chat/utils/path_validator.rb".freeze, "lib/ollama_chat/utils/png_metadata_extractor.rb".freeze, "lib/ollama_chat/utils/strip_ansi.rb".freeze, "lib/ollama_chat/utils/tag_resolver.rb".freeze, "lib/ollama_chat/utils/utf8_converter.rb".freeze, "lib/ollama_chat/utils/value_formatter.rb".freeze, "lib/ollama_chat/uuid_v7.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_ps.json".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/conversation.jsonl".freeze, "spec/assets/deep/deeper/empty.txt".freeze, "spec/assets/deep/deeper/not-empty.txt".freeze, "spec/assets/deep/empty.txt".freeze, "spec/assets/duckduckgo.html".freeze, "spec/assets/example.atom".freeze, "spec/assets/example.csv".freeze, "spec/assets/example.epub".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/example_with_quote.html".freeze, "spec/assets/fluffy.png".freeze, "spec/assets/kitten.jpg".freeze, "spec/assets/linux.oga".freeze, "spec/assets/miyu.png".freeze, "spec/assets/pirateweather.json".freeze, "spec/assets/prompt.txt".freeze, "spec/assets/searxng.json".freeze, "spec/ollama_chat/asr_spec.rb".freeze, "spec/ollama_chat/chat_spec.rb".freeze, "spec/ollama_chat/clipboard_spec.rb".freeze, "spec/ollama_chat/collection_search_spec.rb".freeze, "spec/ollama_chat/command_concern_spec.rb".freeze, "spec/ollama_chat/commands_spec.rb".freeze, "spec/ollama_chat/compaction_spec.rb".freeze, "spec/ollama_chat/config_handling_spec.rb".freeze, "spec/ollama_chat/conversation_spec.rb".freeze, "spec/ollama_chat/database/models/favourite_spec.rb".freeze, "spec/ollama_chat/favourites_management_spec.rb".freeze, "spec/ollama_chat/file_editing_spec.rb".freeze, "spec/ollama_chat/follow_chat_spec.rb".freeze, "spec/ollama_chat/history_spec.rb".freeze, "spec/ollama_chat/http_handling_spec.rb".freeze, "spec/ollama_chat/information_spec.rb".freeze, "spec/ollama_chat/input_content_spec.rb".freeze, "spec/ollama_chat/invidious_spec.rb".freeze, "spec/ollama_chat/kramdown_ansi_spec.rb".freeze, "spec/ollama_chat/message_editing_spec.rb".freeze, "spec/ollama_chat/message_list_spec.rb".freeze, "spec/ollama_chat/message_output_spec.rb".freeze, "spec/ollama_chat/message_spec.rb".freeze, "spec/ollama_chat/model_handling_spec.rb".freeze, "spec/ollama_chat/parsing_spec.rb".freeze, "spec/ollama_chat/prompt_handling_spec.rb".freeze, "spec/ollama_chat/prompt_management_spec.rb".freeze, "spec/ollama_chat/rag_handling_spec.rb".freeze, "spec/ollama_chat/redis_cache_spec.rb".freeze, "spec/ollama_chat/server_socket_spec.rb".freeze, "spec/ollama_chat/session_management_spec.rb".freeze, "spec/ollama_chat/source_fetching_spec.rb".freeze, "spec/ollama_chat/speaker_spec.rb".freeze, "spec/ollama_chat/state_selectors_spec.rb".freeze, "spec/ollama_chat/switches_spec.rb".freeze, "spec/ollama_chat/system_prompt_management_spec.rb".freeze, "spec/ollama_chat/think_control_spec.rb".freeze, "spec/ollama_chat/token_estimator_spec.rb".freeze, "spec/ollama_chat/tool_calling_spec.rb".freeze, "spec/ollama_chat/tools/browse_spec.rb".freeze, "spec/ollama_chat/tools/compute_bmi_spec.rb".freeze, "spec/ollama_chat/tools/concern_spec.rb".freeze, "spec/ollama_chat/tools/copy_to_clipboard_spec.rb".freeze, "spec/ollama_chat/tools/delete_file_spec.rb".freeze, "spec/ollama_chat/tools/execute_grep_spec.rb".freeze, "spec/ollama_chat/tools/execute_jira_twg_spec.rb".freeze, "spec/ollama_chat/tools/execute_ri_spec.rb".freeze, "spec/ollama_chat/tools/execute_shell_spec.rb".freeze, "spec/ollama_chat/tools/forget_spec.rb".freeze, "spec/ollama_chat/tools/generate_image_spec.rb".freeze, "spec/ollama_chat/tools/generate_password_spec.rb".freeze, "spec/ollama_chat/tools/get_current_weather_spec.rb".freeze, "spec/ollama_chat/tools/get_cve_spec.rb".freeze, "spec/ollama_chat/tools/get_endoflife_spec.rb".freeze, "spec/ollama_chat/tools/get_ghr_spec.rb".freeze, "spec/ollama_chat/tools/get_jira_issue_spec.rb".freeze, "spec/ollama_chat/tools/get_location_spec.rb".freeze, "spec/ollama_chat/tools/get_rfc_spec.rb".freeze, "spec/ollama_chat/tools/get_time_spec.rb".freeze, "spec/ollama_chat/tools/get_url_spec.rb".freeze, "spec/ollama_chat/tools/list_directory_spec.rb".freeze, "spec/ollama_chat/tools/lookup_gem_path_spec.rb".freeze, "spec/ollama_chat/tools/lookup_group_spec.rb".freeze, "spec/ollama_chat/tools/memorize_spec.rb".freeze, "spec/ollama_chat/tools/move_file_spec.rb".freeze, "spec/ollama_chat/tools/open_file_in_editor_spec.rb".freeze, "spec/ollama_chat/tools/paste_from_clipboard_spec.rb".freeze, "spec/ollama_chat/tools/paste_into_editor_spec.rb".freeze, "spec/ollama_chat/tools/patch_file_spec.rb".freeze, "spec/ollama_chat/tools/read_file_spec.rb".freeze, "spec/ollama_chat/tools/resolve_tag_spec.rb".freeze, "spec/ollama_chat/tools/roll_dice_spec.rb".freeze, "spec/ollama_chat/tools/run_tests_spec.rb".freeze, "spec/ollama_chat/tools/search_knowledge_spec.rb".freeze, "spec/ollama_chat/tools/search_web_spec.rb".freeze, "spec/ollama_chat/tools/write_file_spec.rb".freeze, "spec/ollama_chat/tts_spec.rb".freeze, "spec/ollama_chat/utils/analyze_directory_spec.rb".freeze, "spec/ollama_chat/utils/audio_player_spec.rb".freeze, "spec/ollama_chat/utils/cache_fetcher_spec.rb".freeze, "spec/ollama_chat/utils/excon_logger_spec.rb".freeze, "spec/ollama_chat/utils/fetcher_spec.rb".freeze, "spec/ollama_chat/utils/log_rotation_spec.rb".freeze, "spec/ollama_chat/utils/log_viewer_spec.rb".freeze, "spec/ollama_chat/utils/ordered_queue_spec.rb".freeze, "spec/ollama_chat/utils/path_completer_spec.rb".freeze, "spec/ollama_chat/utils/png_metadata_extractor_spec.rb".freeze, "spec/ollama_chat/vim_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]
|
|
20
20
|
s.required_ruby_version = Gem::Requirement.new(">= 3.2".freeze)
|
|
21
21
|
s.rubygems_version = "4.0.22".freeze
|
|
22
22
|
s.summary = "A command-line interface (CLI) for interacting with an Ollama AI model.".freeze
|
|
23
|
-
s.test_files = ["spec/assets/example.rb".freeze, "spec/ollama_chat/asr_spec.rb".freeze, "spec/ollama_chat/chat_spec.rb".freeze, "spec/ollama_chat/clipboard_spec.rb".freeze, "spec/ollama_chat/collection_search_spec.rb".freeze, "spec/ollama_chat/command_concern_spec.rb".freeze, "spec/ollama_chat/commands_spec.rb".freeze, "spec/ollama_chat/compaction_spec.rb".freeze, "spec/ollama_chat/config_handling_spec.rb".freeze, "spec/ollama_chat/conversation_spec.rb".freeze, "spec/ollama_chat/database/models/favourite_spec.rb".freeze, "spec/ollama_chat/favourites_management_spec.rb".freeze, "spec/ollama_chat/file_editing_spec.rb".freeze, "spec/ollama_chat/follow_chat_spec.rb".freeze, "spec/ollama_chat/history_spec.rb".freeze, "spec/ollama_chat/http_handling_spec.rb".freeze, "spec/ollama_chat/information_spec.rb".freeze, "spec/ollama_chat/input_content_spec.rb".freeze, "spec/ollama_chat/invidious_spec.rb".freeze, "spec/ollama_chat/kramdown_ansi_spec.rb".freeze, "spec/ollama_chat/message_editing_spec.rb".freeze, "spec/ollama_chat/message_list_spec.rb".freeze, "spec/ollama_chat/message_output_spec.rb".freeze, "spec/ollama_chat/message_spec.rb".freeze, "spec/ollama_chat/model_handling_spec.rb".freeze, "spec/ollama_chat/parsing_spec.rb".freeze, "spec/ollama_chat/prompt_handling_spec.rb".freeze, "spec/ollama_chat/prompt_management_spec.rb".freeze, "spec/ollama_chat/rag_handling_spec.rb".freeze, "spec/ollama_chat/redis_cache_spec.rb".freeze, "spec/ollama_chat/server_socket_spec.rb".freeze, "spec/ollama_chat/session_management_spec.rb".freeze, "spec/ollama_chat/source_fetching_spec.rb".freeze, "spec/ollama_chat/speaker_spec.rb".freeze, "spec/ollama_chat/state_selectors_spec.rb".freeze, "spec/ollama_chat/switches_spec.rb".freeze, "spec/ollama_chat/system_prompt_management_spec.rb".freeze, "spec/ollama_chat/think_control_spec.rb".freeze, "spec/ollama_chat/token_estimator_spec.rb".freeze, "spec/ollama_chat/tool_calling_spec.rb".freeze, "spec/ollama_chat/tools/browse_spec.rb".freeze, "spec/ollama_chat/tools/compute_bmi_spec.rb".freeze, "spec/ollama_chat/tools/concern_spec.rb".freeze, "spec/ollama_chat/tools/copy_to_clipboard_spec.rb".freeze, "spec/ollama_chat/tools/delete_file_spec.rb".freeze, "spec/ollama_chat/tools/
|
|
23
|
+
s.test_files = ["spec/assets/example.rb".freeze, "spec/ollama_chat/asr_spec.rb".freeze, "spec/ollama_chat/chat_spec.rb".freeze, "spec/ollama_chat/clipboard_spec.rb".freeze, "spec/ollama_chat/collection_search_spec.rb".freeze, "spec/ollama_chat/command_concern_spec.rb".freeze, "spec/ollama_chat/commands_spec.rb".freeze, "spec/ollama_chat/compaction_spec.rb".freeze, "spec/ollama_chat/config_handling_spec.rb".freeze, "spec/ollama_chat/conversation_spec.rb".freeze, "spec/ollama_chat/database/models/favourite_spec.rb".freeze, "spec/ollama_chat/favourites_management_spec.rb".freeze, "spec/ollama_chat/file_editing_spec.rb".freeze, "spec/ollama_chat/follow_chat_spec.rb".freeze, "spec/ollama_chat/history_spec.rb".freeze, "spec/ollama_chat/http_handling_spec.rb".freeze, "spec/ollama_chat/information_spec.rb".freeze, "spec/ollama_chat/input_content_spec.rb".freeze, "spec/ollama_chat/invidious_spec.rb".freeze, "spec/ollama_chat/kramdown_ansi_spec.rb".freeze, "spec/ollama_chat/message_editing_spec.rb".freeze, "spec/ollama_chat/message_list_spec.rb".freeze, "spec/ollama_chat/message_output_spec.rb".freeze, "spec/ollama_chat/message_spec.rb".freeze, "spec/ollama_chat/model_handling_spec.rb".freeze, "spec/ollama_chat/parsing_spec.rb".freeze, "spec/ollama_chat/prompt_handling_spec.rb".freeze, "spec/ollama_chat/prompt_management_spec.rb".freeze, "spec/ollama_chat/rag_handling_spec.rb".freeze, "spec/ollama_chat/redis_cache_spec.rb".freeze, "spec/ollama_chat/server_socket_spec.rb".freeze, "spec/ollama_chat/session_management_spec.rb".freeze, "spec/ollama_chat/source_fetching_spec.rb".freeze, "spec/ollama_chat/speaker_spec.rb".freeze, "spec/ollama_chat/state_selectors_spec.rb".freeze, "spec/ollama_chat/switches_spec.rb".freeze, "spec/ollama_chat/system_prompt_management_spec.rb".freeze, "spec/ollama_chat/think_control_spec.rb".freeze, "spec/ollama_chat/token_estimator_spec.rb".freeze, "spec/ollama_chat/tool_calling_spec.rb".freeze, "spec/ollama_chat/tools/browse_spec.rb".freeze, "spec/ollama_chat/tools/compute_bmi_spec.rb".freeze, "spec/ollama_chat/tools/concern_spec.rb".freeze, "spec/ollama_chat/tools/copy_to_clipboard_spec.rb".freeze, "spec/ollama_chat/tools/delete_file_spec.rb".freeze, "spec/ollama_chat/tools/execute_grep_spec.rb".freeze, "spec/ollama_chat/tools/execute_jira_twg_spec.rb".freeze, "spec/ollama_chat/tools/execute_ri_spec.rb".freeze, "spec/ollama_chat/tools/execute_shell_spec.rb".freeze, "spec/ollama_chat/tools/forget_spec.rb".freeze, "spec/ollama_chat/tools/generate_image_spec.rb".freeze, "spec/ollama_chat/tools/generate_password_spec.rb".freeze, "spec/ollama_chat/tools/get_current_weather_spec.rb".freeze, "spec/ollama_chat/tools/get_cve_spec.rb".freeze, "spec/ollama_chat/tools/get_endoflife_spec.rb".freeze, "spec/ollama_chat/tools/get_ghr_spec.rb".freeze, "spec/ollama_chat/tools/get_jira_issue_spec.rb".freeze, "spec/ollama_chat/tools/get_location_spec.rb".freeze, "spec/ollama_chat/tools/get_rfc_spec.rb".freeze, "spec/ollama_chat/tools/get_time_spec.rb".freeze, "spec/ollama_chat/tools/get_url_spec.rb".freeze, "spec/ollama_chat/tools/list_directory_spec.rb".freeze, "spec/ollama_chat/tools/lookup_gem_path_spec.rb".freeze, "spec/ollama_chat/tools/lookup_group_spec.rb".freeze, "spec/ollama_chat/tools/memorize_spec.rb".freeze, "spec/ollama_chat/tools/move_file_spec.rb".freeze, "spec/ollama_chat/tools/open_file_in_editor_spec.rb".freeze, "spec/ollama_chat/tools/paste_from_clipboard_spec.rb".freeze, "spec/ollama_chat/tools/paste_into_editor_spec.rb".freeze, "spec/ollama_chat/tools/patch_file_spec.rb".freeze, "spec/ollama_chat/tools/read_file_spec.rb".freeze, "spec/ollama_chat/tools/resolve_tag_spec.rb".freeze, "spec/ollama_chat/tools/roll_dice_spec.rb".freeze, "spec/ollama_chat/tools/run_tests_spec.rb".freeze, "spec/ollama_chat/tools/search_knowledge_spec.rb".freeze, "spec/ollama_chat/tools/search_web_spec.rb".freeze, "spec/ollama_chat/tools/write_file_spec.rb".freeze, "spec/ollama_chat/tts_spec.rb".freeze, "spec/ollama_chat/utils/analyze_directory_spec.rb".freeze, "spec/ollama_chat/utils/audio_player_spec.rb".freeze, "spec/ollama_chat/utils/cache_fetcher_spec.rb".freeze, "spec/ollama_chat/utils/excon_logger_spec.rb".freeze, "spec/ollama_chat/utils/fetcher_spec.rb".freeze, "spec/ollama_chat/utils/log_rotation_spec.rb".freeze, "spec/ollama_chat/utils/log_viewer_spec.rb".freeze, "spec/ollama_chat/utils/ordered_queue_spec.rb".freeze, "spec/ollama_chat/utils/path_completer_spec.rb".freeze, "spec/ollama_chat/utils/png_metadata_extractor_spec.rb".freeze, "spec/ollama_chat/vim_spec.rb".freeze, "spec/ollama_chat/web_searching_spec.rb".freeze, "spec/spec_helper.rb".freeze]
|
|
24
24
|
|
|
25
25
|
s.specification_version = 4
|
|
26
26
|
|
|
@@ -43,7 +43,7 @@ Gem::Specification.new do |s|
|
|
|
43
43
|
s.add_runtime_dependency(%q<reverse_markdown>.freeze, ["~> 3.0".freeze])
|
|
44
44
|
s.add_runtime_dependency(%q<kramdown-ansi>.freeze, ["~> 0.5".freeze])
|
|
45
45
|
s.add_runtime_dependency(%q<complex_config>.freeze, ["~> 0.22".freeze, ">= 0.22.2".freeze])
|
|
46
|
-
s.add_runtime_dependency(%q<tins>.freeze, ["~> 1.60".freeze])
|
|
46
|
+
s.add_runtime_dependency(%q<tins>.freeze, ["~> 1.60".freeze, ">= 1.60.1".freeze])
|
|
47
47
|
s.add_runtime_dependency(%q<search_ui>.freeze, [">= 0.2".freeze])
|
|
48
48
|
s.add_runtime_dependency(%q<amatch>.freeze, ["~> 0.4".freeze])
|
|
49
49
|
s.add_runtime_dependency(%q<pdf-reader>.freeze, ["~> 2.0".freeze])
|
|
@@ -434,7 +434,7 @@ describe OllamaChat::RAGHandling do
|
|
|
434
434
|
with('a.rb').and_return(true)
|
|
435
435
|
expect(docs).to receive(:source_remove).with('a.rb')
|
|
436
436
|
expect(chat).to receive(:embed).
|
|
437
|
-
with('a.rb', tags: %w[ t1 ]).and_return('Embedded a.rb')
|
|
437
|
+
with('a.rb', prompt: anything, tags: %w[ t1 ]).and_return('Embedded a.rb')
|
|
438
438
|
|
|
439
439
|
expect(chat.update_collection('tc')).to eq 'Embedded a.rb'
|
|
440
440
|
end
|
|
@@ -459,9 +459,9 @@ describe OllamaChat::RAGHandling do
|
|
|
459
459
|
expect(chat).to receive(:database_collection?).
|
|
460
460
|
and_return(col_model[name: 'tc'])
|
|
461
461
|
expect(docs).to receive(:each_record)
|
|
462
|
-
expect(chat).to receive(:all_file_set).and_return(Set[ file ])
|
|
462
|
+
expect(chat).to receive(:all_file_set).twice.and_return(Set[ file ])
|
|
463
463
|
expect(chat).to receive(:embed).
|
|
464
|
-
with(file.to_s, tags: []).and_return('Embedded n.rb')
|
|
464
|
+
with(file.to_s, prompt: anything, tags: []).and_return('Embedded n.rb')
|
|
465
465
|
|
|
466
466
|
expect(chat.update_collection('tc')).to eq 'Embedded n.rb'
|
|
467
467
|
end
|
|
@@ -49,7 +49,7 @@ describe OllamaChat::Tools::GetURL do
|
|
|
49
49
|
|
|
50
50
|
context 'with an invalid scheme' do
|
|
51
51
|
it 'rejects URLs whose scheme is not whitelisted' do
|
|
52
|
-
url = '
|
|
52
|
+
url = 'ftp://files.example.com/document.pdf'
|
|
53
53
|
|
|
54
54
|
tool_call = double(
|
|
55
55
|
'ToolCall',
|
|
@@ -72,10 +72,10 @@ describe OllamaChat::Tools::GetURL do
|
|
|
72
72
|
|
|
73
73
|
json = json_object(result)
|
|
74
74
|
expect(json.error).to eq 'OllamaChat::ToolFunctionArgumentError'
|
|
75
|
-
expect(json.message).to match(/scheme "
|
|
75
|
+
expect(json.message).to match(/scheme "ftp" not allowed/)
|
|
76
76
|
expect(json.url).to eq url
|
|
77
77
|
expect(described_class.summary_template(result:)).
|
|
78
|
-
to match(/scheme "
|
|
78
|
+
to match(/scheme "ftp" not allowed/)
|
|
79
79
|
end
|
|
80
80
|
end
|
|
81
81
|
|
|
@@ -191,7 +191,7 @@ describe OllamaChat::Tools::GetURL do
|
|
|
191
191
|
let(:url) { 'https://www.example.com/foo' }
|
|
192
192
|
|
|
193
193
|
it 'handles image content types' do
|
|
194
|
-
source_io = double('SourceIO', content_type: double(media_type: 'image'))
|
|
194
|
+
source_io = double('SourceIO', content_type: double(media_type: 'image', sub_type: 'jpeg'))
|
|
195
195
|
expect(chat).to receive(:fetch_source).and_yield(source_io)
|
|
196
196
|
expect(chat).to receive(:add_image).with(chat.images, source_io, URI.parse(url))
|
|
197
197
|
|
|
@@ -203,6 +203,24 @@ describe OllamaChat::Tools::GetURL do
|
|
|
203
203
|
expect(json.message).to eq('Received requested URL successfully.')
|
|
204
204
|
end
|
|
205
205
|
|
|
206
|
+
it 'handles image/png with embedded character card' do
|
|
207
|
+
png_url = 'file://' + asset('fluffy.png')
|
|
208
|
+
|
|
209
|
+
expect(chat).to receive(:add_image)
|
|
210
|
+
|
|
211
|
+
args = double(
|
|
212
|
+
url: png_url,
|
|
213
|
+
document_policy: 'ignoring',
|
|
214
|
+
words: nil, instruction: nil, language: nil,
|
|
215
|
+
)
|
|
216
|
+
tool_call = double(function: double(arguments: args))
|
|
217
|
+
|
|
218
|
+
result = described_class.new(chat).execute(tool_call)
|
|
219
|
+
json = json_object(result)
|
|
220
|
+
expect(json.content).to include('"name": "Fluffy McFluffington"')
|
|
221
|
+
expect(json.message).to eq('Received requested URL successfully.')
|
|
222
|
+
end
|
|
223
|
+
|
|
206
224
|
it 'handles audio content types via ASR transcription' do
|
|
207
225
|
source_io = double('SourceIO', content_type: double(media_type: 'audio', to_s: 'audio/mp3'))
|
|
208
226
|
expect(chat).to receive(:fetch_source).and_yield(source_io)
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
describe OllamaChat::Tools::
|
|
1
|
+
describe OllamaChat::Tools::ListDirectory do
|
|
2
2
|
let :chat do
|
|
3
3
|
OllamaChat::Chat.new(argv: chat_default_config)
|
|
4
4
|
end
|
|
@@ -6,7 +6,7 @@ describe OllamaChat::Tools::DirectoryStructure do
|
|
|
6
6
|
connect_to_ollama_server
|
|
7
7
|
|
|
8
8
|
it 'can have name' do
|
|
9
|
-
expect(described_class.new(chat).name).to eq '
|
|
9
|
+
expect(described_class.new(chat).name).to eq 'list_directory'
|
|
10
10
|
end
|
|
11
11
|
|
|
12
12
|
it 'can have tool' do
|
|
@@ -17,7 +17,7 @@ describe OllamaChat::Tools::DirectoryStructure do
|
|
|
17
17
|
tool_call = double(
|
|
18
18
|
'ToolCall',
|
|
19
19
|
function: double(
|
|
20
|
-
name: '
|
|
20
|
+
name: 'list_directory',
|
|
21
21
|
arguments: double(
|
|
22
22
|
path: 'spec/assets',
|
|
23
23
|
max_depth: nil,
|
|
@@ -41,7 +41,7 @@ describe OllamaChat::Tools::DirectoryStructure do
|
|
|
41
41
|
tool_call = double(
|
|
42
42
|
'ToolCall',
|
|
43
43
|
function: double(
|
|
44
|
-
name: '
|
|
44
|
+
name: 'list_directory',
|
|
45
45
|
arguments: double(
|
|
46
46
|
path: nil, # Should default to '.'
|
|
47
47
|
max_depth: nil,
|
|
@@ -68,7 +68,7 @@ describe OllamaChat::Tools::DirectoryStructure do
|
|
|
68
68
|
tool_call = double(
|
|
69
69
|
'ToolCall',
|
|
70
70
|
function: double(
|
|
71
|
-
name: '
|
|
71
|
+
name: 'list_directory',
|
|
72
72
|
arguments: double(
|
|
73
73
|
path: hidden_dir,
|
|
74
74
|
max_depth: nil,
|
|
@@ -89,7 +89,7 @@ describe OllamaChat::Tools::DirectoryStructure do
|
|
|
89
89
|
tool_call = double(
|
|
90
90
|
'ToolCall',
|
|
91
91
|
function: double(
|
|
92
|
-
name: '
|
|
92
|
+
name: 'list_directory',
|
|
93
93
|
arguments: double(
|
|
94
94
|
path: '/nonexistent/path',
|
|
95
95
|
max_depth: nil,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
describe OllamaChat::Tools::
|
|
1
|
+
describe OllamaChat::Tools::LookupGemPath do
|
|
2
2
|
let :chat do
|
|
3
3
|
OllamaChat::Chat.new(argv: chat_default_config)
|
|
4
4
|
end
|
|
@@ -6,7 +6,7 @@ describe OllamaChat::Tools::GemPathLookup do
|
|
|
6
6
|
connect_to_ollama_server
|
|
7
7
|
|
|
8
8
|
it 'can have name' do
|
|
9
|
-
expect(described_class.new(chat).name).to eq '
|
|
9
|
+
expect(described_class.new(chat).name).to eq 'lookup_gem_path'
|
|
10
10
|
end
|
|
11
11
|
|
|
12
12
|
it 'can have tool' do
|
|
@@ -22,7 +22,7 @@ describe OllamaChat::Tools::GemPathLookup do
|
|
|
22
22
|
tool_call = double(
|
|
23
23
|
'ToolCall',
|
|
24
24
|
function: double(
|
|
25
|
-
name: '
|
|
25
|
+
name: 'lookup_gem_path',
|
|
26
26
|
arguments: double(
|
|
27
27
|
gem_name: 'json'
|
|
28
28
|
)
|
|
@@ -41,7 +41,7 @@ describe OllamaChat::Tools::GemPathLookup do
|
|
|
41
41
|
tool_call = double(
|
|
42
42
|
'ToolCall',
|
|
43
43
|
function: double(
|
|
44
|
-
name: '
|
|
44
|
+
name: 'lookup_gem_path',
|
|
45
45
|
arguments: double(
|
|
46
46
|
gem_name: 'json'
|
|
47
47
|
)
|
|
@@ -105,13 +105,21 @@ describe OllamaChat::Tools::PatchFile do
|
|
|
105
105
|
raise_error(OllamaChat::ToolFunctionArgumentError, /Edit #2 is missing a start_line/)
|
|
106
106
|
end
|
|
107
107
|
|
|
108
|
-
it 'raises error when
|
|
108
|
+
it 'raises error when the text key is omitted' do
|
|
109
109
|
edits = [
|
|
110
|
-
{ start_line:
|
|
111
|
-
{ start_line: 23 },
|
|
110
|
+
{ start_line: 6, end_line: 8 },
|
|
112
111
|
]
|
|
113
112
|
expect { tool.apply_edits(File.read(test_file), edits) }.to\
|
|
114
|
-
raise_error(OllamaChat::ToolFunctionArgumentError, /
|
|
113
|
+
raise_error(OllamaChat::ToolFunctionArgumentError, /missing the text key/)
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
it 'deletes a range when text is explicitly nil' do
|
|
117
|
+
edits = [
|
|
118
|
+
{ start_line: 6, end_line: 8, text: nil },
|
|
119
|
+
]
|
|
120
|
+
result = tool.apply_edits(File.read(test_file), edits)
|
|
121
|
+
expect(result).not_to include('def age')
|
|
122
|
+
expect(result).not_to include('30')
|
|
115
123
|
end
|
|
116
124
|
|
|
117
125
|
|
|
@@ -71,7 +71,7 @@ describe OllamaChat::WebSearching do
|
|
|
71
71
|
end
|
|
72
72
|
|
|
73
73
|
it 'summarizes each URL and interpolates the prompt' do
|
|
74
|
-
expect(chat).to receive(:prompt).with(:
|
|
74
|
+
expect(chat).to receive(:prompt).with(:web_summarize).
|
|
75
75
|
and_return(double('prompt', to_s: 'Q: %{query} R: %{results}'))
|
|
76
76
|
expect(chat).to receive(:search_web).and_return(urls)
|
|
77
77
|
expect(chat).to receive(:summarize).twice
|
|
@@ -88,7 +88,7 @@ describe OllamaChat::WebSearching do
|
|
|
88
88
|
end
|
|
89
89
|
|
|
90
90
|
it 'imports each URL and interpolates the prompt' do
|
|
91
|
-
expect(chat).to receive(:prompt).with(:
|
|
91
|
+
expect(chat).to receive(:prompt).with(:web_import).
|
|
92
92
|
and_return(double('prompt', to_s: 'Q: %{query} R: %{results}'))
|
|
93
93
|
expect(chat).to receive(:search_web).and_return(urls)
|
|
94
94
|
expect(chat).to receive(:import).twice
|
data/spec/spec_helper.rb
CHANGED
|
@@ -217,6 +217,9 @@ RSpec.configure do |config|
|
|
|
217
217
|
|
|
218
218
|
config.before do
|
|
219
219
|
OllamaChat.test_mode = true
|
|
220
|
+
# We are traditional in this household:
|
|
221
|
+
allow(Tins::Terminal).to receive(:columns).and_return(80)
|
|
222
|
+
allow(Tins::Terminal).to receive(:lines).and_return(24)
|
|
220
223
|
const_conf_as(
|
|
221
224
|
'OC::OLLAMA::CHAT::HISTORY' => Pathname.pwd.join('tmp', 'history.json'),
|
|
222
225
|
'OC::OLLAMA::CHAT::LOG::CHAT' => Pathname.pwd.join('tmp', 'chat.log'),
|
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.129
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Florian Frank
|
|
@@ -288,6 +288,9 @@ dependencies:
|
|
|
288
288
|
- - "~>"
|
|
289
289
|
- !ruby/object:Gem::Version
|
|
290
290
|
version: '1.60'
|
|
291
|
+
- - ">="
|
|
292
|
+
- !ruby/object:Gem::Version
|
|
293
|
+
version: 1.60.1
|
|
291
294
|
type: :runtime
|
|
292
295
|
prerelease: false
|
|
293
296
|
version_requirements: !ruby/object:Gem::Requirement
|
|
@@ -295,6 +298,9 @@ dependencies:
|
|
|
295
298
|
- - "~>"
|
|
296
299
|
- !ruby/object:Gem::Version
|
|
297
300
|
version: '1.60'
|
|
301
|
+
- - ">="
|
|
302
|
+
- !ruby/object:Gem::Version
|
|
303
|
+
version: 1.60.1
|
|
298
304
|
- !ruby/object:Gem::Dependency
|
|
299
305
|
name: search_ui
|
|
300
306
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -558,15 +564,12 @@ extra_rdoc_files:
|
|
|
558
564
|
- lib/ollama_chat/tools/concern.rb
|
|
559
565
|
- lib/ollama_chat/tools/copy_to_clipboard.rb
|
|
560
566
|
- lib/ollama_chat/tools/delete_file.rb
|
|
561
|
-
- lib/ollama_chat/tools/directory_structure.rb
|
|
562
567
|
- lib/ollama_chat/tools/eval_ruby.rb
|
|
563
568
|
- lib/ollama_chat/tools/execute_grep.rb
|
|
564
569
|
- lib/ollama_chat/tools/execute_jira_twg.rb
|
|
565
570
|
- lib/ollama_chat/tools/execute_ri.rb
|
|
566
571
|
- lib/ollama_chat/tools/execute_shell.rb
|
|
567
|
-
- lib/ollama_chat/tools/file_context.rb
|
|
568
572
|
- lib/ollama_chat/tools/forget.rb
|
|
569
|
-
- lib/ollama_chat/tools/gem_path_lookup.rb
|
|
570
573
|
- lib/ollama_chat/tools/generate_image.rb
|
|
571
574
|
- lib/ollama_chat/tools/generate_password.rb
|
|
572
575
|
- lib/ollama_chat/tools/get_current_weather.rb
|
|
@@ -578,6 +581,8 @@ extra_rdoc_files:
|
|
|
578
581
|
- lib/ollama_chat/tools/get_rfc.rb
|
|
579
582
|
- lib/ollama_chat/tools/get_time.rb
|
|
580
583
|
- lib/ollama_chat/tools/get_url.rb
|
|
584
|
+
- lib/ollama_chat/tools/list_directory.rb
|
|
585
|
+
- lib/ollama_chat/tools/lookup_gem_path.rb
|
|
581
586
|
- lib/ollama_chat/tools/lookup_group.rb
|
|
582
587
|
- lib/ollama_chat/tools/memorize.rb
|
|
583
588
|
- lib/ollama_chat/tools/move_file.rb
|
|
@@ -709,15 +714,12 @@ files:
|
|
|
709
714
|
- lib/ollama_chat/tools/concern.rb
|
|
710
715
|
- lib/ollama_chat/tools/copy_to_clipboard.rb
|
|
711
716
|
- lib/ollama_chat/tools/delete_file.rb
|
|
712
|
-
- lib/ollama_chat/tools/directory_structure.rb
|
|
713
717
|
- lib/ollama_chat/tools/eval_ruby.rb
|
|
714
718
|
- lib/ollama_chat/tools/execute_grep.rb
|
|
715
719
|
- lib/ollama_chat/tools/execute_jira_twg.rb
|
|
716
720
|
- lib/ollama_chat/tools/execute_ri.rb
|
|
717
721
|
- lib/ollama_chat/tools/execute_shell.rb
|
|
718
|
-
- lib/ollama_chat/tools/file_context.rb
|
|
719
722
|
- lib/ollama_chat/tools/forget.rb
|
|
720
|
-
- lib/ollama_chat/tools/gem_path_lookup.rb
|
|
721
723
|
- lib/ollama_chat/tools/generate_image.rb
|
|
722
724
|
- lib/ollama_chat/tools/generate_password.rb
|
|
723
725
|
- lib/ollama_chat/tools/get_current_weather.rb
|
|
@@ -729,6 +731,8 @@ files:
|
|
|
729
731
|
- lib/ollama_chat/tools/get_rfc.rb
|
|
730
732
|
- lib/ollama_chat/tools/get_time.rb
|
|
731
733
|
- lib/ollama_chat/tools/get_url.rb
|
|
734
|
+
- lib/ollama_chat/tools/list_directory.rb
|
|
735
|
+
- lib/ollama_chat/tools/lookup_gem_path.rb
|
|
732
736
|
- lib/ollama_chat/tools/lookup_group.rb
|
|
733
737
|
- lib/ollama_chat/tools/memorize.rb
|
|
734
738
|
- lib/ollama_chat/tools/move_file.rb
|
|
@@ -840,14 +844,11 @@ files:
|
|
|
840
844
|
- spec/ollama_chat/tools/concern_spec.rb
|
|
841
845
|
- spec/ollama_chat/tools/copy_to_clipboard_spec.rb
|
|
842
846
|
- spec/ollama_chat/tools/delete_file_spec.rb
|
|
843
|
-
- spec/ollama_chat/tools/directory_structure_spec.rb
|
|
844
847
|
- spec/ollama_chat/tools/execute_grep_spec.rb
|
|
845
848
|
- spec/ollama_chat/tools/execute_jira_twg_spec.rb
|
|
846
849
|
- spec/ollama_chat/tools/execute_ri_spec.rb
|
|
847
850
|
- spec/ollama_chat/tools/execute_shell_spec.rb
|
|
848
|
-
- spec/ollama_chat/tools/file_context_spec.rb
|
|
849
851
|
- spec/ollama_chat/tools/forget_spec.rb
|
|
850
|
-
- spec/ollama_chat/tools/gem_path_lookup_spec.rb
|
|
851
852
|
- spec/ollama_chat/tools/generate_image_spec.rb
|
|
852
853
|
- spec/ollama_chat/tools/generate_password_spec.rb
|
|
853
854
|
- spec/ollama_chat/tools/get_current_weather_spec.rb
|
|
@@ -859,6 +860,8 @@ files:
|
|
|
859
860
|
- spec/ollama_chat/tools/get_rfc_spec.rb
|
|
860
861
|
- spec/ollama_chat/tools/get_time_spec.rb
|
|
861
862
|
- spec/ollama_chat/tools/get_url_spec.rb
|
|
863
|
+
- spec/ollama_chat/tools/list_directory_spec.rb
|
|
864
|
+
- spec/ollama_chat/tools/lookup_gem_path_spec.rb
|
|
862
865
|
- spec/ollama_chat/tools/lookup_group_spec.rb
|
|
863
866
|
- spec/ollama_chat/tools/memorize_spec.rb
|
|
864
867
|
- spec/ollama_chat/tools/move_file_spec.rb
|
|
@@ -959,14 +962,11 @@ test_files:
|
|
|
959
962
|
- spec/ollama_chat/tools/concern_spec.rb
|
|
960
963
|
- spec/ollama_chat/tools/copy_to_clipboard_spec.rb
|
|
961
964
|
- spec/ollama_chat/tools/delete_file_spec.rb
|
|
962
|
-
- spec/ollama_chat/tools/directory_structure_spec.rb
|
|
963
965
|
- spec/ollama_chat/tools/execute_grep_spec.rb
|
|
964
966
|
- spec/ollama_chat/tools/execute_jira_twg_spec.rb
|
|
965
967
|
- spec/ollama_chat/tools/execute_ri_spec.rb
|
|
966
968
|
- spec/ollama_chat/tools/execute_shell_spec.rb
|
|
967
|
-
- spec/ollama_chat/tools/file_context_spec.rb
|
|
968
969
|
- spec/ollama_chat/tools/forget_spec.rb
|
|
969
|
-
- spec/ollama_chat/tools/gem_path_lookup_spec.rb
|
|
970
970
|
- spec/ollama_chat/tools/generate_image_spec.rb
|
|
971
971
|
- spec/ollama_chat/tools/generate_password_spec.rb
|
|
972
972
|
- spec/ollama_chat/tools/get_current_weather_spec.rb
|
|
@@ -978,6 +978,8 @@ test_files:
|
|
|
978
978
|
- spec/ollama_chat/tools/get_rfc_spec.rb
|
|
979
979
|
- spec/ollama_chat/tools/get_time_spec.rb
|
|
980
980
|
- spec/ollama_chat/tools/get_url_spec.rb
|
|
981
|
+
- spec/ollama_chat/tools/list_directory_spec.rb
|
|
982
|
+
- spec/ollama_chat/tools/lookup_gem_path_spec.rb
|
|
981
983
|
- spec/ollama_chat/tools/lookup_group_spec.rb
|
|
982
984
|
- spec/ollama_chat/tools/memorize_spec.rb
|
|
983
985
|
- spec/ollama_chat/tools/move_file_spec.rb
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
# A tool for creating file context based on glob patterns.
|
|
2
|
-
#
|
|
3
|
-
# This tool allows the chat client to generate context information about files
|
|
4
|
-
# matching a specified glob pattern. It integrates with the Ollama tool calling
|
|
5
|
-
# system to provide detailed file information to the language model for more
|
|
6
|
-
# accurate responses.
|
|
7
|
-
#
|
|
8
|
-
# The tool searches for files using the provided glob pattern and generates
|
|
9
|
-
# structured context data that includes file contents, sizes, and metadata.
|
|
10
|
-
class OllamaChat::Tools::FileContext
|
|
11
|
-
include OllamaChat::Tools::Concern
|
|
12
|
-
include OllamaChat::Utils::PathValidator
|
|
13
|
-
|
|
14
|
-
# @return [String] the registered name for this tool
|
|
15
|
-
def self.register_name = 'file_context'
|
|
16
|
-
|
|
17
|
-
# Returns the tool definition for the Ollama tool calling system
|
|
18
|
-
#
|
|
19
|
-
# This method constructs and returns the tool definition that describes
|
|
20
|
-
# the file context tool's capabilities to the LLM. It defines the tool's
|
|
21
|
-
# name, description, and parameters for the function calling interface.
|
|
22
|
-
#
|
|
23
|
-
# @return [Ollama::Tool] the tool definition for the Ollama system
|
|
24
|
-
def tool
|
|
25
|
-
Tool.new(
|
|
26
|
-
type: 'function',
|
|
27
|
-
function: Tool::Function.new(
|
|
28
|
-
name:,
|
|
29
|
-
description: <<~EOT,
|
|
30
|
-
Reads all files matching a glob pattern like `lib/**/*.rb` and
|
|
31
|
-
returns their contents plus metadata. Provides file size, line count,
|
|
32
|
-
and tags. Useful for building codebase context to send to language
|
|
33
|
-
models or documenting project structure.
|
|
34
|
-
EOT
|
|
35
|
-
parameters: Tool::Function::Parameters.new(
|
|
36
|
-
type: 'object',
|
|
37
|
-
properties: {
|
|
38
|
-
pattern: Tool::Function::Parameters::Property.new(
|
|
39
|
-
type: 'string',
|
|
40
|
-
description: 'Glob pattern to search for (e.g., "**/*.rb", "lib/**/*.rb")'
|
|
41
|
-
),
|
|
42
|
-
directory: Tool::Function::Parameters::Property.new(
|
|
43
|
-
type: 'string',
|
|
44
|
-
description: 'Directory to search in (defaults to current directory)'
|
|
45
|
-
)
|
|
46
|
-
},
|
|
47
|
-
required: []
|
|
48
|
-
)
|
|
49
|
-
)
|
|
50
|
-
)
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
# The execute method processes a tool call to generate context information
|
|
54
|
-
# for files matching a pattern or specific path.
|
|
55
|
-
#
|
|
56
|
-
# This method handles both glob pattern matching and exact path queries to
|
|
57
|
-
# collect file context using the ContextSpook library. It supports both
|
|
58
|
-
# directory traversal with patterns and direct file access,
|
|
59
|
-
# returning structured context data in the configured format.
|
|
60
|
-
#
|
|
61
|
-
# @param tool_call [Ollama::Tool::Call] the tool call containing function details
|
|
62
|
-
# @param opts [Hash] additional options
|
|
63
|
-
#
|
|
64
|
-
# @return [String] the generated context data in the configured format (JSON by default)
|
|
65
|
-
# @return [String] a JSON string containing error information if the operation fails
|
|
66
|
-
def execute(tool_call, **opts)
|
|
67
|
-
pattern = tool_call.function.arguments.pattern
|
|
68
|
-
format = chat.context_format.selected
|
|
69
|
-
|
|
70
|
-
directory = Pathname.new(tool_call.function.arguments.directory || ?.)
|
|
71
|
-
search_path = directory + pattern
|
|
72
|
-
check_path = -> filename {
|
|
73
|
-
assert_valid_path(filename, tool_config.allowed?, check: :file)
|
|
74
|
-
}
|
|
75
|
-
ContextSpook::generate_context(verbose: true, format:) do |context|
|
|
76
|
-
context do
|
|
77
|
-
Dir.glob(search_path).each do |filename|
|
|
78
|
-
target_path = check_path.(filename)
|
|
79
|
-
File.file?(target_path) or next
|
|
80
|
-
file target_path.to_s
|
|
81
|
-
end
|
|
82
|
-
end
|
|
83
|
-
end.send("to_#{format.downcase}")
|
|
84
|
-
rescue => e
|
|
85
|
-
chat.log(:error, e, data: { tool: name, pattern: })
|
|
86
|
-
{ error: e.class, message: e.message }.to_json
|
|
87
|
-
end
|
|
88
|
-
|
|
89
|
-
self
|
|
90
|
-
end.register
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
describe OllamaChat::Tools::FileContext do
|
|
2
|
-
let :chat do
|
|
3
|
-
OllamaChat::Chat.new(argv: chat_default_config)
|
|
4
|
-
end
|
|
5
|
-
|
|
6
|
-
connect_to_ollama_server
|
|
7
|
-
|
|
8
|
-
it 'can have name' do
|
|
9
|
-
expect(described_class.new(chat).name).to eq 'file_context'
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
it 'can have tool' do
|
|
13
|
-
expect(described_class.new(chat).tool).to be_a Ollama::Tool
|
|
14
|
-
end
|
|
15
|
-
|
|
16
|
-
it 'can be executed successfully with pattern and directory' do
|
|
17
|
-
tool_call = double(
|
|
18
|
-
'ToolCall',
|
|
19
|
-
function: double(
|
|
20
|
-
name: 'file_context',
|
|
21
|
-
arguments: double(
|
|
22
|
-
pattern: '**/*.rb',
|
|
23
|
-
directory: 'spec/assets'
|
|
24
|
-
)
|
|
25
|
-
)
|
|
26
|
-
)
|
|
27
|
-
|
|
28
|
-
# Test with actual files in spec/assets
|
|
29
|
-
result = described_class.new(chat).execute(tool_call)
|
|
30
|
-
expect(result).to be_a(String)
|
|
31
|
-
json = json_object(result)
|
|
32
|
-
content_file = json.files[Pathname.pwd.join('spec/assets/example.rb').to_s].content
|
|
33
|
-
expect(content_file).to include 'Hello World!'
|
|
34
|
-
expect(described_class.summary_template(result:))\
|
|
35
|
-
.to eq "was called."
|
|
36
|
-
end
|
|
37
|
-
|
|
38
|
-
it 'can handle execution errors gracefully' do
|
|
39
|
-
tool_call = double(
|
|
40
|
-
'ToolCall',
|
|
41
|
-
function: double(
|
|
42
|
-
name: 'file_context',
|
|
43
|
-
arguments: double(
|
|
44
|
-
pattern: '**/*.nonexistent',
|
|
45
|
-
directory: 'spec/assets'
|
|
46
|
-
)
|
|
47
|
-
)
|
|
48
|
-
)
|
|
49
|
-
|
|
50
|
-
# Test that it handles non-existent patterns gracefully
|
|
51
|
-
result = described_class.new(chat).execute(tool_call)
|
|
52
|
-
|
|
53
|
-
# Should still return a string (even if empty or minimal)
|
|
54
|
-
expect(result).to be_a(String)
|
|
55
|
-
expect(described_class.summary_template(result:))\
|
|
56
|
-
.to eq "was called."
|
|
57
|
-
end
|
|
58
|
-
|
|
59
|
-
end
|