ollama-ruby 0.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (79) hide show
  1. checksums.yaml +7 -0
  2. data/Gemfile +5 -0
  3. data/LICENSE +19 -0
  4. data/README.md +430 -0
  5. data/Rakefile +35 -0
  6. data/bin/ollama_chat +258 -0
  7. data/bin/ollama_console +20 -0
  8. data/lib/ollama/client/command.rb +25 -0
  9. data/lib/ollama/client/doc.rb +26 -0
  10. data/lib/ollama/client.rb +137 -0
  11. data/lib/ollama/commands/chat.rb +21 -0
  12. data/lib/ollama/commands/copy.rb +19 -0
  13. data/lib/ollama/commands/create.rb +20 -0
  14. data/lib/ollama/commands/delete.rb +19 -0
  15. data/lib/ollama/commands/embed.rb +21 -0
  16. data/lib/ollama/commands/embeddings.rb +20 -0
  17. data/lib/ollama/commands/generate.rb +21 -0
  18. data/lib/ollama/commands/ps.rb +19 -0
  19. data/lib/ollama/commands/pull.rb +19 -0
  20. data/lib/ollama/commands/push.rb +19 -0
  21. data/lib/ollama/commands/show.rb +20 -0
  22. data/lib/ollama/commands/tags.rb +19 -0
  23. data/lib/ollama/dto.rb +42 -0
  24. data/lib/ollama/errors.rb +15 -0
  25. data/lib/ollama/handlers/collector.rb +17 -0
  26. data/lib/ollama/handlers/concern.rb +31 -0
  27. data/lib/ollama/handlers/dump_json.rb +8 -0
  28. data/lib/ollama/handlers/dump_yaml.rb +8 -0
  29. data/lib/ollama/handlers/markdown.rb +22 -0
  30. data/lib/ollama/handlers/nop.rb +7 -0
  31. data/lib/ollama/handlers/print.rb +16 -0
  32. data/lib/ollama/handlers/progress.rb +36 -0
  33. data/lib/ollama/handlers/say.rb +19 -0
  34. data/lib/ollama/handlers/single.rb +17 -0
  35. data/lib/ollama/handlers.rb +13 -0
  36. data/lib/ollama/image.rb +31 -0
  37. data/lib/ollama/message.rb +9 -0
  38. data/lib/ollama/options.rb +68 -0
  39. data/lib/ollama/response.rb +5 -0
  40. data/lib/ollama/tool/function/parameters/property.rb +9 -0
  41. data/lib/ollama/tool/function/parameters.rb +10 -0
  42. data/lib/ollama/tool/function.rb +11 -0
  43. data/lib/ollama/tool.rb +9 -0
  44. data/lib/ollama/utils/ansi_markdown.rb +217 -0
  45. data/lib/ollama/utils/width.rb +22 -0
  46. data/lib/ollama/version.rb +8 -0
  47. data/lib/ollama.rb +43 -0
  48. data/ollama-ruby.gemspec +36 -0
  49. data/spec/assets/kitten.jpg +0 -0
  50. data/spec/ollama/client/doc_spec.rb +11 -0
  51. data/spec/ollama/client_spec.rb +144 -0
  52. data/spec/ollama/commands/chat_spec.rb +52 -0
  53. data/spec/ollama/commands/copy_spec.rb +28 -0
  54. data/spec/ollama/commands/create_spec.rb +37 -0
  55. data/spec/ollama/commands/delete_spec.rb +28 -0
  56. data/spec/ollama/commands/embed_spec.rb +52 -0
  57. data/spec/ollama/commands/embeddings_spec.rb +38 -0
  58. data/spec/ollama/commands/generate_spec.rb +29 -0
  59. data/spec/ollama/commands/ps_spec.rb +25 -0
  60. data/spec/ollama/commands/pull_spec.rb +28 -0
  61. data/spec/ollama/commands/push_spec.rb +28 -0
  62. data/spec/ollama/commands/show_spec.rb +28 -0
  63. data/spec/ollama/commands/tags_spec.rb +22 -0
  64. data/spec/ollama/handlers/collector_spec.rb +15 -0
  65. data/spec/ollama/handlers/dump_json_spec.rb +16 -0
  66. data/spec/ollama/handlers/dump_yaml_spec.rb +18 -0
  67. data/spec/ollama/handlers/markdown_spec.rb +46 -0
  68. data/spec/ollama/handlers/nop_spec.rb +15 -0
  69. data/spec/ollama/handlers/print_spec.rb +30 -0
  70. data/spec/ollama/handlers/progress_spec.rb +22 -0
  71. data/spec/ollama/handlers/say_spec.rb +30 -0
  72. data/spec/ollama/handlers/single_spec.rb +24 -0
  73. data/spec/ollama/image_spec.rb +23 -0
  74. data/spec/ollama/message_spec.rb +37 -0
  75. data/spec/ollama/options_spec.rb +25 -0
  76. data/spec/ollama/tool_spec.rb +78 -0
  77. data/spec/ollama/utils/ansi_markdown_spec.rb +15 -0
  78. data/spec/spec_helper.rb +16 -0
  79. metadata +321 -0
