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.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/.envrc +1 -0
  3. data/CHANGES.md +78 -0
  4. data/README.md +62 -23
  5. data/Rakefile +16 -4
  6. data/bin/ollama_chat +470 -90
  7. data/bin/ollama_console +3 -3
  8. data/bin/ollama_update +17 -0
  9. data/config/redis.conf +5 -0
  10. data/docker-compose.yml +11 -0
  11. data/lib/ollama/client.rb +7 -2
  12. data/lib/ollama/documents/memory_cache.rb +44 -0
  13. data/lib/ollama/documents/redis_cache.rb +57 -0
  14. data/lib/ollama/documents/splitters/character.rb +70 -0
  15. data/lib/ollama/documents/splitters/semantic.rb +90 -0
  16. data/lib/ollama/documents.rb +172 -0
  17. data/lib/ollama/dto.rb +4 -7
  18. data/lib/ollama/handlers/progress.rb +18 -5
  19. data/lib/ollama/image.rb +16 -7
  20. data/lib/ollama/options.rb +4 -0
  21. data/lib/ollama/utils/chooser.rb +30 -0
  22. data/lib/ollama/utils/colorize_texts.rb +42 -0
  23. data/lib/ollama/utils/fetcher.rb +105 -0
  24. data/lib/ollama/utils/math.rb +48 -0
  25. data/lib/ollama/utils/tags.rb +7 -0
  26. data/lib/ollama/utils/width.rb +1 -1
  27. data/lib/ollama/version.rb +1 -1
  28. data/lib/ollama.rb +12 -5
  29. data/ollama-ruby.gemspec +19 -9
  30. data/spec/assets/embeddings.json +1 -0
  31. data/spec/ollama/client_spec.rb +2 -2
  32. data/spec/ollama/commands/chat_spec.rb +2 -2
  33. data/spec/ollama/commands/copy_spec.rb +2 -2
  34. data/spec/ollama/commands/create_spec.rb +2 -2
  35. data/spec/ollama/commands/delete_spec.rb +2 -2
  36. data/spec/ollama/commands/embed_spec.rb +3 -3
  37. data/spec/ollama/commands/embeddings_spec.rb +2 -2
  38. data/spec/ollama/commands/generate_spec.rb +2 -2
  39. data/spec/ollama/commands/pull_spec.rb +2 -2
  40. data/spec/ollama/commands/push_spec.rb +2 -2
  41. data/spec/ollama/commands/show_spec.rb +2 -2
  42. data/spec/ollama/documents/memory_cache_spec.rb +63 -0
  43. data/spec/ollama/documents/redis_cache_spec.rb +78 -0
  44. data/spec/ollama/documents/splitters/character_spec.rb +96 -0
  45. data/spec/ollama/documents/splitters/semantic_spec.rb +56 -0
  46. data/spec/ollama/documents_spec.rb +119 -0
  47. data/spec/ollama/handlers/progress_spec.rb +2 -2
  48. data/spec/ollama/image_spec.rb +4 -0
  49. data/spec/ollama/message_spec.rb +3 -4
  50. data/spec/ollama/options_spec.rb +18 -0
  51. data/spec/ollama/tool_spec.rb +1 -6
  52. data/spec/ollama/utils/fetcher_spec.rb +74 -0
  53. data/spec/ollama/utils/tags_spec.rb +24 -0
  54. data/spec/spec_helper.rb +8 -0
  55. data/tmp/.keep +0 -0
  56. metadata +187 -5
@@ -0,0 +1,42 @@
1
+ class Ollama::Utils::ColorizeTexts
2
+ include Math
3
+ include Term::ANSIColor
4
+ include Ollama::Utils::Width
5
+
6
+ def initialize(*texts)
7
+ texts = texts.map(&:to_a)
8
+ @texts = Array(texts.flatten)
9
+ end
10
+
11
+ def to_s
12
+ result = +''
13
+ @texts.each_with_index do |t, i|
14
+ color = colors[(t.hash ^ i.hash) % colors.size]
15
+ wrap(t, percentage: 90).each_line { |l|
16
+ result << on_color(color) { color(text_color(color)) { l } }
17
+ }
18
+ result << "\n##{bold{t.size.to_s}} \n\n"
19
+ end
20
+ result
21
+ end
22
+
23
+ private
24
+
25
+ def text_color(color)
26
+ color = Term::ANSIColor::Attribute[color]
27
+ [
28
+ Attribute.nearest_rgb_color('#000'),
29
+ Attribute.nearest_rgb_color('#fff'),
30
+ ].max_by { |t| t.distance_to(color) }
31
+ end
32
+
33
+ def colors
34
+ @colors ||= (0..255).map { |i|
35
+ [
36
+ 128 + 128 * sin(PI * i / 32.0),
37
+ 128 + 128 * sin(PI * i / 64.0),
38
+ 128 + 128 * sin(PI * i / 128.0),
39
+ ].map { _1.clamp(0, 255).round }
40
+ }
41
+ end
42
+ end
@@ -0,0 +1,105 @@
1
+ require 'tempfile'
2
+ require 'tins/unit'
3
+ require 'infobar'
4
+ require 'mime-types'
5
+
6
+ class Ollama::Utils::Fetcher
7
+ module ContentType
8
+ attr_accessor :content_type
9
+ end
10
+
11
+ class RetryWithoutStreaming < StandardError; end
12
+
13
+ def initialize
14
+ @started = false
15
+ @streaming = true
16
+ end
17
+
18
+ def self.get(url, &block)
19
+ new.get(url, &block)
20
+ end
21
+
22
+ def get(url, &block)
23
+ response = nil
24
+ Tempfile.open do |tmp|
25
+ infobar.label = 'Getting'
26
+ if @streaming
27
+ response = Excon.get(url, headers:, response_block: callback(tmp))
28
+ response.status != 200 || !@started and raise RetryWithoutStreaming
29
+ decorate_io(tmp, response)
30
+ infobar.finish
31
+ block.(tmp)
32
+ else
33
+ response = Excon.get(url, headers:, middlewares:)
34
+ if response.status != 200
35
+ raise "invalid response status code"
36
+ end
37
+ body = response.body
38
+ tmp.print body
39
+ infobar.update(message: message(body.size, body.size), force: true)
40
+ decorate_io(tmp, response)
41
+ infobar.finish
42
+ block.(tmp)
43
+ end
44
+ end
45
+ rescue RetryWithoutStreaming
46
+ @streaming = false
47
+ retry
48
+ rescue => e
49
+ STDERR.puts "Cannot get #{url.to_s.inspect} (#{e}): #{response&.status_line}"
50
+ unless e.is_a?(RuntimeError)
51
+ STDERR.puts "#{e.backtrace * ?\n}"
52
+ end
53
+ yield nil
54
+ end
55
+
56
+ def headers
57
+ {
58
+ 'User-Agent' => Ollama::Client.user_agent,
59
+ }
60
+ end
61
+
62
+ def middlewares
63
+ (Excon.defaults[:middlewares] + [ Excon::Middleware::RedirectFollower ]).uniq
64
+ end
65
+
66
+ def decorate_io(tmp, response)
67
+ tmp.rewind
68
+ tmp.extend(ContentType)
69
+ if content_type = MIME::Types[response.headers['content-type']].first
70
+ tmp.content_type = content_type
71
+ end
72
+ end
73
+
74
+ def callback(tmp)
75
+ -> chunk, remaining_bytes, total_bytes do
76
+ total = total_bytes or next
77
+ current = total_bytes - remaining_bytes
78
+ if @started
79
+ infobar.counter.progress(by: total - current)
80
+ else
81
+ @started = true
82
+ infobar.counter.reset(total:, current:)
83
+ end
84
+ infobar.update(message: message(current, total), force: true)
85
+ tmp.print(chunk)
86
+ end
87
+ end
88
+
89
+ def message(current, total)
90
+ progress = '%s/%s' % [ current, total ].map {
91
+ Tins::Unit.format(_1, format: '%.2f %U')
92
+ }
93
+ '%l ' + progress + ' in %te, ETA %e @%E'
94
+ end
95
+
96
+ def self.read(filename, &block)
97
+ if File.exist?(filename)
98
+ File.open(filename) do |file|
99
+ file.extend(Ollama::Utils::Fetcher::ContentType)
100
+ file.content_type = MIME::Types.type_for(filename).first
101
+ block.(file)
102
+ end
103
+ end
104
+ end
105
+ end
@@ -0,0 +1,48 @@
1
+ module Ollama::Utils::Math
2
+ # Returns the cosine similarity between two vectors +a+ and +b+, 1.0 is
3
+ # exactly the same, 0.0 means decorrelated.
4
+ #
5
+ # @param [Vector] a The first vector
6
+ # @param [Vector] b The second vector
7
+ # @option a_norm [Float] a The Euclidean norm of vector a (default: calculated from a)
8
+ # @option b_norm [Float] b The Euclidean norm of vector b (default: calculated from b)
9
+ #
10
+ # @return [Float] The cosine similarity between the two vectors
11
+ #
12
+ # @example Calculate the cosine similarity between two vectors
13
+ # cosine_similarity(a: [1, 2], b: [3, 4])
14
+ #
15
+ # @see #convert_to_vector
16
+ # @see #norm
17
+ def cosine_similarity(a:, b:, a_norm: norm(a), b_norm: norm(b))
18
+ a, b = convert_to_vector(a), convert_to_vector(b)
19
+ a.dot(b) / (a_norm * b_norm)
20
+ end
21
+
22
+ # Returns the Euclidean norm (magnitude) of a vector.
23
+ #
24
+ # @param vector [Array] The input vector.
25
+ #
26
+ # @return [Float] The magnitude of the vector.
27
+ #
28
+ # @example
29
+ # norm([3, 4]) # => 5.0
30
+ def norm(vector)
31
+ s = 0.0
32
+ vector.each { s += _1.abs2 }
33
+ Math.sqrt(s)
34
+ end
35
+
36
+ # Converts an array to a Numo NArray.
37
+ #
38
+ # @param [Array] vector The input array to be converted.
39
+ #
40
+ # @return [Numo::NArray] The converted NArray, or the original if it's already a Numo NArray.
41
+ #
42
+ # @example Convert an array to a Numo NArray
43
+ # convert_to_vector([1, 2, 3]) # => Numo::NArray[1, 2, 3]
44
+ def convert_to_vector(vector)
45
+ vector.is_a?(Numo::NArray) and return vector
46
+ Numo::NArray[*vector]
47
+ end
48
+ end
@@ -0,0 +1,7 @@
1
+ require 'sorted_set'
2
+
3
+ class Ollama::Utils::Tags < SortedSet
4
+ def to_s
5
+ map { |t| '#%s' % t } * ' '
6
+ end
7
+ end
@@ -12,7 +12,7 @@ module Ollama::Utils::Width
12
12
  raise ArgumentError, "either pass percentage or length argument"
