ollama-ruby 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 29863f68627a05541de5eab810850b0509db94c1d91b2e9a5a9be9bd387e8aea
4
- data.tar.gz: 07f3558153a0a724c08e27a86482e0951070348bf25641d2a9feed113e3e7046
3
+ metadata.gz: 3efc65090c37d60db61417738d3780ce7b86af805c86e1828421b86e83c11c13
4
+ data.tar.gz: 3d18b6d92320c889bcef7b566a818867cbd55ff29a519738e3dd0e524d766aa6
5
5
  SHA512:
6
- metadata.gz: 11c405277b59c6acc75c24220942dd883bb7aec99d97d19bc9baf8d61aa4e5dc59af905631dc37641b91babdd9e5ab7305720a8720451db7b4bb6ca067833913
7
- data.tar.gz: 129f49e2d4b5cb65b7999f666f33798511b8a34b1be84bbc7bd4433872cd7c323812cd4dd3e8d2ae325cb013cfb6403db8181c8cbe641139469e5ea9821cc71d
6
+ metadata.gz: 5086fa3669dd9a19d917a528dacf8073cf250400ef91210086b96a99e62468f3b232d55a1a04240537ab79f58cb9015c5f591b46b61e60424e068107133a944a
7
+ data.tar.gz: 93837384222c5221e8b70db3034fe8ac4dbb86c379bd583a66c29b500376e6fc6bacba2419d673cf84f1b81a2b13b2cbd0ac8d32a2280e09e1c46acc48de5f8b
data/CHANGES.md CHANGED
@@ -1,5 +1,108 @@
1
1
  # Changes
2
2
 
3
+ ## 2024-09-26 v0.5.0
4
+
5
+ ### New Features
6
+
7
+ * Add stdin substitution and variable expansion to `ollama_cli`:
8
+ + Added support for `%{stdin}` in prompts, substituting with actual input
9
+ + Added `-P` option to set prompt variables from command line arguments
10
+ + Added handling of multiple placeholders in prompts
11
+ * Add proxy support to Ollama chat client:
12
+ + Add `tins/xt/hash_union` gem to dependencies
13
+ + Update `OllamaChatConfig` with new `proxy` option
14
+ + Modify `http_options` method to include proxy and SSL verify peer options
15
+ based on config settings
16
+ * Refactor source embedding logic:
17
+ + Simplified explicit case statement.
18
+ + Added `inputs or return` to ensure early exit when splitting cannot be
19
+ done
20
+ * Update Ollama chat script to embed, import or summarize sources:
21
+ + Added `require 'tins/xt/full'`
22
+ + Updated prompts in `OllamaChatConfig` to include embed prompt and
23
+ summarize prompt with word count option
24
+ + Modified `import_document` method to use `embed_source` instead of
25
+ importing document as a whole
26
+ + Added `embed_source` method to parse source content and add it to the
27
+ conversation via embeddings
28
+ + Updated `summarize` method to take an optional word count parameter
29
+ + Added `toggle_markdown` method to toggle markdown output on/off
30
+ + Added `show_embedding` method to display embedding status
31
+ + Updated `choose_collection` method to include new collection option
32
+ + Added `set_embedding` method to set embedding model and paused embedding
33
+ + Updated `info` method to display current model, collection stats, and
34
+ embedding status
35
+
36
+ ### Improvements
37
+
38
+ * Improve conversation listing command:
39
+ + Allow `list_conversation` method to take an optional argument for the
40
+ number of messages to display
41
+ + Added support for displaying a specific number of messages with `/list
42
+ [n]`
43
+ * Update chat commands' quit functionality:
44
+ + Moved `/quit` command to exit the program
45
+ * Refactor OllamaChatConfig web prompt:
46
+ + Add `web` prompt to `OllamaChatConfig` class
47
+ + Replace hardcoded content with variable `content`
48
+ + Use `query` and `results` variables instead of interpolating strings
49
+ * Add Redis cache expiration support:
50
+ + Added `ex` option to `initialize` method in
51
+ `lib/ollama/documents/cache/redis_cache.rb`
52
+ + Updated `[]=` method in `lib/ollama/documents/cache/redis_cache.rb` to
53
+ use Redis expiration
54
+ + Added `ttl` method in `lib/ollama/documents/cache/redis_cache.rb` to get
55
+ key TTL
56
+ * Update Redis and Redis-backed memory cache to use `object_class` parameter:
57
+ + Added `object_class` parameter to `RedisBackedMemoryCache` and
58
+ `RedisCache` constructors
59
+ + Updated tests in `redis_backed_memory_cache_spec.rb` and
60
+ `redis_cache_spec.rb` to reflect new behavior
61
+
62
+ ### Bug Fixes
63
+
64
+ * Update semantic splitter to use `include_separator` option from opts:
65
+ + Added flexibility by allowing `include_separator` option to be passed in
66
+ through opts
67
+ + Updated `include_separator` parameter to use
68
+ `opts.fetch(:include_separator, true)` instead of hardcoding value to
69
+ True.
70
+
71
+ ### Refactoring
72
+
73
+ * Refactor `file_argument.rb` for better readability:
74
+ + Update conditionals in Ollama::Utils::FileArgument module
75
+ + Simplify logic with improved variable usage
76
+ + Remove unnecessary elsif statement
77
+ + Use consistent indentation and spacing throughout the code
78
+ * Refactor Redis-backed memory cache:
79
+ + Removed `pre` and `unpre` methods from `Ollama::Documents` use mixin
80
+ instead.
81
+
82
+ ### Documentation
83
+
84
+ * Update README.md to reflect changes in `ollama_chat` functionality.
85
+ + Modified commands:
86
+ - `/import source` to import the source's content
87
+ - `/embed source` to embed the source's content
88
+ - `/summarize [n] source` to summarize the source's content in n words
89
+ - `/embedding` to toggle embedding paused or not
90
+ - `/embed source` to embed the source's content
91
+
92
+ ### Dependencies and Date Updates
93
+
94
+ * Update dependencies and date in gemspec:
95
+ + Added `logger` (~> **1.0**) and `json` (~> **2.0**) as runtime
96
+ dependencies to Rakefile and ollama-ruby.gemspec.
97
+ + Updated date in ollama-ruby.gemspec from "2024-09-21" to "2024-09-22".
98
+ + Added `require 'logger'` to lib/ollama.rb.
99
+
100
+ ### Other Changes
101
+
102
+ * Add SSL no verify option to OllamaChatConfig and Utils::Fetcher:
103
+ + Added `ssl_no_verify` option to OllamaChatConfig
104
+ + Updated Utils::Fetcher to take an
105
+
3
106
  ## 2024-09-21 v0.4.0
