ollama-ruby 0.14.0 → 0.15.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e85337f5e36db83bab1c64782948ca58193d888ca4cac057b9df4142977b3d1d
4
- data.tar.gz: c0c5dec70d721ff530614382f22dfb400903f2a5086af1e63dd539578bd61194
3
+ metadata.gz: 44b2b4e2384b4f05a8457cf9dbcd7d9c654ceff267080245d5d7a1915554743b
4
+ data.tar.gz: b03c72fed7968802c87681464b6bcd365f05906a351f7cdcde61dc60661f15cd
5
5
  SHA512:
6
- metadata.gz: d68085b5c0fa5a2069260ca7da9af716bebdfe953a0318f95f93a9c718e7bc6d8f3f659117f1f3d2703c6212758caa55a1207040ec921ce97bfc6cb4da560384
7
- data.tar.gz: 4255495ef2ddb5e221981f3d771e2e2513c5811f1d1179b1775c2fc08bba9dc80594e5366c9f58eaf6eeacfc0dc1cca99fbbece35f14b1145d19afbdbe6f3ee8
6
+ metadata.gz: 7ab16b2e5b23dbe1b94f240124c70a9073184af44d7cbdc31c6fedab92960f30b0a605c4e499eb7ac0a93f7cdf2b72ea62a380d4ea29e2d5d79d2667eabfc1c0
7
+ data.tar.gz: 20e6c0e290ad0c076fede5bde2d0959da37697e17d0ed90fb6e136bc8f6ab3c4084202086299a38b27ca62084dafb6979394b9bb2d52c47f553ca2eeaa32959f
data/CHANGES.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # Changes
2
2
 
3
+ ## 2025-02-12 v0.15.0
4
+
5
+ * Added "version" command to display version of the ollama server:
6
+ + Updated `Commands` list in README.md to include new `version` command
7
+ + Added new section for `Version` information in README.md
8
+ + Added example usage of `jj version` command
9
+ * Added basic spec for Ollama::Commands::Version class:
10
+ + Defined a describe block for Ollama::Commands::Version with one let and three it blocks:
11
+ - It can be instantiated
12
+ - It cannot be converted to JSON
13
+ - It can perform, including setting the client and expecting a request to be made
14
+ * Added version command for API endpoint:
15
+ + Added `ollama/commands/version` class
16
+ + Updated `ollama/client.rb` to include `version` command
17
+ + Updated doc links in `ollama/client/doc.rb`
18
+ + Added support for `/api/version` API endpoint
19
+
20
+ ## 2025-01-29 v0.14.1
21
+
22
+ * Removed dependency on `Documentrix`:
23
+ * Dependency removed from Rakefile
24
+ * Dependency removed from `ollama-ruby.gemspec`
25
+
3
26
  ## 2025-01-29 v0.14.0
4
27
 
5
28
  * Removed `term-ansicolor`, `redis`, `mime-types`, `reverse_markdown`,
data/README.md CHANGED
@@ -50,7 +50,7 @@ response and displays it on the screen using the Markdown handler:
50
50
 
51
51
  ```bash
52
52
  ollama_console
53
- Commands: chat,copy,create,delete,embeddings,generate,help,ps,pull,push,show,tags
53
+ Commands: chat,copy,create,delete,embeddings,generate,help,ps,pull,push,show,tags,version
54
54
  >> generate(model: 'llama3.1', stream: true, prompt: 'tell story w/ emoji and markdown', &Markdown)
55
55
  ```
56
56
 