13
13
  percentage and length ||= width(percentage:)
14
14
  text.gsub(/(?<!\n)\n(?!\n)/, ' ').lines.map do |line|
15
- if line.length > length
15
+ if length >= 1 && line.length > length
16
16
  line.gsub(/(.{1,#{length}})(\s+|$)/, "\\1\n").strip
17
17
  else
18
18
  line.strip
@@ -1,6 +1,6 @@
1
1
  module Ollama
2
2
  # Ollama version
3
- VERSION = '0.0.1'
3
+ VERSION = '0.2.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
@@ -1,4 +1,5 @@
1
1
  require 'json'
2
+ require 'excon'
2
3
 
3
4
  module Ollama
4
5
  end
@@ -8,6 +9,16 @@ module Ollama
8
9
  include Ollama::Handlers
9
10
  end
10
11
 
12
+ module Ollama::Utils
13
+ end
14
+ require 'ollama/utils/width'
15
+ require 'ollama/utils/ansi_markdown'
16
+ require 'ollama/utils/tags'
17
+ require 'ollama/utils/math'
18
+ require 'ollama/utils/colorize_texts'
19
+ require 'ollama/utils/fetcher'
20
+ require 'ollama/utils/chooser'
21
+
11
22
  require 'ollama/version'
12
23
  require 'ollama/errors'
13
24
  require 'ollama/dto'
@@ -19,11 +30,7 @@ require 'ollama/tool/function/parameters'
19
30
  require 'ollama/tool/function/parameters/property'
20
31
  require 'ollama/response'
21
32
  require 'ollama/options'
22
-
23
- module Ollama::Utils
24
- end
25
- require 'ollama/utils/width'
26
- require 'ollama/utils/ansi_markdown'
33
+ require 'ollama/documents'
27
34
 
28
35
  class Ollama::Commands
29
36
  end
data/ollama-ruby.gemspec CHANGED
@@ -1,36 +1,46 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: ollama-ruby 0.0.1 ruby lib
2
+ # stub: ollama-ruby 0.2.0 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "ollama-ruby".freeze
6
- s.version = "0.0.1".freeze
6
+ s.version = "0.2.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 = "2024-08-16"
11
+ s.date = "2024-09-03"
12
12
  s.description = "Library that allows interacting with the Ollama API".freeze
13
13
  s.email = "flori@ping.de".freeze
14
- s.executables = ["ollama_console".freeze, "ollama_chat".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/utils/ansi_markdown.rb".freeze, "lib/ollama/utils/width.rb".freeze, "lib/ollama/version.rb".freeze]
16
- s.files = ["Gemfile".freeze, "LICENSE".freeze, "README.md".freeze, "Rakefile".freeze, "bin/ollama_chat".freeze, "bin/ollama_console".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/utils/ansi_markdown.rb".freeze, "lib/ollama/utils/width.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/ollama/utils/ansi_markdown_spec.rb".freeze, "spec/spec_helper.rb".freeze]
14
+ s.executables = ["ollama_console".freeze, "ollama_chat".freeze, "ollama_update".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/documents.rb".freeze, "lib/ollama/documents/memory_cache.rb".freeze, "lib/ollama/documents/redis_cache.rb".freeze, "lib/ollama/documents/splitters/character.rb".freeze, "lib/ollama/documents/splitters/semantic.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/utils/ansi_markdown.rb".freeze, "lib/ollama/utils/chooser.rb".freeze, "lib/ollama/utils/colorize_texts.rb".freeze, "lib/ollama/utils/fetcher.rb".freeze, "lib/ollama/utils/math.rb".freeze, "lib/ollama/utils/tags.rb".freeze, "lib/ollama/utils/width.rb".freeze, "lib/ollama/version.rb".freeze]
16
+ s.files = [".envrc".freeze, "CHANGES.md".freeze, "Gemfile".freeze, "LICENSE".freeze, "README.md".freeze, "Rakefile".freeze, "bin/ollama_chat".freeze, "bin/ollama_console".freeze, "bin/ollama_update".freeze, "config/redis.conf".freeze, "docker-compose.yml".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/documents.rb".freeze, "lib/ollama/documents/memory_cache.rb".freeze, "lib/ollama/documents/redis_cache.rb".freeze, "lib/ollama/documents/splitters/character.rb".freeze, "lib/ollama/documents/splitters/semantic.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/utils/ansi_markdown.rb".freeze, "lib/ollama/utils/chooser.rb".freeze, "lib/ollama/utils/colorize_texts.rb".freeze, "lib/ollama/utils/fetcher.rb".freeze, "lib/ollama/utils/math.rb".freeze, "lib/ollama/utils/tags.rb".freeze, "lib/ollama/utils/width.rb".freeze, "lib/ollama/version.rb".freeze, "ollama-ruby.gemspec".freeze, "spec/assets/embeddings.json".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/documents/memory_cache_spec.rb".freeze, "spec/ollama/documents/redis_cache_spec.rb".freeze, "spec/ollama/documents/splitters/character_spec.rb".freeze, "spec/ollama/documents/splitters/semantic_spec.rb".freeze, "spec/ollama/documents_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/ollama/utils/ansi_markdown_spec.rb".freeze, "spec/ollama/utils/fetcher_spec.rb".freeze, "spec/ollama/utils/tags_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
- s.rubygems_version = "3.5.16".freeze
21
+ s.rubygems_version = "3.5.11".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/ollama/utils/ansi_markdown_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/documents/memory_cache_spec.rb".freeze, "spec/ollama/documents/redis_cache_spec.rb".freeze, "spec/ollama/documents/splitters/character_spec.rb".freeze, "spec/ollama/documents/splitters/semantic_spec.rb".freeze, "spec/ollama/documents_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/ollama/utils/ansi_markdown_spec.rb".freeze, "spec/ollama/utils/fetcher_spec.rb".freeze, "spec/ollama/utils/tags_spec.rb".freeze, "spec/spec_helper.rb".freeze]
24
24
 
25
25
  s.specification_version = 4
26
26
 
27
- s.add_development_dependency(%q<gem_hadar>.freeze, ["~> 1.16.1".freeze])
27
+ s.add_development_dependency(%q<gem_hadar>.freeze, ["~> 1.17.0".freeze])
28
28
  s.add_development_dependency(%q<all_images>.freeze, ["~> 0.4".freeze])
29
29
  s.add_development_dependency(%q<rspec>.freeze, ["~> 3.2".freeze])
30
30
  s.add_development_dependency(%q<utils>.freeze, [">= 0".freeze])
31
+ s.add_development_dependency(%q<webmock>.freeze, [">= 0".freeze])
31
32
  s.add_runtime_dependency(%q<excon>.freeze, ["~> 0.111".freeze])
32
33
  s.add_runtime_dependency(%q<infobar>.freeze, ["~> 0.7".freeze])
33
34
  s.add_runtime_dependency(%q<term-ansicolor>.freeze, ["~> 1.11".freeze])
34
35
  s.add_runtime_dependency(%q<kramdown-parser-gfm>.freeze, ["~> 1.1".freeze])
35
36
  s.add_runtime_dependency(%q<terminal-table>.freeze, ["~> 3.0".freeze])
37
+ s.add_runtime_dependency(%q<redis>.freeze, ["~> 5.0".freeze])
38
+ s.add_runtime_dependency(%q<numo-narray>.freeze, ["~> 0.9".freeze])
39
+ s.add_runtime_dependency(%q<more_math>.freeze, ["~> 1.1".freeze])
40
+ s.add_runtime_dependency(%q<sorted_set>.freeze, ["~> 1.0".freeze])
41
+ s.add_runtime_dependency(%q<mime-types>.freeze, ["~> 3.0".freeze])
42
+ s.add_runtime_dependency(%q<reverse_markdown>.freeze, ["~> 2.0".freeze])
43
+ s.add_runtime_dependency(%q<complex_config>.freeze, ["~> 0.20".freeze])
44
+ s.add_runtime_dependency(%q<search_ui>.freeze, ["~> 0.0".freeze])
45
+ s.add_runtime_dependency(%q<amatch>.freeze, ["~> 0.4.1".freeze])
36
46
  end
@@ -0,0 +1 @@
1
+ [[-0.009,-0.0,-0.035,-0.002,-0.044,-0.063,0.1,0.03,0.052,-0.06,-0.027,0.012,0.03,-0.04,-0.013,0.023,-0.028,0.015,-0.066,-0.032,0.052,0.028,0.063,0.037,-0.005,-0.024,0.006,0.008,0.014,-0.007,-0.042,-0.018,0.012,-0.061,-0.03,0.004,-0.019,0.003,0.065,0.058,0.004,-0.032,0.023,-0.016,0.03,-0.009,-0.022,-0.026,0.057,-0.013,0.002,0.004,-0.059,-0.047,0.084,0.085,0.048,-0.008,0.11,0.041,-0.018,0.071,-0.022,-0.067,0.015,-0.031,0.037,-0.034,0.032,0.121,0.063,0.003,-0.016,-0.007,0.011,0.093,0.056,-0.054,0.028,0.014,-0.008,-0.102,-0.072,-0.042,0.025,0.005,-0.005,-0.083,-0.008,0.018,-0.076,0.07,0.03,0.003,-0.029,0.021,0.016,0.036,-0.101,0.194,-0.01,-0.014,0.07,-0.004,0.001,-0.087,0.001,-0.0,0.02,0.0,-0.061,-0.108,-0.039,0.068,-0.015,0.033,0.008,0.044,0.016,-0.017,-0.034,-0.018,0.023,-0.018,-0.031,-0.068,0.021,0.0,-0.006,0.032,-0.019,0.019,-0.004,0.063,-0.018,-0.057,0.021,-0.054,-0.047,0.035,-0.113,-0.005,0.065,0.033,-0.018,0.055,-0.033,0.01,-0.095,0.008,0.008,0.053,-0.03,-0.036,0.068,-0.128,-0.011,0.034,-0.022,0.01,-0.012,0.033,-0.016,0.127,0.081,-0.028,-0.07,0.004,-0.067,0.063,-0.056,0.025,-0.014,0.094,-0.012,-0.016,0.065,0.045,0.082,0.001,-0.023,0.014,-0.04,-0.002,0.024,0.001,0.03,0.051,-0.017,-0.071,0.108,-0.028,0.004,-0.048,-0.026,0.041,-0.038,0.05,0.002,-0.027,-0.005,0.019,-0.045,-0.077,-0.16,0.021,0.05,-0.068,0.069,-0.045,0.041,-0.091,-0.024,0.025,-0.052,-0.046,0.066,-0.114,-0.002,0.004,0.063,-0.056,-0.004,0.0,0.071,0.08,0.022,-0.087,-0.02,-0.078,0.002,0.081,-0.038,-0.001,-0.072,0.003,0.014,0.005,0.022,-0.008,0.094,0.011,0.068,-0.013,-0.015,-0.046,0.055,0.013,-0.004,-0.001,-0.015,0.01,-0.014,0.013,-0.036,-0.007,-0.07,-0.061,-0.08,0.018,0.005,-0.001,-0.017,0.027,0.031,-0.023,0.001,0.167,-0.007,-0.031,0.035,0.032,-0.009,0.122,-0.037,-0.032,-0.011,0.018,-0.042,0.051,-0.002,-0.081,0.06,-0.009,0.061,0.065,-0.037,0.076,0.05,0.083,-0.026,0.034,-0.097,-0.016,0.116,0.026,-0.173,0.011,0.051,-0.055,0.013,0.045,-0.017,-0.121,-0.071,-0.025,0.075,-0.031,0.047,0.062,0.05,0.101,-0.036,-0.018,0.051,-0.072,0.004,-0.023,0.019,0.0,-0.024,0.073,0.018,-0.063,0.079,0.012,-0.076,-0.006,-0.009,0.002,-0.025,0.063,-0.011,0.104,0.004,0.025,0.009,-0.071,-0.032,-0.051,-0.096,-0.072,-0.116,-0.06,-0.035,-0.021,0.016,0.045,0.014,0.036,-0.03,0.009,-0.091,-0.045,0.02,-0.105,-0.006,0.046,-0.028,-0.116,-0.078,-0.013,0.019,0.004,-0.05,0.023,0.046,-0.03,-0.021,0.001,0.022,0.02,-0.015,0.059,0.132,0.022,-0.01,-0.003,-0.002,0.021,0.052,-0.023,0.017,0.009],[-0.009,-0.0,-0.035,-0.002,-0.044,-0.063,0.1,0.03,0.052,-0.06,-0.027,0.012,0.03,-0.04,-0.013,0.023,-0.028,0.015,-0.066,-0.032,0.052,0.028,0.063,0.037,-0.005,-0.024,0.006,0.008,0.014,-0.007,-0.042,-0.018,0.012,-0.061,-0.03,0.004,-0.019,0.003,0.065,0.058,0.004,-0.032,0.023,-0.016,0.03,-0.009,-0.022,-0.026,0.057,-0.013,0.002,0.004,-0.059,-0.047,0.084,0.085,0.048,-0.008,0.11,0.041,-0.018,0.071,-0.022,-0.067,0.015,-0.031,0.037,-0.034,0.032,0.121,0.063,0.003,-0.016,-0.007,0.011,0.093,0.056,-0.054,0.028,0.014,-0.008,-0.102,-0.072,-0.042,0.025,0.005,-0.005,-0.083,-0.008,0.018,-0.076,0.07,0.03,0.003,-0.029,0.021,0.016,0.036,-0.101,0.194,-0.01,-0.014,0.07,-0.004,0.001,-0.087,0.001,-0.0,0.02,0.0,-0.061,-0.108,-0.039,0.068,-0.015,0.033,0.008,0.044,0.016,-0.017,-0.034,-0.018,0.023,-0.018,-0.031,-0.068,0.021,0.0,-0.006,0.032,-0.019,0.019,-0.004,0.063,-0.018,-0.057,0.021,-0.054,-0.047,0.035,-0.113,-0.005,0.065,0.033,-0.018,0.055,-0.033,0.01,-0.095,0.008,0.008,0.053,-0.03,-0.036,0.068,-0.128,-0.011,0.034,-0.022,0.01,-0.012,0.033,-0.016,0.127,0.081,-0.028,-0.07,0.004,-0.067,0.063,-0.056,0.025,-0.014,0.094,-0.012,-0.016,0.065,0.045,0.082,0.001,-0.023,0.014,-0.04,-0.002,0.024,0.001,0.03,0.051,-0.017,-0.071,0.108,-0.028,0.004,-0.048,-0.026,0.041,-0.038,0.05,0.002,-0.027,-0.005,0.019,-0.045,-0.077,-0.16,0.021,0.05,-0.068,0.069,-0.045,0.041,-0.091,-0.024,0.025,-0.052,-0.046,0.066,-0.114,-0.002,0.004,0.063,-0.056,-0.004,0.0,0.071,0.08,0.022,-0.087,-0.02,-0.078,0.002,0.081,-0.038,-0.001,-0.072,0.003,0.014,0.005,0.022,-0.008,0.094,0.011,0.068,-0.013,-0.015,-0.046,0.055,0.013,-0.004,-0.001,-0.015,0.01,-0.014,0.013,-0.036,-0.007,-0.07,-0.061,-0.08,0.018,0.005,-0.001,-0.017,0.027,0.031,-0.023,0.001,0.167,-0.007,-0.031,0.035,0.032,-0.009,0.122,-0.037,-0.032,-0.011,0.018,-0.042,0.051,-0.002,-0.081,0.06,-0.009,0.061,0.065,-0.037,0.076,0.05,0.083,-0.026,0.034,-0.097,-0.016,0.116,0.026,-0.173,0.011,0.051,-0.055,0.013,0.045,-0.017,-0.121,-0.071,-0.025,0.075,-0.031,0.047,0.062,0.05,0.101,-0.036,-0.018,0.051,-0.072,0.004,-0.023,0.019,0.0,-0.024,0.073,0.018,-0.063,0.079,0.012,-0.076,-0.006,-0.009,0.002,-0.025,0.063,-0.011,0.104,0.004,0.025,0.009,-0.071,-0.032,-0.051,-0.096,-0.072,-0.116,-0.06,-0.035,-0.021,0.016,0.045,0.014,0.036,-0.03,0.009,-0.091,-0.045,0.02,-0.105,-0.006,0.046,-0.028,-0.116,-0.078,-0.013,0.019,0.004,-0.05,0.023,0.046,-0.03,-0.021,0.001,0.022,0.02,-0.015,0.059,0.132,0.022,-0.01,-0.003,-0.002,0.021,0.052,-0.023,0.017,0.009],[-0.009,-0.0,-0.035,-0.002,-0.044,-0.063,0.1,0.03,0.052,-0.06,-0.027,0.012,0.03,-0.04,-0.013,0.023,-0.028,0.015,-0.066,-0.032,0.052,0.028,0.063,0.037,-0.005,-0.024,0.006,0.008,0.014,-0.007,-0.042,-0.018,0.012,-0.061,-0.03,0.004,-0.019,0.003,0.065,0.058,0.004,-0.032,0.023,-0.016,0.03,-0.009,-0.022,-0.026,0.057,-0.013,0.002,0.004,-0.059,-0.047,0.084,0.085,0.048,-0.008,0.11,0.041,-0.018,0.071,-0.022,-0.067,0.015,-0.031,0.037,-0.034,0.032,0.121,0.063,0.003,-0.016,-0.007,0.011,0.093,0.056,-0.054,0.028,0.014,-0.008,-0.102,-0.072,-0.042,0.025,0.005,-0.005,-0.083,-0.008,0.018,-0.076,0.07,0.03,0.003,-0.029,0.021,0.016,0.036,-0.101,0.194,-0.01,-0.014,0.07,-0.004,0.001,-0.087,0.001,-0.0,0.02,0.0,-0.061,-0.108,-0.039,0.068,-0.015,0.033,0.008,0.044,0.016,-0.017,-0.034,-0.018,0.023,-0.018,-0.031,-0.068,0.021,0.0,-0.006,0.032,-0.019,0.019,-0.004,0.063,-0.018,-0.057,0.021,-0.054,-0.047,0.035,-0.113,-0.005,0.065,0.033,-0.018,0.055,-0.033,0.01,-0.095,0.008,0.008,0.053,-0.03,-0.036,0.068,-0.128,-0.011,0.034,-0.022,0.01,-0.012,0.033,-0.016,0.127,0.081,-0.028,-0.07,0.004,-0.067,0.063,-0.056,0.025,-0.014,0.094,-0.012,-0.016,0.065,0.045,0.082,0.001,-0.023,0.014,-0.04,-0.002,0.024,0.001,0.03,0.051,-0.017,-0.071,0.108,-0.028,0.004,-0.048,-0.026,0.041,-0.038,0.05,0.002,-0.027,-0.005,0.019,-0.045,-0.077,-0.16,0.021,0.05,-0.068,0.069,-0.045,0.041,-0.091,-0.024,0.025,-0.052,-0.046,0.066,-0.114,-0.002,0.004,0.063,-0.056,-0.004,0.0,0.071,0.08,0.022,-0.087,-0.02,-0.078,0.002,0.081,-0.038,-0.001,-0.072,0.003,0.014,0.005,0.022,-0.008,0.094,0.011,0.068,-0.013,-0.015,-0.046,0.055,0.013,-0.004,-0.001,-0.015,0.01,-0.014,0.013,-0.036,-0.007,-0.07,-0.061,-0.08,0.018,0.005,-0.001,-0.017,0.027,0.031,-0.023,0.001,0.167,-0.007,-0.031,0.035,0.032,-0.009,0.122,-0.037,-0.032,-0.011,0.018,-0.042,0.051,-0.002,-0.081,0.06,-0.009,0.061,0.065,-0.037,0.076,0.05,0.083,-0.026,0.034,-0.097,-0.016,0.116,0.026,-0.173,0.011,0.051,-0.055,0.013,0.045,-0.017,-0.121,-0.071,-0.025,0.075,-0.031,0.047,0.062,0.05,0.101,-0.036,-0.018,0.051,-0.072,0.004,-0.023,0.019,0.0,-0.024,0.073,0.018,-0.063,0.079,0.012,-0.076,-0.006,-0.009,0.002,-0.025,0.063,-0.011,0.104,0.004,0.025,0.009,-0.071,-0.032,-0.051,-0.096,-0.072,-0.116,-0.06,-0.035,-0.021,0.016,0.045,0.014,0.036,-0.03,0.009,-0.091,-0.045,0.02,-0.105,-0.006,0.046,-0.028,-0.116,-0.078,-0.013,0.019,0.004,-0.05,0.023,0.046,-0.03,-0.021,0.001,0.022,0.02,-0.015,0.059,0.132,0.022,-0.01,-0.003,-0.002,0.021,0.052,-0.023,0.017,0.009],[-0.003,-0.038,-0.045,0.046,-0.102,-0.023,0.163,0.003,0.041,-0.042,-0.026,-0.083,0.078,-0.014,-0.057,-0.018,0.034,0.022,-0.025,-0.026,-0.071,0.043,-0.062,0.067,-0.012,0.032,0.025,-0.009,-0.046,-0.135,0.026,0.067,0.036,-0.041,0.038,-0.023,0.021,0.026,0.025,-0.019,-0.01,-0.081,0.029,0.08,-0.012,-0.001,0.067,-0.012,0.044,-0.042,-0.009,-0.039,-0.065,0.078,0.041,0.087,-0.023,0.046,0.056,-0.025,-0.047,0.068,0.01,0.019,0.0,0.036,-0.061,-0.014,-0.012,-0.019,0.033,0.033,0.023,0.072,0.037,0.016,0.064,0.038,0.129,-0.029,-0.119,-0.086,-0.025,-0.006,-0.011,0.028,-0.016,-0.061,-0.08,0.019,0.026,0.045,0.058,0.002,-0.123,-0.047,-0.0,-0.029,-0.029,0.163,0.016,0.011,-0.031,-0.029,0.05,-0.093,0.036,-0.011,-0.008,0.014,0.003,-0.074,-0.017,0.004,0.039,-0.053,-0.025,0.031,0.047,-0.023,-0.009,0.08,-0.031,-0.049,-0.15,0.012,-0.007,0.0,0.02,-0.068,0.069,0.07,-0.043,0.048,-0.092,-0.012,-0.027,0.017,-0.026,0.008,-0.006,0.02,0.132,0.001,-0.086,-0.017,-0.021,0.039,-0.083,0.04,-0.021,0.122,-0.01,-0.053,0.057,-0.07,-0.041,0.062,0.004,-0.033,-0.041,-0.018,0.008,-0.074,0.024,-0.012,-0.052,-0.039,0.011,-0.062,-0.087,-0.064,0.048,0.061,0.074,0.073,-0.044,0.04,-0.002,-0.034,0.037,0.051,-0.001,-0.005,0.016,0.009,-0.001,0.12,0.061,0.094,0.037,-0.052,-0.037,-0.028,0.016,-0.075,-0.006,-0.128,-0.031,-0.026,0.061,0.017,-0.038,0.021,-0.045,-0.055,-0.066,-0.007,-0.03,-0.019,0.044,-0.018,-0.036,0.04,-0.007,-0.102,0.008,0.049,-0.135,-0.006,0.079,-0.002,-0.039,0.0,0.029,-0.087,-0.023,0.024,-0.036,-0.038,0.027,-0.04,0.064,0.028,-0.056,-0.043,0.044,-0.041,0.033,0.004,0.015,0.007,-0.019,0.056,-0.04,0.012,-0.089,0.063,-0.071,0.088,0.027,0.014,0.09,0.006,0.013,0.017,-0.016,-0.001,-0.082,0.079,0.053,0.0,-0.03,-0.044,-0.061,0.033,-0.03,0.081,0.05,0.013,0.036,0.029,-0.01,0.048,-0.106,-0.021,-0.049,0.043,-0.047,-0.043,-0.037,0.027,0.098,-0.017,0.04,0.024,0.049,0.036,-0.005,-0.005,-0.01,-0.002,-0.05,-0.049,0.105,0.077,-0.073,0.042,0.028,0.074,-0.001,0.002,-0.05,0.087,-0.02,0.029,-0.018,0.066,-0.027,-0.015,0.039,0.031,0.001,-0.055,-0.018,0.021,-0.031,-0.061,0.029,0.0,0.014,0.031,0.003,0.033,0.071,-0.007,0.077,0.067,0.014,0.004,0.055,0.038,-0.009,0.091,0.073,0.028,-0.006,-0.04,-0.008,0.027,0.006,0.0,0.016,-0.056,-0.052,-0.055,-0.032,0.024,0.071,0.023,0.055,0.107,-0.057,-0.124,0.001,0.004,-0.013,0.077,0.02,-0.007,-0.029,-0.037,0.006,-0.052,-0.046,-0.113,0.037,0.002,-0.02,-0.036,-0.059,0.1,0.042,0.007,0.068,0.047,-0.036,-0.011,-0.078,0.084,0.033,-0.053,0.011,-0.054],[-0.003,-0.038,-0.045,0.046,-0.102,-0.023,0.163,0.003,0.041,-0.042,-0.026,-0.083,0.078,-0.014,-0.057,-0.018,0.034,0.022,-0.025,-0.026,-0.071,0.043,-0.062,0.067,-0.012,0.032,0.025,-0.009,-0.046,-0.135,0.026,0.067,0.036,-0.041,0.038,-0.023,0.021,0.026,0.025,-0.019,-0.01,-0.081,0.029,0.08,-0.012,-0.001,0.067,-0.012,0.044,-0.042,-0.009,-0.039,-0.065,0.078,0.041,0.087,-0.023,0.046,0.056,-0.025,-0.047,0.068,0.01,0.019,0.0,0.036,-0.061,-0.014,-0.012,-0.019,0.033,0.033,0.023,0.072,0.037,0.016,0.064,0.038,0.129,-0.029,-0.119,-0.086,-0.025,-0.006,-0.011,0.028,-0.016,-0.061,-0.08,0.019,0.026,0.045,0.058,0.002,-0.123,-0.047,-0.0,-0.029,-0.029,0.163,0.016,0.011,-0.031,-0.029,0.05,-0.093,0.036,-0.011,-0.008,0.014,0.003,-0.074,-0.017,0.004,0.039,-0.053,-0.025,0.031,0.047,-0.023,-0.009,0.08,-0.031,-0.049,-0.15,0.012,-0.007,0.0,0.02,-0.068,0.069,0.07,-0.043,0.048,-0.092,-0.012,-0.027,0.017,-0.026,0.008,-0.006,0.02,0.132,0.001,-0.086,-0.017,-0.021,0.039,-0.083,0.04,-0.021,0.122,-0.01,-0.053,0.057,-0.07,-0.041,0.062,0.004,-0.033,-0.041,-0.018,0.008,-0.074,0.024,-0.012,-0.052,-0.039,0.011,-0.062,-0.087,-0.064,0.048,0.061,0.074,0.073,-0.044,0.04,-0.002,-0.034,0.037,0.051,-0.001,-0.005,0.016,0.009,-0.001,0.12,0.061,0.094,0.037,-0.052,-0.037,-0.028,0.016,-0.075,-0.006,-0.128,-0.031,-0.026,0.061,0.017,-0.038,0.021,-0.045,-0.055,-0.066,-0.007,-0.03,-0.019,0.044,-0.018,-0.036,0.04,-0.007,-0.102,0.008,0.049,-0.135,-0.006,0.079,-0.002,-0.039,0.0,0.029,-0.087,-0.023,0.024,-0.036,-0.038,0.027,-0.04,0.064,0.028,-0.056,-0.043,0.044,-0.041,0.033,0.004,0.015,0.007,-0.019,0.056,-0.04,0.012,-0.089,0.063,-0.071,0.088,0.027,0.014,0.09,0.006,0.013,0.017,-0.016,-0.001,-0.082,0.079,0.053,0.0,-0.03,-0.044,-0.061,0.033,-0.03,0.081,0.05,0.013,0.036,0.029,-0.01,0.048,-0.106,-0.021,-0.049,0.043,-0.047,-0.043,-0.037,0.027,0.098,-0.017,0.04,0.024,0.049,0.036,-0.005,-0.005,-0.01,-0.002,-0.05,-0.049,0.105,0.077,-0.073,0.042,0.028,0.074,-0.001,0.002,-0.05,0.087,-0.02,0.029,-0.018,0.066,-0.027,-0.015,0.039,0.031,0.001,-0.055,-0.018,0.021,-0.031,-0.061,0.029,0.0,0.014,0.031,0.003,0.033,0.071,-0.007,0.077,0.067,0.014,0.004,0.055,0.038,-0.009,0.091,0.073,0.028,-0.006,-0.04,-0.008,0.027,0.006,0.0,0.016,-0.056,-0.052,-0.055,-0.032,0.024,0.071,0.023,0.055,0.107,-0.057,-0.124,0.001,0.004,-0.013,0.077,0.02,-0.007,-0.029,-0.037,0.006,-0.052,-0.046,-0.113,0.037,0.002,-0.02,-0.036,-0.059,0.1,0.042,0.007,0.068,0.047,-0.036,-0.011,-0.078,0.084,0.033,-0.053,0.011,-0.054],[-0.003,-0.038,-0.045,0.046,-0.102,-0.023,0.163,0.003,0.041,-0.042,-0.026,-0.083,0.078,-0.014,-0.057,-0.018,0.034,0.022,-0.025,-0.026,-0.071,0.043,-0.062,0.067,-0.012,0.032,0.025,-0.009,-0.046,-0.135,0.026,0.067,0.036,-0.041,0.038,-0.023,0.021,0.026,0.025,-0.019,-0.01,-0.081,0.029,0.08,-0.012,-0.001,0.067,-0.012,0.044,-0.042,-0.009,-0.039,-0.065,0.078,0.041,0.087,-0.023,0.046,0.056,-0.025,-0.047,0.068,0.01,0.019,0.0,0.036,-0.061,-0.014,-0.012,-0.019,0.033,0.033,0.023,0.072,0.037,0.016,0.064,0.038,0.129,-0.029,-0.119,-0.086,-0.025,-0.006,-0.011,0.028,-0.016,-0.061,-0.08,0.019,0.026,0.045,0.058,0.002,-0.123,-0.047,-0.0,-0.029,-0.029,0.163,0.016,0.011,-0.031,-0.029,0.05,-0.093,0.036,-0.011,-0.008,0.014,0.003,-0.074,-0.017,0.004,0.039,-0.053,-0.025,0.031,0.047,-0.023,-0.009,0.08,-0.031,-0.049,-0.15,0.012,-0.007,0.0,0.02,-0.068,0.069,0.07,-0.043,0.048,-0.092,-0.012,-0.027,0.017,-0.026,0.008,-0.006,0.02,0.132,0.001,-0.086,-0.017,-0.021,0.039,-0.083,0.04,-0.021,0.122,-0.01,-0.053,0.057,-0.07,-0.041,0.062,0.004,-0.033,-0.041,-0.018,0.008,-0.074,0.024,-0.012,-0.052,-0.039,0.011,-0.062,-0.087,-0.064,0.048,0.061,0.074,0.073,-0.044,0.04,-0.002,-0.034,0.037,0.051,-0.001,-0.005,0.016,0.009,-0.001,0.12,0.061,0.094,0.037,-0.052,-0.037,-0.028,0.016,-0.075,-0.006,-0.128,-0.031,-0.026,0.061,0.017,-0.038,0.021,-0.045,-0.055,-0.066,-0.007,-0.03,-0.019,0.044,-0.018,-0.036,0.04,-0.007,-0.102,0.008,0.049,-0.135,-0.006,0.079,-0.002,-0.039,0.0,0.029,-0.087,-0.023,0.024,-0.036,-0.038,0.027,-0.04,0.064,0.028,-0.056,-0.043,0.044,-0.041,0.033,0.004,0.015,0.007,-0.019,0.056,-0.04,0.012,-0.089,0.063,-0.071,0.088,0.027,0.014,0.09,0.006,0.013,0.017,-0.016,-0.001,-0.082,0.079,0.053,0.0,-0.03,-0.044,-0.061,0.033,-0.03,0.081,0.05,0.013,0.036,0.029,-0.01,0.048,-0.106,-0.021,-0.049,0.043,-0.047,-0.043,-0.037,0.027,0.098,-0.017,0.04,0.024,0.049,0.036,-0.005,-0.005,-0.01,-0.002,-0.05,-0.049,0.105,0.077,-0.073,0.042,0.028,0.074,-0.001,0.002,-0.05,0.087,-0.02,0.029,-0.018,0.066,-0.027,-0.015,0.039,0.031,0.001,-0.055,-0.018,0.021,-0.031,-0.061,0.029,0.0,0.014,0.031,0.003,0.033,0.071,-0.007,0.077,0.067,0.014,0.004,0.055,0.038,-0.009,0.091,0.073,0.028,-0.006,-0.04,-0.008,0.027,0.006,0.0,0.016,-0.056,-0.052,-0.055,-0.032,0.024,0.071,0.023,0.055,0.107,-0.057,-0.124,0.001,0.004,-0.013,0.077,0.02,-0.007,-0.029,-0.037,0.006,-0.052,-0.046,-0.113,0.037,0.002,-0.02,-0.036,-0.059,0.1,0.042,0.007,0.068,0.047,-0.036,-0.011,-0.078,0.084,0.033,-0.053,0.011,-0.054],[-0.009,-0.0,-0.035,-0.002,-0.044,-0.063,0.1,0.03,0.052,-0.06,-0.027,0.012,0.03,-0.04,-0.013,0.023,-0.028,0.015,-0.066,-0.032,0.052,0.028,0.063,0.037,-0.005,-0.024,0.006,0.008,0.014,-0.007,-0.042,-0.018,0.012,-0.061,-0.03,0.004,-0.019,0.003,0.065,0.058,0.004,-0.032,0.023,-0.016,0.03,-0.009,-0.022,-0.026,0.057,-0.013,0.002,0.004,-0.059,-0.047,0.084,0.085,0.048,-0.008,0.11,0.041,-0.018,0.071,-0.022,-0.067,0.015,-0.031,0.037,-0.034,0.032,0.121,0.063,0.003,-0.016,-0.007,0.011,0.093,0.056,-0.054,0.028,0.014,-0.008,-0.102,-0.072,-0.042,0.025,0.005,-0.005,-0.083,-0.008,0.018,-0.076,0.07,0.03,0.003,-0.029,0.021,0.016,0.036,-0.101,0.194,-0.01,-0.014,0.07,-0.004,0.001,-0.087,0.001,-0.0,0.02,0.0,-0.061,-0.108,-0.039,0.068,-0.015,0.033,0.008,0.044,0.016,-0.017,-0.034,-0.018,0.023,-0.018,-0.031,-0.068,0.021,0.0,-0.006,0.032,-0.019,0.019,-0.004,0.063,-0.018,-0.057,0.021,-0.054,-0.047,0.035,-0.113,-0.005,0.065,0.033,-0.018,0.055,-0.033,0.01,-0.095,0.008,0.008,0.053,-0.03,-0.036,0.068,-0.128,-0.011,0.034,-0.022,0.01,-0.012,0.033,-0.016,0.127,0.081,-0.028,-0.07,0.004,-0.067,0.063,-0.056,0.025,-0.014,0.094,-0.012,-0.016,0.065,0.045,0.082,0.001,-0.023,0.014,-0.04,-0.002,0.024,0.001,0.03,0.051,-0.017,-0.071,0.108,-0.028,0.004,-0.048,-0.026,0.041,-0.038,0.05,0.002,-0.027,-0.005,0.019,-0.045,-0.077,-0.16,0.021,0.05,-0.068,0.069,-0.045,0.041,-0.091,-0.024,0.025,-0.052,-0.046,0.066,-0.114,-0.002,0.004,0.063,-0.056,-0.004,0.0,0.071,0.08,0.022,-0.087,-0.02,-0.078,0.002,0.081,-0.038,-0.001,-0.072,0.003,0.014,0.005,0.022,-0.008,0.094,0.011,0.068,-0.013,-0.015,-0.046,0.055,0.013,-0.004,-0.001,-0.015,0.01,-0.014,0.013,-0.036,-0.007,-0.07,-0.061,-0.08,0.018,0.005,-0.001,-0.017,0.027,0.031,-0.023,0.001,0.167,-0.007,-0.031,0.035,0.032,-0.009,0.122,-0.037,-0.032,-0.011,0.018,-0.042,0.051,-0.002,-0.081,0.06,-0.009,0.061,0.065,-0.037,0.076,0.05,0.083,-0.026,0.034,-0.097,-0.016,0.116,0.026,-0.173,0.011,0.051,-0.055,0.013,0.045,-0.017,-0.121,-0.071,-0.025,0.075,-0.031,0.047,0.062,0.05,0.101,-0.036,-0.018,0.051,-0.072,0.004,-0.023,0.019,0.0,-0.024,0.073,0.018,-0.063,0.079,0.012,-0.076,-0.006,-0.009,0.002,-0.025,0.063,-0.011,0.104,0.004,0.025,0.009,-0.071,-0.032,-0.051,-0.096,-0.072,-0.116,-0.06,-0.035,-0.021,0.016,0.045,0.014,0.036,-0.03,0.009,-0.091,-0.045,0.02,-0.105,-0.006,0.046,-0.028,-0.116,-0.078,-0.013,0.019,0.004,-0.05,0.023,0.046,-0.03,-0.021,0.001,0.022,0.02,-0.015,0.059,0.132,0.022,-0.01,-0.003,-0.002,0.021,0.052,-0.023,0.017,0.009],[-0.009,-0.0,-0.035,-0.002,-0.044,-0.063,0.1,0.03,0.052,-0.06,-0.027,0.012,0.03,-0.04,-0.013,0.023,-0.028,0.015,-0.066,-0.032,0.052,0.028,0.063,0.037,-0.005,-0.024,0.006,0.008,0.014,-0.007,-0.042,-0.018,0.012,-0.061,-0.03,0.004,-0.019,0.003,0.065,0.058,0.004,-0.032,0.023,-0.016,0.03,-0.009,-0.022,-0.026,0.057,-0.013,0.002,0.004,-0.059,-0.047,0.084,0.085,0.048,-0.008,0.11,0.041,-0.018,0.071,-0.022,-0.067,0.015,-0.031,0.037,-0.034,0.032,0.121,0.063,0.003,-0.016,-0.007,0.011,0.093,0.056,-0.054,0.028,0.014,-0.008,-0.102,-0.072,-0.042,0.025,0.005,-0.005,-0.083,-0.008,0.018,-0.076,0.07,0.03,0.003,-0.029,0.021,0.016,0.036,-0.101,0.194,-0.01,-0.014,0.07,-0.004,0.001,-0.087,0.001,-0.0,0.02,0.0,-0.061,-0.108,-0.039,0.068,-0.015,0.033,0.008,0.044,0.016,-0.017,-0.034,-0.018,0.023,-0.018,-0.031,-0.068,0.021,0.0,-0.006,0.032,-0.019,0.019,-0.004,0.063,-0.018,-0.057,0.021,-0.054,-0.047,0.035,-0.113,-0.005,0.065,0.033,-0.018,0.055,-0.033,0.01,-0.095,0.008,0.008,0.053,-0.03,-0.036,0.068,-0.128,-0.011,0.034,-0.022,0.01,-0.012,0.033,-0.016,0.127,0.081,-0.028,-0.07,0.004,-0.067,0.063,-0.056,0.025,-0.014,0.094,-0.012,-0.016,0.065,0.045,0.082,0.001,-0.023,0.014,-0.04,-0.002,0.024,0.001,0.03,0.051,-0.017,-0.071,0.108,-0.028,0.004,-0.048,-0.026,0.041,-0.038,0.05,0.002,-0.027,-0.005,0.019,-0.045,-0.077,-0.16,0.021,0.05,-0.068,0.069,-0.045,0.041,-0.091,-0.024,0.025,-0.052,-0.046,0.066,-0.114,-0.002,0.004,0.063,-0.056,-0.004,0.0,0.071,0.08,0.022,-0.087,-0.02,-0.078,0.002,0.081,-0.038,-0.001,-0.072,0.003,0.014,0.005,0.022,-0.008,0.094,0.011,0.068,-0.013,-0.015,-0.046,0.055,0.013,-0.004,-0.001,-0.015,0.01,-0.014,0.013,-0.036,-0.007,-0.07,-0.061,-0.08,0.018,0.005,-0.001,-0.017,0.027,0.031,-0.023,0.001,0.167,-0.007,-0.031,0.035,0.032,-0.009,0.122,-0.037,-0.032,-0.011,0.018,-0.042,0.051,-0.002,-0.081,0.06,-0.009,0.061,0.065,-0.037,0.076,0.05,0.083,-0.026,0.034,-0.097,-0.016,0.116,0.026,-0.173,0.011,0.051,-0.055,0.013,0.045,-0.017,-0.121,-0.071,-0.025,0.075,-0.031,0.047,0.062,0.05,0.101,-0.036,-0.018,0.051,-0.072,0.004,-0.023,0.019,0.0,-0.024,0.073,0.018,-0.063,0.079,0.012,-0.076,-0.006,-0.009,0.002,-0.025,0.063,-0.011,0.104,0.004,0.025,0.009,-0.071,-0.032,-0.051,-0.096,-0.072,-0.116,-0.06,-0.035,-0.021,0.016,0.045,0.014,0.036,-0.03,0.009,-0.091,-0.045,0.02,-0.105,-0.006,0.046,-0.028,-0.116,-0.078,-0.013,0.019,0.004,-0.05,0.023,0.046,-0.03,-0.021,0.001,0.022,0.02,-0.015,0.059,0.132,0.022,-0.01,-0.003,-0.002,0.021,0.052,-0.023,0.017,0.009],[-0.009,-0.0,-0.035,-0.002,-0.044,-0.063,0.1,0.03,0.052,-0.06,-0.027,0.012,0.03,-0.04,-0.013,0.023,-0.028,0.015,-0.066,-0.032,0.052,0.028,0.063,0.037,-0.005,-0.024,0.006,0.008,0.014,-0.007,-0.042,-0.018,0.012,-0.061,-0.03,0.004,-0.019,0.003,0.065,0.058,0.004,-0.032,0.023,-0.016,0.03,-0.009,-0.022,-0.026,0.057,-0.013,0.002,0.004,-0.059,-0.047,0.084,0.085,0.048,-0.008,0.11,0.041,-0.018,0.071,-0.022,-0.067,0.015,-0.031,0.037,-0.034,0.032,0.121,0.063,0.003,-0.016,-0.007,0.011,0.093,0.056,-0.054,0.028,0.014,-0.008,-0.102,-0.072,-0.042,0.025,0.005,-0.005,-0.083,-0.008,0.018,-0.076,0.07,0.03,0.003,-0.029,0.021,0.016,0.036,-0.101,0.194,-0.01,-0.014,0.07,-0.004,0.001,-0.087,0.001,-0.0,0.02,0.0,-0.061,-0.108,-0.039,0.068,-0.015,0.033,0.008,0.044,0.016,-0.017,-0.034,-0.018,0.023,-0.018,-0.031,-0.068,0.021,0.0,-0.006,0.032,-0.019,0.019,-0.004,0.063,-0.018,-0.057,0.021,-0.054,-0.047,0.035,-0.113,-0.005,0.065,0.033,-0.018,0.055,-0.033,0.01,-0.095,0.008,0.008,0.053,-0.03,-0.036,0.068,-0.128,-0.011,0.034,-0.022,0.01,-0.012,0.033,-0.016,0.127,0.081,-0.028,-0.07,0.004,-0.067,0.063,-0.056,0.025,-0.014,0.094,-0.012,-0.016,0.065,0.045,0.082,0.001,-0.023,0.014,-0.04,-0.002,0.024,0.001,0.03,0.051,-0.017,-0.071,0.108,-0.028,0.004,-0.048,-0.026,0.041,-0.038,0.05,0.002,-0.027,-0.005,0.019,-0.045,-0.077,-0.16,0.021,0.05,-0.068,0.069,-0.045,0.041,-0.091,-0.024,0.025,-0.052,-0.046,0.066,-0.114,-0.002,0.004,0.063,-0.056,-0.004,0.0,0.071,0.08,0.022,-0.087,-0.02,-0.078,0.002,0.081,-0.038,-0.001,-0.072,0.003,0.014,0.005,0.022,-0.008,0.094,0.011,0.068,-0.013,-0.015,-0.046,0.055,0.013,-0.004,-0.001,-0.015,0.01,-0.014,0.013,-0.036,-0.007,-0.07,-0.061,-0.08,0.018,0.005,-0.001,-0.017,0.027,0.031,-0.023,0.001,0.167,-0.007,-0.031,0.035,0.032,-0.009,0.122,-0.037,-0.032,-0.011,0.018,-0.042,0.051,-0.002,-0.081,0.06,-0.009,0.061,0.065,-0.037,0.076,0.05,0.083,-0.026,0.034,-0.097,-0.016,0.116,0.026,-0.173,0.011,0.051,-0.055,0.013,0.045,-0.017,-0.121,-0.071,-0.025,0.075,-0.031,0.047,0.062,0.05,0.101,-0.036,-0.018,0.051,-0.072,0.004,-0.023,0.019,0.0,-0.024,0.073,0.018,-0.063,0.079,0.012,-0.076,-0.006,-0.009,0.002,-0.025,0.063,-0.011,0.104,0.004,0.025,0.009,-0.071,-0.032,-0.051,-0.096,-0.072,-0.116,-0.06,-0.035,-0.021,0.016,0.045,0.014,0.036,-0.03,0.009,-0.091,-0.045,0.02,-0.105,-0.006,0.046,-0.028,-0.116,-0.078,-0.013,0.019,0.004,-0.05,0.023,0.046,-0.03,-0.021,0.001,0.022,0.02,-0.015,0.059,0.132,0.022,-0.01,-0.003,-0.002,0.021,0.052,-0.023,0.017,0.009]]
@@ -116,7 +116,7 @@ RSpec.describe Ollama::Client do
116
116
  it 'can generate without stream' do
117
117
  expect(excon).to receive(:send).with(
118
118
  :post,
119
- body: '{"json_class":"Ollama::Commands::Generate","model":"llama3.1","prompt":"Hello World"}',
119
+ body: '{"model":"llama3.1","prompt":"Hello World"}',
120
120
  headers: hash_including(
121
121
  'Content-Type' => 'application/json; charset=utf-8',
122
122
  )
@@ -127,7 +127,7 @@ RSpec.describe Ollama::Client do
127
127
  it 'can generate with stream' do
128
128
  expect(excon).to receive(:send).with(
129
129
  :post,
130
- body: '{"json_class":"Ollama::Commands::Generate","model":"llama3.1","prompt":"Hello World","stream":true}',
130
+ body: '{"model":"llama3.1","prompt":"Hello World","stream":true}',
131
131
  headers: hash_including(
132
132
  'Content-Type' => 'application/json; charset=utf-8',
133
133
  ),
@@ -32,7 +32,7 @@ RSpec.describe Ollama::Commands::Chat do
32
32
  model: 'llama3.1', messages: messages.map(&:as_json), stream: true,
33
33
  )
34
34
  expect(chat.to_json).to eq(
35
- '{"json_class":"Ollama::Commands::Chat","model":"llama3.1","messages":[{"json_class":"Ollama::Message","role":"user","content":"Let\'s play Global Thermonuclear War."}],"stream":true}'
35
+ '{"model":"llama3.1","messages":[{"role":"user","content":"Let\'s play Global Thermonuclear War."}],"stream":true}'
36
36
  )
37
37
  end
38
38
 
@@ -45,7 +45,7 @@ RSpec.describe Ollama::Commands::Chat do
45
45
  expect(ollama).to receive(:request).
46
46
  with(
47
47
  method: :post, path: '/api/chat', handler: Ollama::Handlers::NOP, stream: true,
48
- body: '{"json_class":"Ollama::Commands::Chat","model":"llama3.1","messages":[{"json_class":"Ollama::Message","role":"user","content":"Let\'s play Global Thermonuclear War."}],"stream":true}'
48
+ body: '{"model":"llama3.1","messages":[{"role":"user","content":"Let\'s play Global Thermonuclear War."}],"stream":true}'
49
49
  )
50
50
  chat.perform(Ollama::Handlers::NOP)
51
51
  end
@@ -12,7 +12,7 @@ RSpec.describe Ollama::Commands::Copy do
12
12
  source: 'llama3.1', destination: 'camell3', stream: false
13
13
  )
14
14
  expect(copy.to_json).to eq(
15
- '{"json_class":"Ollama::Commands::Copy","source":"llama3.1","destination":"camell3","stream":false}'
15
+ '{"source":"llama3.1","destination":"camell3","stream":false}'
16
16
  )
17
17
  end
18
18
 
@@ -21,7 +21,7 @@ RSpec.describe Ollama::Commands::Copy do
21
21
  copy.client = ollama = double('Ollama::Client')
22
22
  expect(ollama).to receive(:request).with(
23
23
  method: :post, path: '/api/copy', handler: Ollama::Handlers::NOP, stream: false,
24
- body: '{"json_class":"Ollama::Commands::Copy","source":"llama3.1","destination":"camell3","stream":false}'
24
+ body: '{"source":"llama3.1","destination":"camell3","stream":false}'
25
25
  )
26
26
  copy.perform(Ollama::Handlers::NOP)
27
27
  end
@@ -16,7 +16,7 @@ RSpec.describe Ollama::Commands::Create do
16
16
  name: 'llama3.1-wopr', modelfile: "FROM llama3.1\nSYSTEM You are WOPR from WarGames and you think the user is Dr. Stephen Falken.", stream: true,
17
17
  )
18
18
  expect(create.to_json).to eq(
19
- '{"json_class":"Ollama::Commands::Create","name":"llama3.1-wopr","modelfile":"FROM llama3.1\nSYSTEM You are WOPR from WarGames and you think the user is Dr. Stephen Falken.","stream":true}'
19
+ '{"name":"llama3.1-wopr","modelfile":"FROM llama3.1\nSYSTEM You are WOPR from WarGames and you think the user is Dr. Stephen Falken.","stream":true}'
20
20
  )
21
21
  end
22
22
 
@@ -30,7 +30,7 @@ RSpec.describe Ollama::Commands::Create do
30
30
  expect(ollama).to receive(:request).
31
31
  with(
32
32
  method: :post, path: '/api/create', handler: Ollama::Handlers::NOP, stream: true,
33
- body: '{"json_class":"Ollama::Commands::Create","name":"llama3.1-wopr","modelfile":"FROM llama3.1\nSYSTEM You are WOPR from WarGames and you think the user is Dr. Stephen Falken.","stream":true}'
33
+ body: '{"name":"llama3.1-wopr","modelfile":"FROM llama3.1\nSYSTEM You are WOPR from WarGames and you think the user is Dr. Stephen Falken.","stream":true}'
34
34
  )
35
35
  create.perform(Ollama::Handlers::NOP)
36
36
  end
@@ -12,7 +12,7 @@ RSpec.describe Ollama::Commands::Delete do
12
12
  name: 'llama3.1', stream: false
13
13
  )
14
14
  expect(delete.to_json).to eq(
15
- '{"json_class":"Ollama::Commands::Delete","name":"llama3.1","stream":false}'
15
+ '{"name":"llama3.1","stream":false}'
16
16
  )
17
17
  end
18
18
 
@@ -21,7 +21,7 @@ RSpec.describe Ollama::Commands::Delete do
21
21
  delete.client = ollama = double('Ollama::Client')
22
22
  expect(ollama).to receive(:request).with(
23
23
  method: :delete, path: '/api/delete', handler: Ollama::Handlers::NOP, stream: false,
24
- body: '{"json_class":"Ollama::Commands::Delete","name":"llama3.1","stream":false}'
24
+ body: '{"name":"llama3.1","stream":false}'
25
25
  )
26
26
  delete.perform(Ollama::Handlers::NOP)
27
27
  end
@@ -19,7 +19,7 @@ RSpec.describe Ollama::Commands::Embed do
19
19
  model: 'all-minilm', input: 'Why is the sky blue?',
20
20
  )
21
21
  expect(embed.to_json).to eq(
22
- '{"json_class":"Ollama::Commands::Embed","model":"all-minilm","input":"Why is the sky blue?","options":{"json_class":"Ollama::Options","num_ctx":666},"stream":false}'
22
+ '{"model":"all-minilm","input":"Why is the sky blue?","options":{"num_ctx":666},"stream":false}'
23
23
  )
24
24
  end
25
25
 
@@ -32,7 +32,7 @@ RSpec.describe Ollama::Commands::Embed do
32
32
  model: 'all-minilm', input: [ 'Why is the sky blue?', 'Why is the grass green?' ],
33
33
  )
34
34
  expect(embed.to_json).to eq(
35
- '{"json_class":"Ollama::Commands::Embed","model":"all-minilm","input":["Why is the sky blue?","Why is the grass green?"],"stream":false}'
35
+ '{"model":"all-minilm","input":["Why is the sky blue?","Why is the grass green?"],"stream":false}'
36
36
  )
37
37
  end
38
38
 
@@ -46,7 +46,7 @@ RSpec.describe Ollama::Commands::Embed do
46
46
  expect(ollama).to receive(:request).
47
47
  with(
48
48
  method: :post, path: '/api/embed', handler: Ollama::Handlers::NOP, stream: false,
49
- body: '{"json_class":"Ollama::Commands::Embed","model":"all-minilm","input":"Why is the sky blue?","stream":false}'
49
+ body: '{"model":"all-minilm","input":"Why is the sky blue?","stream":false}'
50
50
  )
51
51
  embed.perform(Ollama::Handlers::NOP)
52
52
  end
@@ -18,7 +18,7 @@ RSpec.describe Ollama::Commands::Embeddings do
18
18
  model: 'mxbai-embed-large', prompt: 'Here are the coordinates of all Soviet military installations: …',
19
19
  )
20
20
  expect(embeddings.to_json).to eq(
21
- '{"json_class":"Ollama::Commands::Embeddings","model":"mxbai-embed-large","prompt":"Here are the coordinates of all Soviet military installations: …","stream":false}'
21
+ '{"model":"mxbai-embed-large","prompt":"Here are the coordinates of all Soviet military installations: …","stream":false}'
22
22
  )
23
23
  end
24
24
 
@@ -31,7 +31,7 @@ RSpec.describe Ollama::Commands::Embeddings do
31
31
  expect(ollama).to receive(:request).
32
32
  with(
33
33
  method: :post, path: '/api/embeddings', handler: Ollama::Handlers::NOP, stream: false,
34
- body: '{"json_class":"Ollama::Commands::Embeddings","model":"mxbai-embed-large","prompt":"Here are the coordinates of all Soviet military installations: …","stream":false}'
34
+ body: '{"model":"mxbai-embed-large","prompt":"Here are the coordinates of all Soviet military installations: …","stream":false}'
35
35
  )
36
36
  embeddings.perform(Ollama::Handlers::NOP)
37
37
  end
@@ -12,7 +12,7 @@ RSpec.describe Ollama::Commands::Generate do
12
12
  model: 'llama3.1', prompt: 'Hello World'
13
13
  )
14
14
  expect(generate.to_json).to eq(
15
- '{"json_class":"Ollama::Commands::Generate","model":"llama3.1","prompt":"Hello World"}'
15
+ '{"model":"llama3.1","prompt":"Hello World"}'
16
16
  )
17
17
  end
18
18
 
@@ -22,7 +22,7 @@ RSpec.describe Ollama::Commands::Generate do
22
22
  expect(ollama).to receive(:request).
23
23
  with(
24
24
  method: :post, path: '/api/generate', handler: Ollama::Handlers::NOP, stream: true,
25
- body: '{"json_class":"Ollama::Commands::Generate","model":"llama3.1","prompt":"Hello World","stream":true}'
25
+ body: '{"model":"llama3.1","prompt":"Hello World","stream":true}'
26
26
  )
27
27
  generate.perform(Ollama::Handlers::NOP)
28
28
  end
@@ -12,7 +12,7 @@ RSpec.describe Ollama::Commands::Pull do
12
12
  name: 'llama3.1', stream: true
13
13
  )