4
107
 
5
108
  ### Change Log for **1.2.3**
data/README.md CHANGED
@@ -154,21 +154,24 @@ subject - the young, blue-eyed cat.
154
154
  The following commands can be given inside the chat, if prefixed by a `/`:
155
155
 
156
156
  ```
157
- /paste to paste content
158
- /markdown toggle markdown output
159
- /list list the messages of the conversation
160
- /clear clear the conversation messages
161
- /clobber clear conversation messages and collection
162
- /pop [n] pop the last n exchanges, defaults to 1
163
- /model change the model
164
- /regenerate the last answer message
165
- /collection clear [tag]|stats|change|new clear or show stats of current collection
166
- /summarize source summarize the URL/file source's content
167
- /web [n] query query web search & return n or 1 results
168
- /save filename store conversation messages
169
- /load filename load conversation messages
170
- /quit to quit
171
- /help to view this help
157
+ /paste to paste content
158
+ /markdown toggle markdown output
159
+ /list [n] list the last n / all conversation exchanges
160
+ /clear clear the whole conversation
161
+ /clobber clear the conversation and collection
162
+ /pop [n] pop the last n exchanges, defaults to 1
163
+ /model change the model
164
+ /regenerate the last answer message
165
+ /collection clear [tag]|change clear or show stats of current collection
166
+ /import source import the source's content
167
+ /summarize [n] source summarize the source's content in n words
168
+ /embedding toggle embedding paused or not
169
+ /embed source embed the source's content
170
+ /web [n] query query web search & return n or 1 results
171
+ /save filename store conversation messages
172
+ /load filename load conversation messages
173
+ /quit to quit
174
+ /help to view this help
172
175
  ```
173
176
 
174
177
  ### ollama\_console
@@ -462,7 +465,7 @@ The homepage of this library is located at
462
465
 
463
466
  ## Author
464
467
 
465
- <b>Ollama</b> was written by Florian Frank [Florian Frank](mailto:flori@ping.de)
468
+ <b>Ollama Ruby</b> was written by Florian Frank [Florian Frank](mailto:flori@ping.de)
466
469
 
467
470
  ## License
468
471
 
data/Rakefile CHANGED
@@ -39,6 +39,8 @@ GemHadar do
39
39
  dependency 'search_ui', '~> 0.0'
40
40
  dependency 'amatch', '~> 0.4.1'
41
41
  dependency 'pdf-reader', '~> 2.0'
42
+ dependency 'logger', '~> 1.0'
43
+ dependency 'json', '~> 2.0'
42
44
  development_dependency 'all_images', '~> 0.4'
43
45
  development_dependency 'rspec', '~> 3.2'
44
46
  development_dependency 'webmock'