@@ -219,6 +219,14 @@ embeddings(model: 'llama3.1', prompt: 'The sky is blue because of rayleigh scatt
219
219
  jj ps
220
220
  ```
221
221
 
222
+ ### Version
223
+
224
+ `default_handler` is **Single**, streaming is not possible.
225
+
226
+ ```ruby
227
+ jj version
228
+ ```
229
+
222
230
  ## Auxiliary objects
223
231
 
224
232
  The following objects are provided to interact with the ollama server. You can
@@ -392,6 +400,9 @@ gem install ollama-chat
392
400
  Once installed, you can run `ollama_chat` from your terminal or command prompt.
393
401
  This will launch a chat interface where you can interact with an LLM.
394
402
 
403
+ See its [github repository](https://github.com/flori/ollama_chat) for more
404
+ information.
405
+
395
406
  ## Download
396
407
 
397
408
  The homepage of this library is located at
data/Rakefile CHANGED
@@ -30,7 +30,6 @@ GemHadar do
30
30
  dependency 'term-ansicolor', '~> 1.11'
31
31
  dependency 'kramdown-ansi', '~> 0.0', '>= 0.0.1'
32
32
  dependency 'ostruct', '~> 0.0'
33
- dependency 'documentrix', '~> 0.0'
34
33
  development_dependency 'all_images', '~> 0.6'
35
34
  development_dependency 'rspec', '~> 3.2'
36
35
  development_dependency 'kramdown', '~> 2.0'
@@ -18,6 +18,7 @@ class Ollama::Client::Doc
18
18
  embeddings: 'https://github.com/ollama/ollama/blob/main/docs/api.md#generate-embeddings', # superseded by /api/embed
19
19
  embed: 'https://github.com/ollama/ollama/blob/main/docs/api.md#generate-embeddings',
20
20
  ps: 'https://github.com/ollama/ollama/blob/main/docs/api.md#list-running-models',
21
+ version: 'https://github.com/ollama/ollama/blob/main/docs/api.md#version',
21
22
  )[name]
22
23
  end
23
24
 
data/lib/ollama/client.rb CHANGED
@@ -57,6 +57,8 @@ class Ollama::Client
57
57
 
58
58
  command(:ps, default_handler: Single)
59
59
 
60
+ command(:version, default_handler: Single)
61
+
60
62
  def commands
61
63
  doc_annotations.sort_by(&:first).transpose.last
62
64
  end
@@ -0,0 +1,17 @@
1
+ class Ollama::Commands::Version
2
+ def self.path
3
+ '/api/version'
4
+ end
5
+
6
+ def initialize()
7
+ @stream = false
8
+ end
9
+
10
+ attr_reader :stream
11
+
12
+ attr_writer :client
13
+
14
+ def perform(handler)
15
+ @client.request(method: :get, path: self.class.path, stream:, handler:)
16
+ end
17
+ end
@@ -1,6 +1,6 @@
1
1
  module Ollama
2
2
  # Ollama version
3
- VERSION = '0.14.0'
3
+ VERSION = '0.15.0'
4
4
  VERSION_ARRAY = VERSION.split('.').map(&:to_i) # :nodoc:
5
5
  VERSION_MAJOR = VERSION_ARRAY[0] # :nodoc:
6
6
  VERSION_MINOR = VERSION_ARRAY[1] # :nodoc:
data/lib/ollama.rb CHANGED
@@ -39,5 +39,6 @@ require 'ollama/commands/push'
39
39
  require 'ollama/commands/embed'
40
40
  require 'ollama/commands/embeddings'
41
41
  require 'ollama/commands/ps'
42
+ require 'ollama/commands/version'
42
43
 
43
44
  require 'ollama/client'
data/ollama-ruby.gemspec CHANGED
@@ -1,26 +1,26 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: ollama-ruby 0.14.0 ruby lib
2
+ # stub: ollama-ruby 0.15.0 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "ollama-ruby".freeze
6
- s.version = "0.14.0".freeze
6
+ s.version = "0.15.0".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]
10
10
  s.authors = ["Florian Frank".freeze]
11
- s.date = "2025-01-29"
11
+ s.date = "2025-02-12"
12
12
  s.description = "Library that allows interacting with the Ollama API".freeze
13
13
  s.email = "flori@ping.de".freeze
14
14
  s.executables = ["ollama_console".freeze, "ollama_update".freeze, "ollama_cli".freeze]
15
- s.extra_rdoc_files = ["README.md".freeze, "lib/ollama.rb".freeze, "lib/ollama/client.rb".freeze, "lib/ollama/client/command.rb".freeze, "lib/ollama/client/doc.rb".freeze, "lib/ollama/commands/chat.rb".freeze, "lib/ollama/commands/copy.rb".freeze, "lib/ollama/commands/create.rb".freeze, "lib/ollama/commands/delete.rb".freeze, "lib/ollama/commands/embed.rb".freeze, "lib/ollama/commands/embeddings.rb".freeze, "lib/ollama/commands/generate.rb".freeze, "lib/ollama/commands/ps.rb".freeze, "lib/ollama/commands/pull.rb".freeze, "lib/ollama/commands/push.rb".freeze, "lib/ollama/commands/show.rb".freeze, "lib/ollama/commands/tags.rb".freeze, "lib/ollama/dto.rb".freeze, "lib/ollama/errors.rb".freeze, "lib/ollama/handlers.rb".freeze, "lib/ollama/handlers/collector.rb".freeze, "lib/ollama/handlers/concern.rb".freeze, "lib/ollama/handlers/dump_json.rb".freeze, "lib/ollama/handlers/dump_yaml.rb".freeze, "lib/ollama/handlers/markdown.rb".freeze, "lib/ollama/handlers/nop.rb".freeze, "lib/ollama/handlers/print.rb".freeze, "lib/ollama/handlers/progress.rb".freeze, "lib/ollama/handlers/say.rb".freeze, "lib/ollama/handlers/single.rb".freeze, "lib/ollama/image.rb".freeze, "lib/ollama/message.rb".freeze, "lib/ollama/options.rb".freeze, "lib/ollama/response.rb".freeze, "lib/ollama/tool.rb".freeze, "lib/ollama/tool/function.rb".freeze, "lib/ollama/tool/function/parameters.rb".freeze, "lib/ollama/tool/function/parameters/property.rb".freeze, "lib/ollama/version.rb".freeze]
16
- s.files = [".envrc".freeze, ".yardopts".freeze, "CHANGES.md".freeze, "Gemfile".freeze, "LICENSE".freeze, "README.md".freeze, "Rakefile".freeze, "bin/ollama_cli".freeze, "bin/ollama_console".freeze, "bin/ollama_update".freeze, "lib/ollama.rb".freeze, "lib/ollama/client.rb".freeze, "lib/ollama/client/command.rb".freeze, "lib/ollama/client/doc.rb".freeze, "lib/ollama/commands/chat.rb".freeze, "lib/ollama/commands/copy.rb".freeze, "lib/ollama/commands/create.rb".freeze, "lib/ollama/commands/delete.rb".freeze, "lib/ollama/commands/embed.rb".freeze, "lib/ollama/commands/embeddings.rb".freeze, "lib/ollama/commands/generate.rb".freeze, "lib/ollama/commands/ps.rb".freeze, "lib/ollama/commands/pull.rb".freeze, "lib/ollama/commands/push.rb".freeze, "lib/ollama/commands/show.rb".freeze, "lib/ollama/commands/tags.rb".freeze, "lib/ollama/dto.rb".freeze, "lib/ollama/errors.rb".freeze, "lib/ollama/handlers.rb".freeze, "lib/ollama/handlers/collector.rb".freeze, "lib/ollama/handlers/concern.rb".freeze, "lib/ollama/handlers/dump_json.rb".freeze, "lib/ollama/handlers/dump_yaml.rb".freeze, "lib/ollama/handlers/markdown.rb".freeze, "lib/ollama/handlers/nop.rb".freeze, "lib/ollama/handlers/print.rb".freeze, "lib/ollama/handlers/progress.rb".freeze, "lib/ollama/handlers/say.rb".freeze, "lib/ollama/handlers/single.rb".freeze, "lib/ollama/image.rb".freeze, "lib/ollama/message.rb".freeze, "lib/ollama/options.rb".freeze, "lib/ollama/response.rb".freeze, "lib/ollama/tool.rb".freeze, "lib/ollama/tool/function.rb".freeze, "lib/ollama/tool/function/parameters.rb".freeze, "lib/ollama/tool/function/parameters/property.rb".freeze, "lib/ollama/version.rb".freeze, "ollama-ruby.gemspec".freeze, "spec/assets/kitten.jpg".freeze, "spec/ollama/client/doc_spec.rb".freeze, "spec/ollama/client_spec.rb".freeze, "spec/ollama/commands/chat_spec.rb".freeze, "spec/ollama/commands/copy_spec.rb".freeze, "spec/ollama/commands/create_spec.rb".freeze, "spec/ollama/commands/delete_spec.rb".freeze, "spec/ollama/commands/embed_spec.rb".freeze, "spec/ollama/commands/embeddings_spec.rb".freeze, "spec/ollama/commands/generate_spec.rb".freeze, "spec/ollama/commands/ps_spec.rb".freeze, "spec/ollama/commands/pull_spec.rb".freeze, "spec/ollama/commands/push_spec.rb".freeze, "spec/ollama/commands/show_spec.rb".freeze, "spec/ollama/commands/tags_spec.rb".freeze, "spec/ollama/handlers/collector_spec.rb".freeze, "spec/ollama/handlers/dump_json_spec.rb".freeze, "spec/ollama/handlers/dump_yaml_spec.rb".freeze, "spec/ollama/handlers/markdown_spec.rb".freeze, "spec/ollama/handlers/nop_spec.rb".freeze, "spec/ollama/handlers/print_spec.rb".freeze, "spec/ollama/handlers/progress_spec.rb".freeze, "spec/ollama/handlers/say_spec.rb".freeze, "spec/ollama/handlers/single_spec.rb".freeze, "spec/ollama/image_spec.rb".freeze, "spec/ollama/message_spec.rb".freeze, "spec/ollama/options_spec.rb".freeze, "spec/ollama/tool_spec.rb".freeze, "spec/spec_helper.rb".freeze, "tmp/.keep".freeze]
15
+ s.extra_rdoc_files = ["README.md".freeze, "lib/ollama.rb".freeze, "lib/ollama/client.rb".freeze, "lib/ollama/client/command.rb".freeze, "lib/ollama/client/doc.rb".freeze, "lib/ollama/commands/chat.rb".freeze, "lib/ollama/commands/copy.rb".freeze, "lib/ollama/commands/create.rb".freeze, "lib/ollama/commands/delete.rb".freeze, "lib/ollama/commands/embed.rb".freeze, "lib/ollama/commands/embeddings.rb".freeze, "lib/ollama/commands/generate.rb".freeze, "lib/ollama/commands/ps.rb".freeze, "lib/ollama/commands/pull.rb".freeze, "lib/ollama/commands/push.rb".freeze, "lib/ollama/commands/show.rb".freeze, "lib/ollama/commands/tags.rb".freeze, "lib/ollama/commands/version.rb".freeze, "lib/ollama/dto.rb".freeze, "lib/ollama/errors.rb".freeze, "lib/ollama/handlers.rb".freeze, "lib/ollama/handlers/collector.rb".freeze, "lib/ollama/handlers/concern.rb".freeze, "lib/ollama/handlers/dump_json.rb".freeze, "lib/ollama/handlers/dump_yaml.rb".freeze, "lib/ollama/handlers/markdown.rb".freeze, "lib/ollama/handlers/nop.rb".freeze, "lib/ollama/handlers/print.rb".freeze, "lib/ollama/handlers/progress.rb".freeze, "lib/ollama/handlers/say.rb".freeze, "lib/ollama/handlers/single.rb".freeze, "lib/ollama/image.rb".freeze, "lib/ollama/message.rb".freeze, "lib/ollama/options.rb".freeze, "lib/ollama/response.rb".freeze, "lib/ollama/tool.rb".freeze, "lib/ollama/tool/function.rb".freeze, "lib/ollama/tool/function/parameters.rb".freeze, "lib/ollama/tool/function/parameters/property.rb".freeze, "lib/ollama/version.rb".freeze]
16
+ s.files = [".yardopts".freeze, "CHANGES.md".freeze, "Gemfile".freeze, "LICENSE".freeze, "README.md".freeze, "Rakefile".freeze, "bin/ollama_cli".freeze, "bin/ollama_console".freeze, "bin/ollama_update".freeze, "lib/ollama.rb".freeze, "lib/ollama/client.rb".freeze, "lib/ollama/client/command.rb".freeze, "lib/ollama/client/doc.rb".freeze, "lib/ollama/commands/chat.rb".freeze, "lib/ollama/commands/copy.rb".freeze, "lib/ollama/commands/create.rb".freeze, "lib/ollama/commands/delete.rb".freeze, "lib/ollama/commands/embed.rb".freeze, "lib/ollama/commands/embeddings.rb".freeze, "lib/ollama/commands/generate.rb".freeze, "lib/ollama/commands/ps.rb".freeze, "lib/ollama/commands/pull.rb".freeze, "lib/ollama/commands/push.rb".freeze, "lib/ollama/commands/show.rb".freeze, "lib/ollama/commands/tags.rb".freeze, "lib/ollama/commands/version.rb".freeze, "lib/ollama/dto.rb".freeze, "lib/ollama/errors.rb".freeze, "lib/ollama/handlers.rb".freeze, "lib/ollama/handlers/collector.rb".freeze, "lib/ollama/handlers/concern.rb".freeze, "lib/ollama/handlers/dump_json.rb".freeze, "lib/ollama/handlers/dump_yaml.rb".freeze, "lib/ollama/handlers/markdown.rb".freeze, "lib/ollama/handlers/nop.rb".freeze, "lib/ollama/handlers/print.rb".freeze, "lib/ollama/handlers/progress.rb".freeze, "lib/ollama/handlers/say.rb".freeze, "lib/ollama/handlers/single.rb".freeze, "lib/ollama/image.rb".freeze, "lib/ollama/message.rb".freeze, "lib/ollama/options.rb".freeze, "lib/ollama/response.rb".freeze, "lib/ollama/tool.rb".freeze, "lib/ollama/tool/function.rb".freeze, "lib/ollama/tool/function/parameters.rb".freeze, "lib/ollama/tool/function/parameters/property.rb".freeze, "lib/ollama/version.rb".freeze, "ollama-ruby.gemspec".freeze, "spec/assets/kitten.jpg".freeze, "spec/ollama/client/doc_spec.rb".freeze, "spec/ollama/client_spec.rb".freeze, "spec/ollama/commands/chat_spec.rb".freeze, "spec/ollama/commands/copy_spec.rb".freeze, "spec/ollama/commands/create_spec.rb".freeze, "spec/ollama/commands/delete_spec.rb".freeze, "spec/ollama/commands/embed_spec.rb".freeze, "spec/ollama/commands/embeddings_spec.rb".freeze, "spec/ollama/commands/generate_spec.rb".freeze, "spec/ollama/commands/ps_spec.rb".freeze, "spec/ollama/commands/pull_spec.rb".freeze, "spec/ollama/commands/push_spec.rb".freeze, "spec/ollama/commands/show_spec.rb".freeze, "spec/ollama/commands/tags_spec.rb".freeze, "spec/ollama/commands/version_spec.rb".freeze, "spec/ollama/handlers/collector_spec.rb".freeze, "spec/ollama/handlers/dump_json_spec.rb".freeze, "spec/ollama/handlers/dump_yaml_spec.rb".freeze, "spec/ollama/handlers/markdown_spec.rb".freeze, "spec/ollama/handlers/nop_spec.rb".freeze, "spec/ollama/handlers/print_spec.rb".freeze, "spec/ollama/handlers/progress_spec.rb".freeze, "spec/ollama/handlers/say_spec.rb".freeze, "spec/ollama/handlers/single_spec.rb".freeze, "spec/ollama/image_spec.rb".freeze, "spec/ollama/message_spec.rb".freeze, "spec/ollama/options_spec.rb".freeze, "spec/ollama/tool_spec.rb".freeze, "spec/spec_helper.rb".freeze, "tmp/.keep".freeze]
17
17
  s.homepage = "https://github.com/flori/ollama-ruby".freeze
18
18
  s.licenses = ["MIT".freeze]
19
19
  s.rdoc_options = ["--title".freeze, "Ollama-ruby - Interacting with the Ollama API".freeze, "--main".freeze, "README.md".freeze]
20
20
  s.required_ruby_version = Gem::Requirement.new("~> 3.1".freeze)
21
21
  s.rubygems_version = "3.6.2".freeze
22
22
  s.summary = "Interacting with the Ollama API".freeze
23
- s.test_files = ["spec/ollama/client/doc_spec.rb".freeze, "spec/ollama/client_spec.rb".freeze, "spec/ollama/commands/chat_spec.rb".freeze, "spec/ollama/commands/copy_spec.rb".freeze, "spec/ollama/commands/create_spec.rb".freeze, "spec/ollama/commands/delete_spec.rb".freeze, "spec/ollama/commands/embed_spec.rb".freeze, "spec/ollama/commands/embeddings_spec.rb".freeze, "spec/ollama/commands/generate_spec.rb".freeze, "spec/ollama/commands/ps_spec.rb".freeze, "spec/ollama/commands/pull_spec.rb".freeze, "spec/ollama/commands/push_spec.rb".freeze, "spec/ollama/commands/show_spec.rb".freeze, "spec/ollama/commands/tags_spec.rb".freeze, "spec/ollama/handlers/collector_spec.rb".freeze, "spec/ollama/handlers/dump_json_spec.rb".freeze, "spec/ollama/handlers/dump_yaml_spec.rb".freeze, "spec/ollama/handlers/markdown_spec.rb".freeze, "spec/ollama/handlers/nop_spec.rb".freeze, "spec/ollama/handlers/print_spec.rb".freeze, "spec/ollama/handlers/progress_spec.rb".freeze, "spec/ollama/handlers/say_spec.rb".freeze, "spec/ollama/handlers/single_spec.rb".freeze, "spec/ollama/image_spec.rb".freeze, "spec/ollama/message_spec.rb".freeze, "spec/ollama/options_spec.rb".freeze, "spec/ollama/tool_spec.rb".freeze, "spec/spec_helper.rb".freeze]
23
+ s.test_files = ["spec/ollama/client/doc_spec.rb".freeze, "spec/ollama/client_spec.rb".freeze, "spec/ollama/commands/chat_spec.rb".freeze, "spec/ollama/commands/copy_spec.rb".freeze, "spec/ollama/commands/create_spec.rb".freeze, "spec/ollama/commands/delete_spec.rb".freeze, "spec/ollama/commands/embed_spec.rb".freeze, "spec/ollama/commands/embeddings_spec.rb".freeze, "spec/ollama/commands/generate_spec.rb".freeze, "spec/ollama/commands/ps_spec.rb".freeze, "spec/ollama/commands/pull_spec.rb".freeze, "spec/ollama/commands/push_spec.rb".freeze, "spec/ollama/commands/show_spec.rb".freeze, "spec/ollama/commands/tags_spec.rb".freeze, "spec/ollama/commands/version_spec.rb".freeze, "spec/ollama/handlers/collector_spec.rb".freeze, "spec/ollama/handlers/dump_json_spec.rb".freeze, "spec/ollama/handlers/dump_yaml_spec.rb".freeze, "spec/ollama/handlers/markdown_spec.rb".freeze, "spec/ollama/handlers/nop_spec.rb".freeze, "spec/ollama/handlers/print_spec.rb".freeze, "spec/ollama/handlers/progress_spec.rb".freeze, "spec/ollama/handlers/say_spec.rb".freeze, "spec/ollama/handlers/single_spec.rb".freeze, "spec/ollama/image_spec.rb".freeze, "spec/ollama/message_spec.rb".freeze, "spec/ollama/options_spec.rb".freeze, "spec/ollama/tool_spec.rb".freeze, "spec/spec_helper.rb".freeze]
24
24
 
25
25
  s.specification_version = 4
26
26
 
@@ -38,5 +38,4 @@ Gem::Specification.new do |s|
38
38
  s.add_runtime_dependency(%q<term-ansicolor>.freeze, ["~> 1.11".freeze])
39
39
  s.add_runtime_dependency(%q<kramdown-ansi>.freeze, ["~> 0.0".freeze, ">= 0.0.1".freeze])
40
40
  s.add_runtime_dependency(%q<ostruct>.freeze, ["~> 0.0".freeze])
41
- s.add_runtime_dependency(%q<documentrix>.freeze, ["~> 0.0".freeze])
42
41
  end
@@ -0,0 +1,25 @@
1
+ require 'spec_helper'
2
+
3
+ RSpec.describe Ollama::Commands::Version do
4
+ let :version do
5
+ described_class.new
6
+ end
7
+
8
+ it 'can be instantiated' do
9
+ expect(version).to be_a described_class
10
+ end
11
+
12
+ it 'cannot be converted to JSON' do
13
+ expect(version).not_to respond_to(:as_json)
14
+ end
15
+
16
+ it 'can perform' do
17
+ version.client = ollama = double('Ollama::Client')
18
+ expect(ollama).to receive(:request).
19
+ with(
20
+ method: :get, path: '/api/version', handler: Ollama::Handlers::NOP,
21
+ stream: false
22
+ )
23
+ version.perform(Ollama::Handlers::NOP)
24
+ end
25
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ollama-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.0
4
+ version: 0.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Frank
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2025-01-29 00:00:00.000000000 Z
10
+ date: 2025-02-12 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: gem_hadar
@@ -211,20 +211,6 @@ dependencies:
211
211
  - - "~>"
212
212
  - !ruby/object:Gem::Version
213
213
  version: '0.0'
214
- - !ruby/object:Gem::Dependency
215
- name: documentrix
216
- requirement: !ruby/object:Gem::Requirement
217
- requirements:
218
- - - "~>"
219
- - !ruby/object:Gem::Version
220
- version: '0.0'
221
- type: :runtime
222
- prerelease: false
223
- version_requirements: !ruby/object:Gem::Requirement
224
- requirements:
225
- - - "~>"
226
- - !ruby/object:Gem::Version
227
- version: '0.0'
228
214
  description: Library that allows interacting with the Ollama API
229
215
  email: flori@ping.de
230
216
  executables:
@@ -250,6 +236,7 @@ extra_rdoc_files:
250
236
  - lib/ollama/commands/push.rb
251
237
  - lib/ollama/commands/show.rb
252
238
  - lib/ollama/commands/tags.rb
239
+ - lib/ollama/commands/version.rb
253
240
  - lib/ollama/dto.rb
254
241
  - lib/ollama/errors.rb
255
242
  - lib/ollama/handlers.rb
@@ -273,7 +260,6 @@ extra_rdoc_files:
273
260
  - lib/ollama/tool/function/parameters/property.rb
274
261
  - lib/ollama/version.rb
275
262
  files:
276
- - ".envrc"
277
263
  - ".yardopts"
278
264
  - CHANGES.md
279
265
  - Gemfile
@@ -299,6 +285,7 @@ files:
299
285
  - lib/ollama/commands/push.rb
300
286
  - lib/ollama/commands/show.rb
301
287
  - lib/ollama/commands/tags.rb
288
+ - lib/ollama/commands/version.rb
302
289
  - lib/ollama/dto.rb
303
290
  - lib/ollama/errors.rb
304
291
  - lib/ollama/handlers.rb
@@ -337,6 +324,7 @@ files:
337
324
  - spec/ollama/commands/push_spec.rb
338
325
  - spec/ollama/commands/show_spec.rb
339
326
  - spec/ollama/commands/tags_spec.rb
327
+ - spec/ollama/commands/version_spec.rb
340
328
  - spec/ollama/handlers/collector_spec.rb
341
329
  - spec/ollama/handlers/dump_json_spec.rb
342
330
  - spec/ollama/handlers/dump_yaml_spec.rb
@@ -392,6 +380,7 @@ test_files:
392
380
  - spec/ollama/commands/push_spec.rb
393
381
  - spec/ollama/commands/show_spec.rb
394
382
  - spec/ollama/commands/tags_spec.rb
383
+ - spec/ollama/commands/version_spec.rb
395
384
  - spec/ollama/handlers/collector_spec.rb
396
385
  - spec/ollama/handlers/dump_json_spec.rb
397
386
  - spec/ollama/handlers/dump_yaml_spec.rb
data/.envrc DELETED
@@ -1,2 +0,0 @@
1
- export REDIS_URL=redis://localhost:9736
2
- export REDIS_EXPRING_URL=redis://localhost:9736