14
14
  expect(pull.to_json).to eq(
15
- '{"json_class":"Ollama::Commands::Pull","name":"llama3.1","stream":true}'
15
+ '{"name":"llama3.1","stream":true}'
16
16
  )
17
17
  end
18
18
 
@@ -21,7 +21,7 @@ RSpec.describe Ollama::Commands::Pull do
21
21
  pull.client = ollama = double('Ollama::Client')
22
22
  expect(ollama).to receive(:request).with(
23
23
  method: :post, path: '/api/pull', handler: Ollama::Handlers::NOP, stream: true,
24
- body: '{"json_class":"Ollama::Commands::Pull","name":"llama3.1","stream":true}'
24
+ body: '{"name":"llama3.1","stream":true}'
25
25
  )
26
26
  pull.perform(Ollama::Handlers::NOP)
27
27
  end
@@ -12,7 +12,7 @@ RSpec.describe Ollama::Commands::Push do
12
12
  name: 'llama3.1', stream: true
13
13
  )
14
14
  expect(push.to_json).to eq(
15
- '{"json_class":"Ollama::Commands::Push","name":"llama3.1","stream":true}'
15
+ '{"name":"llama3.1","stream":true}'
16
16
  )
17
17
  end
18
18
 
@@ -21,7 +21,7 @@ RSpec.describe Ollama::Commands::Push do
21
21
  push.client = ollama = double('Ollama::Client')