metadata ADDED
@@ -0,0 +1,321 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ollama-ruby
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.0
5
+ platform: ruby
6
+ authors:
7
+ - Florian Frank
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2024-08-12 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: gem_hadar
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: 1.16.1
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: 1.16.1
27
+ - !ruby/object:Gem::Dependency
28
+ name: all_images
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '0.4'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '0.4'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rspec
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '3.2'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '3.2'
55
+ - !ruby/object:Gem::Dependency
56
+ name: utils
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: excon
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '0.111'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '0.111'
83
+ - !ruby/object:Gem::Dependency
84
+ name: infobar
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '0.7'
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '0.7'
97
+ - !ruby/object:Gem::Dependency
98
+ name: term-ansicolor
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '1.11'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '1.11'
111
+ - !ruby/object:Gem::Dependency
112
+ name: kramdown-parser-gfm
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '1.1'
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '1.1'
125
+ - !ruby/object:Gem::Dependency
126
+ name: terminal-table
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '3.0'
132
+ type: :runtime
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '3.0'
139
+ description: Library that allows interacting with the Ollama API
140
+ email: flori@ping.de
141
+ executables:
142
+ - ollama_console
143
+ - ollama_chat
144
+ extensions: []
145
+ extra_rdoc_files:
146
+ - README.md
147
+ - lib/ollama.rb
148
+ - lib/ollama/client.rb
149
+ - lib/ollama/client/command.rb
150
+ - lib/ollama/client/doc.rb
151
+ - lib/ollama/commands/chat.rb
152
+ - lib/ollama/commands/copy.rb
153
+ - lib/ollama/commands/create.rb
154
+ - lib/ollama/commands/delete.rb
155
+ - lib/ollama/commands/embed.rb
156
+ - lib/ollama/commands/embeddings.rb
157
+ - lib/ollama/commands/generate.rb
158
+ - lib/ollama/commands/ps.rb
159
+ - lib/ollama/commands/pull.rb
160
+ - lib/ollama/commands/push.rb
161
+ - lib/ollama/commands/show.rb
162
+ - lib/ollama/commands/tags.rb
163
+ - lib/ollama/dto.rb
164
+ - lib/ollama/errors.rb
165
+ - lib/ollama/handlers.rb
166
+ - lib/ollama/handlers/collector.rb
167
+ - lib/ollama/handlers/concern.rb
168
+ - lib/ollama/handlers/dump_json.rb
169
+ - lib/ollama/handlers/dump_yaml.rb
170
+ - lib/ollama/handlers/markdown.rb
171
+ - lib/ollama/handlers/nop.rb
172
+ - lib/ollama/handlers/print.rb
173
+ - lib/ollama/handlers/progress.rb
174
+ - lib/ollama/handlers/say.rb
175
+ - lib/ollama/handlers/single.rb
176
+ - lib/ollama/image.rb
177
+ - lib/ollama/message.rb
178
+ - lib/ollama/options.rb
179
+ - lib/ollama/response.rb
180
+ - lib/ollama/tool.rb
181
+ - lib/ollama/tool/function.rb
182
+ - lib/ollama/tool/function/parameters.rb
183
+ - lib/ollama/tool/function/parameters/property.rb
184
+ - lib/ollama/utils/ansi_markdown.rb
185
+ - lib/ollama/utils/width.rb
186
+ - lib/ollama/version.rb
187
+ files:
188
+ - Gemfile
189
+ - LICENSE
190
+ - README.md
191
+ - Rakefile
192
+ - bin/ollama_chat
193
+ - bin/ollama_console
194
+ - lib/ollama.rb
195
+ - lib/ollama/client.rb
196
+ - lib/ollama/client/command.rb
197
+ - lib/ollama/client/doc.rb
198
+ - lib/ollama/commands/chat.rb
199
+ - lib/ollama/commands/copy.rb
200
+ - lib/ollama/commands/create.rb
201
+ - lib/ollama/commands/delete.rb
202
+ - lib/ollama/commands/embed.rb
203
+ - lib/ollama/commands/embeddings.rb
204
+ - lib/ollama/commands/generate.rb
205
+ - lib/ollama/commands/ps.rb
206
+ - lib/ollama/commands/pull.rb
207
+ - lib/ollama/commands/push.rb
208
+ - lib/ollama/commands/show.rb
209
+ - lib/ollama/commands/tags.rb
210
+ - lib/ollama/dto.rb
211
+ - lib/ollama/errors.rb
212
+ - lib/ollama/handlers.rb
213
+ - lib/ollama/handlers/collector.rb
214
+ - lib/ollama/handlers/concern.rb
215
+ - lib/ollama/handlers/dump_json.rb
216
+ - lib/ollama/handlers/dump_yaml.rb
217
+ - lib/ollama/handlers/markdown.rb
218
+ - lib/ollama/handlers/nop.rb
219
+ - lib/ollama/handlers/print.rb
220
+ - lib/ollama/handlers/progress.rb
221
+ - lib/ollama/handlers/say.rb
222
+ - lib/ollama/handlers/single.rb
223
+ - lib/ollama/image.rb
224
+ - lib/ollama/message.rb
225
+ - lib/ollama/options.rb
226
+ - lib/ollama/response.rb
227
+ - lib/ollama/tool.rb
228
+ - lib/ollama/tool/function.rb
229
+ - lib/ollama/tool/function/parameters.rb
230
+ - lib/ollama/tool/function/parameters/property.rb
231
+ - lib/ollama/utils/ansi_markdown.rb
232
+ - lib/ollama/utils/width.rb
233
+ - lib/ollama/version.rb
234
+ - ollama-ruby.gemspec
235
+ - spec/assets/kitten.jpg
236
+ - spec/ollama/client/doc_spec.rb
237
+ - spec/ollama/client_spec.rb
238
+ - spec/ollama/commands/chat_spec.rb
239
+ - spec/ollama/commands/copy_spec.rb
240
+ - spec/ollama/commands/create_spec.rb
241
+ - spec/ollama/commands/delete_spec.rb
242
+ - spec/ollama/commands/embed_spec.rb
243
+ - spec/ollama/commands/embeddings_spec.rb
244
+ - spec/ollama/commands/generate_spec.rb
245
+ - spec/ollama/commands/ps_spec.rb
246
+ - spec/ollama/commands/pull_spec.rb
247
+ - spec/ollama/commands/push_spec.rb
248
+ - spec/ollama/commands/show_spec.rb
249
+ - spec/ollama/commands/tags_spec.rb
250
+ - spec/ollama/handlers/collector_spec.rb
251
+ - spec/ollama/handlers/dump_json_spec.rb
252
+ - spec/ollama/handlers/dump_yaml_spec.rb
253
+ - spec/ollama/handlers/markdown_spec.rb
254
+ - spec/ollama/handlers/nop_spec.rb
255
+ - spec/ollama/handlers/print_spec.rb
256
+ - spec/ollama/handlers/progress_spec.rb
257
+ - spec/ollama/handlers/say_spec.rb
258
+ - spec/ollama/handlers/single_spec.rb
259
+ - spec/ollama/image_spec.rb
260
+ - spec/ollama/message_spec.rb
261
+ - spec/ollama/options_spec.rb
262
+ - spec/ollama/tool_spec.rb
263
+ - spec/ollama/utils/ansi_markdown_spec.rb
264
+ - spec/spec_helper.rb
265
+ homepage: https://github.com/flori/ollama-ruby
266
+ licenses:
267
+ - MIT
268
+ metadata: {}
269
+ post_install_message:
270
+ rdoc_options:
271
+ - "--title"
272
+ - Ollama-ruby - Interacting with the Ollama API
273
+ - "--main"
274
+ - README.md
275
+ require_paths:
276
+ - lib
277
+ required_ruby_version: !ruby/object:Gem::Requirement
278
+ requirements:
279
+ - - "~>"
280
+ - !ruby/object:Gem::Version
281
+ version: '3.1'
282
+ required_rubygems_version: !ruby/object:Gem::Requirement
283
+ requirements:
284
+ - - ">="
285
+ - !ruby/object:Gem::Version
286
+ version: '0'
287
+ requirements: []
288
+ rubygems_version: 3.5.16
289
+ signing_key:
290
+ specification_version: 4
291
+ summary: Interacting with the Ollama API
292
+ test_files:
293
+ - spec/ollama/client/doc_spec.rb
294
+ - spec/ollama/client_spec.rb
295
+ - spec/ollama/commands/chat_spec.rb
296
+ - spec/ollama/commands/copy_spec.rb
297
+ - spec/ollama/commands/create_spec.rb
298
+ - spec/ollama/commands/delete_spec.rb
299
+ - spec/ollama/commands/embed_spec.rb
300
+ - spec/ollama/commands/embeddings_spec.rb
301
+ - spec/ollama/commands/generate_spec.rb
302
+ - spec/ollama/commands/ps_spec.rb
303
+ - spec/ollama/commands/pull_spec.rb
304
+ - spec/ollama/commands/push_spec.rb
305
+ - spec/ollama/commands/show_spec.rb
306
+ - spec/ollama/commands/tags_spec.rb
307
+ - spec/ollama/handlers/collector_spec.rb
308
+ - spec/ollama/handlers/dump_json_spec.rb
309
+ - spec/ollama/handlers/dump_yaml_spec.rb
310
+ - spec/ollama/handlers/markdown_spec.rb
311
+ - spec/ollama/handlers/nop_spec.rb
312
+ - spec/ollama/handlers/print_spec.rb
313
+ - spec/ollama/handlers/progress_spec.rb
314
+ - spec/ollama/handlers/say_spec.rb
315
+ - spec/ollama/handlers/single_spec.rb
316
+ - spec/ollama/image_spec.rb
317
+ - spec/ollama/message_spec.rb
318
+ - spec/ollama/options_spec.rb
319
+ - spec/ollama/tool_spec.rb
320
+ - spec/ollama/utils/ansi_markdown_spec.rb
321
+ - spec/spec_helper.rb