ollama-ruby 0.0.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.envrc +1 -0
- data/CHANGES.md +78 -0
- data/README.md +62 -23
- data/Rakefile +16 -4
- data/bin/ollama_chat +470 -90
- data/bin/ollama_console +3 -3
- data/bin/ollama_update +17 -0
- data/config/redis.conf +5 -0
- data/docker-compose.yml +11 -0
- data/lib/ollama/client.rb +7 -2
- data/lib/ollama/documents/memory_cache.rb +44 -0
- data/lib/ollama/documents/redis_cache.rb +57 -0
- data/lib/ollama/documents/splitters/character.rb +70 -0
- data/lib/ollama/documents/splitters/semantic.rb +90 -0
- data/lib/ollama/documents.rb +172 -0
- data/lib/ollama/dto.rb +4 -7
- data/lib/ollama/handlers/progress.rb +18 -5
- data/lib/ollama/image.rb +16 -7
- data/lib/ollama/options.rb +4 -0
- data/lib/ollama/utils/chooser.rb +30 -0
- data/lib/ollama/utils/colorize_texts.rb +42 -0
- data/lib/ollama/utils/fetcher.rb +105 -0
- data/lib/ollama/utils/math.rb +48 -0
- data/lib/ollama/utils/tags.rb +7 -0
- data/lib/ollama/utils/width.rb +1 -1
- data/lib/ollama/version.rb +1 -1
- data/lib/ollama.rb +12 -5
- data/ollama-ruby.gemspec +19 -9
- data/spec/assets/embeddings.json +1 -0
- data/spec/ollama/client_spec.rb +2 -2
- data/spec/ollama/commands/chat_spec.rb +2 -2
- data/spec/ollama/commands/copy_spec.rb +2 -2
- data/spec/ollama/commands/create_spec.rb +2 -2
- data/spec/ollama/commands/delete_spec.rb +2 -2
- data/spec/ollama/commands/embed_spec.rb +3 -3
- data/spec/ollama/commands/embeddings_spec.rb +2 -2
- data/spec/ollama/commands/generate_spec.rb +2 -2
- data/spec/ollama/commands/pull_spec.rb +2 -2
- data/spec/ollama/commands/push_spec.rb +2 -2
- data/spec/ollama/commands/show_spec.rb +2 -2
- data/spec/ollama/documents/memory_cache_spec.rb +63 -0
- data/spec/ollama/documents/redis_cache_spec.rb +78 -0
- data/spec/ollama/documents/splitters/character_spec.rb +96 -0
- data/spec/ollama/documents/splitters/semantic_spec.rb +56 -0
- data/spec/ollama/documents_spec.rb +119 -0
- data/spec/ollama/handlers/progress_spec.rb +2 -2
- data/spec/ollama/image_spec.rb +4 -0
- data/spec/ollama/message_spec.rb +3 -4
- data/spec/ollama/options_spec.rb +18 -0
- data/spec/ollama/tool_spec.rb +1 -6
- data/spec/ollama/utils/fetcher_spec.rb +74 -0
- data/spec/ollama/utils/tags_spec.rb +24 -0
- data/spec/spec_helper.rb +8 -0
- data/tmp/.keep +0 -0
- metadata +187 -5
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ollama-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Florian Frank
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-09-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gem_hadar
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.
|
19
|
+
version: 1.17.0
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.
|
26
|
+
version: 1.17.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: all_images
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: webmock
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: excon
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -136,11 +150,138 @@ dependencies:
|
|
136
150
|
- - "~>"
|
137
151
|
- !ruby/object:Gem::Version
|
138
152
|
version: '3.0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: redis
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - "~>"
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '5.0'
|
160
|
+
type: :runtime
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - "~>"
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '5.0'
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: numo-narray
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - "~>"
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0.9'
|
174
|
+
type: :runtime
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - "~>"
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '0.9'
|
181
|
+
- !ruby/object:Gem::Dependency
|
182
|
+
name: more_math
|
183
|
+
requirement: !ruby/object:Gem::Requirement
|
184
|
+
requirements:
|
185
|
+
- - "~>"
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
version: '1.1'
|
188
|
+
type: :runtime
|
189
|
+
prerelease: false
|
190
|
+
version_requirements: !ruby/object:Gem::Requirement
|
191
|
+
requirements:
|
192
|
+
- - "~>"
|
193
|
+
- !ruby/object:Gem::Version
|
194
|
+
version: '1.1'
|
195
|
+
- !ruby/object:Gem::Dependency
|
196
|
+
name: sorted_set
|
197
|
+
requirement: !ruby/object:Gem::Requirement
|
198
|
+
requirements:
|
199
|
+
- - "~>"
|
200
|
+
- !ruby/object:Gem::Version
|
201
|
+
version: '1.0'
|
202
|
+
type: :runtime
|
203
|
+
prerelease: false
|
204
|
+
version_requirements: !ruby/object:Gem::Requirement
|
205
|
+
requirements:
|
206
|
+
- - "~>"
|
207
|
+
- !ruby/object:Gem::Version
|
208
|
+
version: '1.0'
|
209
|
+
- !ruby/object:Gem::Dependency
|
210
|
+
name: mime-types
|
211
|
+
requirement: !ruby/object:Gem::Requirement
|
212
|
+
requirements:
|
213
|
+
- - "~>"
|
214
|
+
- !ruby/object:Gem::Version
|
215
|
+
version: '3.0'
|
216
|
+
type: :runtime
|
217
|
+
prerelease: false
|
218
|
+
version_requirements: !ruby/object:Gem::Requirement
|
219
|
+
requirements:
|
220
|
+
- - "~>"
|
221
|
+
- !ruby/object:Gem::Version
|
222
|
+
version: '3.0'
|
223
|
+
- !ruby/object:Gem::Dependency
|
224
|
+
name: reverse_markdown
|
225
|
+
requirement: !ruby/object:Gem::Requirement
|
226
|
+
requirements:
|
227
|
+
- - "~>"
|
228
|
+
- !ruby/object:Gem::Version
|
229
|
+
version: '2.0'
|
230
|
+
type: :runtime
|
231
|
+
prerelease: false
|
232
|
+
version_requirements: !ruby/object:Gem::Requirement
|
233
|
+
requirements:
|
234
|
+
- - "~>"
|
235
|
+
- !ruby/object:Gem::Version
|
236
|
+
version: '2.0'
|
237
|
+
- !ruby/object:Gem::Dependency
|
238
|
+
name: complex_config
|
239
|
+
requirement: !ruby/object:Gem::Requirement
|
240
|
+
requirements:
|
241
|
+
- - "~>"
|
242
|
+
- !ruby/object:Gem::Version
|
243
|
+
version: '0.20'
|
244
|
+
type: :runtime
|
245
|
+
prerelease: false
|
246
|
+
version_requirements: !ruby/object:Gem::Requirement
|
247
|
+
requirements:
|
248
|
+
- - "~>"
|
249
|
+
- !ruby/object:Gem::Version
|
250
|
+
version: '0.20'
|
251
|
+
- !ruby/object:Gem::Dependency
|
252
|
+
name: search_ui
|
253
|
+
requirement: !ruby/object:Gem::Requirement
|
254
|
+
requirements:
|
255
|
+
- - "~>"
|
256
|
+
- !ruby/object:Gem::Version
|
257
|
+
version: '0.0'
|
258
|
+
type: :runtime
|
259
|
+
prerelease: false
|
260
|
+
version_requirements: !ruby/object:Gem::Requirement
|
261
|
+
requirements:
|
262
|
+
- - "~>"
|
263
|
+
- !ruby/object:Gem::Version
|
264
|
+
version: '0.0'
|
265
|
+
- !ruby/object:Gem::Dependency
|
266
|
+
name: amatch
|
267
|
+
requirement: !ruby/object:Gem::Requirement
|
268
|
+
requirements:
|
269
|
+
- - "~>"
|
270
|
+
- !ruby/object:Gem::Version
|
271
|
+
version: 0.4.1
|
272
|
+
type: :runtime
|
273
|
+
prerelease: false
|
274
|
+
version_requirements: !ruby/object:Gem::Requirement
|
275
|
+
requirements:
|
276
|
+
- - "~>"
|
277
|
+
- !ruby/object:Gem::Version
|
278
|
+
version: 0.4.1
|
139
279
|
description: Library that allows interacting with the Ollama API
|
140
280
|
email: flori@ping.de
|
141
281
|
executables:
|
142
282
|
- ollama_console
|
143
283
|
- ollama_chat
|
284
|
+
- ollama_update
|
144
285
|
extensions: []
|
145
286
|
extra_rdoc_files:
|
146
287
|
- README.md
|
@@ -160,6 +301,11 @@ extra_rdoc_files:
|
|
160
301
|
- lib/ollama/commands/push.rb
|
161
302
|
- lib/ollama/commands/show.rb
|
162
303
|
- lib/ollama/commands/tags.rb
|
304
|
+
- lib/ollama/documents.rb
|
305
|
+
- lib/ollama/documents/memory_cache.rb
|
306
|
+
- lib/ollama/documents/redis_cache.rb
|
307
|
+
- lib/ollama/documents/splitters/character.rb
|
308
|
+
- lib/ollama/documents/splitters/semantic.rb
|
163
309
|
- lib/ollama/dto.rb
|
164
310
|
- lib/ollama/errors.rb
|
165
311
|
- lib/ollama/handlers.rb
|
@@ -182,15 +328,25 @@ extra_rdoc_files:
|
|
182
328
|
- lib/ollama/tool/function/parameters.rb
|
183
329
|
- lib/ollama/tool/function/parameters/property.rb
|
184
330
|
- lib/ollama/utils/ansi_markdown.rb
|
331
|
+
- lib/ollama/utils/chooser.rb
|
332
|
+
- lib/ollama/utils/colorize_texts.rb
|
333
|
+
- lib/ollama/utils/fetcher.rb
|
334
|
+
- lib/ollama/utils/math.rb
|
335
|
+
- lib/ollama/utils/tags.rb
|
185
336
|
- lib/ollama/utils/width.rb
|
186
337
|
- lib/ollama/version.rb
|
187
338
|
files:
|
339
|
+
- ".envrc"
|
340
|
+
- CHANGES.md
|
188
341
|
- Gemfile
|
189
342
|
- LICENSE
|
190
343
|
- README.md
|
191
344
|
- Rakefile
|
192
345
|
- bin/ollama_chat
|
193
346
|
- bin/ollama_console
|
347
|
+
- bin/ollama_update
|
348
|
+
- config/redis.conf
|
349
|
+
- docker-compose.yml
|
194
350
|
- lib/ollama.rb
|
195
351
|
- lib/ollama/client.rb
|
196
352
|
- lib/ollama/client/command.rb
|
@@ -207,6 +363,11 @@ files:
|
|
207
363
|
- lib/ollama/commands/push.rb
|
208
364
|
- lib/ollama/commands/show.rb
|
209
365
|
- lib/ollama/commands/tags.rb
|
366
|
+
- lib/ollama/documents.rb
|
367
|
+
- lib/ollama/documents/memory_cache.rb
|
368
|
+
- lib/ollama/documents/redis_cache.rb
|
369
|
+
- lib/ollama/documents/splitters/character.rb
|
370
|
+
- lib/ollama/documents/splitters/semantic.rb
|
210
371
|
- lib/ollama/dto.rb
|
211
372
|
- lib/ollama/errors.rb
|
212
373
|
- lib/ollama/handlers.rb
|
@@ -229,9 +390,15 @@ files:
|
|
229
390
|
- lib/ollama/tool/function/parameters.rb
|
230
391
|
- lib/ollama/tool/function/parameters/property.rb
|
231
392
|
- lib/ollama/utils/ansi_markdown.rb
|
393
|
+
- lib/ollama/utils/chooser.rb
|
394
|
+
- lib/ollama/utils/colorize_texts.rb
|
395
|
+
- lib/ollama/utils/fetcher.rb
|
396
|
+
- lib/ollama/utils/math.rb
|
397
|
+
- lib/ollama/utils/tags.rb
|
232
398
|
- lib/ollama/utils/width.rb
|
233
399
|
- lib/ollama/version.rb
|
234
400
|
- ollama-ruby.gemspec
|
401
|
+
- spec/assets/embeddings.json
|
235
402
|
- spec/assets/kitten.jpg
|
236
403
|
- spec/ollama/client/doc_spec.rb
|
237
404
|
- spec/ollama/client_spec.rb
|
@@ -247,6 +414,11 @@ files:
|
|
247
414
|
- spec/ollama/commands/push_spec.rb
|
248
415
|
- spec/ollama/commands/show_spec.rb
|
249
416
|
- spec/ollama/commands/tags_spec.rb
|
417
|
+
- spec/ollama/documents/memory_cache_spec.rb
|
418
|
+
- spec/ollama/documents/redis_cache_spec.rb
|
419
|
+
- spec/ollama/documents/splitters/character_spec.rb
|
420
|
+
- spec/ollama/documents/splitters/semantic_spec.rb
|
421
|
+
- spec/ollama/documents_spec.rb
|
250
422
|
- spec/ollama/handlers/collector_spec.rb
|
251
423
|
- spec/ollama/handlers/dump_json_spec.rb
|
252
424
|
- spec/ollama/handlers/dump_yaml_spec.rb
|
@@ -261,7 +433,10 @@ files:
|
|
261
433
|
- spec/ollama/options_spec.rb
|
262
434
|
- spec/ollama/tool_spec.rb
|
263
435
|
- spec/ollama/utils/ansi_markdown_spec.rb
|
436
|
+
- spec/ollama/utils/fetcher_spec.rb
|
437
|
+
- spec/ollama/utils/tags_spec.rb
|
264
438
|
- spec/spec_helper.rb
|
439
|
+
- tmp/.keep
|
265
440
|
homepage: https://github.com/flori/ollama-ruby
|
266
441
|
licenses:
|
267
442
|
- MIT
|
@@ -285,7 +460,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
285
460
|
- !ruby/object:Gem::Version
|
286
461
|
version: '0'
|
287
462
|
requirements: []
|
288
|
-
rubygems_version: 3.5.
|
463
|
+
rubygems_version: 3.5.11
|
289
464
|
signing_key:
|
290
465
|
specification_version: 4
|
291
466
|
summary: Interacting with the Ollama API
|
@@ -304,6 +479,11 @@ test_files:
|
|
304
479
|
- spec/ollama/commands/push_spec.rb
|
305
480
|
- spec/ollama/commands/show_spec.rb
|
306
481
|
- spec/ollama/commands/tags_spec.rb
|
482
|
+
- spec/ollama/documents/memory_cache_spec.rb
|
483
|
+
- spec/ollama/documents/redis_cache_spec.rb
|
484
|
+
- spec/ollama/documents/splitters/character_spec.rb
|
485
|
+
- spec/ollama/documents/splitters/semantic_spec.rb
|
486
|
+
- spec/ollama/documents_spec.rb
|
307
487
|
- spec/ollama/handlers/collector_spec.rb
|
308
488
|
- spec/ollama/handlers/dump_json_spec.rb
|
309
489
|
- spec/ollama/handlers/dump_yaml_spec.rb
|
@@ -318,4 +498,6 @@ test_files:
|
|
318
498
|
- spec/ollama/options_spec.rb
|
319
499
|
- spec/ollama/tool_spec.rb
|
320
500
|
- spec/ollama/utils/ansi_markdown_spec.rb
|
501
|
+
- spec/ollama/utils/fetcher_spec.rb
|
502
|
+
- spec/ollama/utils/tags_spec.rb
|
321
503
|
- spec/spec_helper.rb
|