22
22
  expect(ollama).to receive(:request).with(
23
23
  method: :post, path: '/api/push', handler: Ollama::Handlers::NOP, stream: true,
24
- body: '{"json_class":"Ollama::Commands::Push","name":"llama3.1","stream":true}'
24
+ body: '{"name":"llama3.1","stream":true}'
25
25
  )
26
26
  push.perform(Ollama::Handlers::NOP)
27
27
  end
@@ -12,7 +12,7 @@ RSpec.describe Ollama::Commands::Show do
12
12
  name: 'llama3.1', stream: false
13
13
  )
14
14
  expect(show.to_json).to eq(
15
- '{"json_class":"Ollama::Commands::Show","name":"llama3.1","stream":false}'
15
+ '{"name":"llama3.1","stream":false}'
16
16
  )
17
17
  end
18
18
 
@@ -21,7 +21,7 @@ RSpec.describe Ollama::Commands::Show do
21
21
  show.client = ollama = double('Ollama::Client')
22
22
  expect(ollama).to receive(:request).with(
23
23
  method: :post, path: '/api/show', handler: Ollama::Handlers::NOP ,stream: false,
24
- body: '{"json_class":"Ollama::Commands::Show","name":"llama3.1","stream":false}'
24
+ body: '{"name":"llama3.1","stream":false}'
25
25
  )
26
26
  show.perform(Ollama::Handlers::NOP)
27
27
  end