ollama-ruby 0.12.0 → 0.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +1 -0
- data/CHANGES.md +11 -0
- data/README.md +2 -2
- data/Rakefile +4 -5
- data/bin/ollama_chat +27 -21
- data/lib/ollama/client/command.rb +2 -2
- data/lib/ollama/version.rb +1 -1
- data/lib/ollama.rb +0 -4
- data/ollama-ruby.gemspec +11 -12
- metadata +26 -88
- data/lib/ollama/documents/cache/common.rb +0 -36
- data/lib/ollama/documents/cache/memory_cache.rb +0 -44
- data/lib/ollama/documents/cache/records.rb +0 -87
- data/lib/ollama/documents/cache/redis_backed_memory_cache.rb +0 -39
- data/lib/ollama/documents/cache/redis_cache.rb +0 -68
- data/lib/ollama/documents/cache/sqlite_cache.rb +0 -215
- data/lib/ollama/documents/splitters/character.rb +0 -72
- data/lib/ollama/documents/splitters/semantic.rb +0 -91
- data/lib/ollama/documents.rb +0 -184
- data/lib/ollama/utils/colorize_texts.rb +0 -65
- data/lib/ollama/utils/math.rb +0 -48
- data/lib/ollama/utils/tags.rb +0 -67
- data/spec/assets/embeddings.json +0 -1
- data/spec/ollama/documents/cache/memory_cache_spec.rb +0 -97
- data/spec/ollama/documents/cache/redis_backed_memory_cache_spec.rb +0 -118
- data/spec/ollama/documents/cache/redis_cache_spec.rb +0 -121
- data/spec/ollama/documents/cache/sqlite_cache_spec.rb +0 -141
- data/spec/ollama/documents/splitters/character_spec.rb +0 -110
- data/spec/ollama/documents/splitters/semantic_spec.rb +0 -56
- data/spec/ollama/documents_spec.rb +0 -162
- data/spec/ollama/utils/colorize_texts_spec.rb +0 -13
- data/spec/ollama/utils/tags_spec.rb +0 -53
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d7ec8e3eb645bcb195053ea275a2c124b66ab7633a31b9795462252ed4c5580e
|
4
|
+
data.tar.gz: b480ff0ff9cfad97a43e3131498df71c94ba855a1bc91ee2764fa06a53c84c58
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 71bc10942c4f0dc23e12501ea2928e2d5e05c73bbdf7b438cd3ebf259c5a07214bec6db1e3fbc80a6fef284b6e58daa96c7c3ee5af9084898fe0d186762fb330
|
7
|
+
data.tar.gz: d8d527588398323bb3f8f9172d0be22fa41e2aeeca7f1b5ce9aecc6be9981e13d9abd047b34ca1c13375d55de61f6be2e29449e2d86e3cb5f755cc7f84493b11
|
data/.yardopts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
--markup markdown
|
data/CHANGES.md
CHANGED
@@ -1,5 +1,16 @@
|
|
1
1
|
# Changes
|
2
2
|
|
3
|
+
## 2024-12-07 v0.13.0
|
4
|
+
|
5
|
+
* Refactor: Extract documents database logic into separate gem `documentrix`.
|
6
|
+
* Updated dependencies in Rakefile
|
7
|
+
* Added `--markup markdown` to `.yardopts`
|
8
|
+
|
9
|
+
## 2024-11-27 v0.12.1
|
10
|
+
|
11
|
+
* Added handling for empty links list:
|
12
|
+
+ If the list is empty, print a message indicating that the list is empty.
|
13
|
+
|
3
14
|
## 2024-11-26 v0.12.0
|
4
15
|
|
5
16
|
* **Upgrade display/clear links used in chat**:
|
data/README.md
CHANGED
@@ -31,7 +31,7 @@ to your Gemfile and run `bundle install` in your terminal.
|
|
31
31
|
In your own software the library can be used as shown in this example:
|
32
32
|
|
33
33
|
```ruby
|
34
|
-
require
|
34
|
+
require 'ollama'
|
35
35
|
include Ollama
|
36
36
|
|
37
37
|
ollama = Client.new(base_url: 'http://localhost:11434')
|
@@ -474,7 +474,7 @@ The homepage of this library is located at
|
|
474
474
|
|
475
475
|
## Author
|
476
476
|
|
477
|
-
<b>Ollama Ruby</b> was written by
|
477
|
+
<b>Ollama Ruby</b> was written by [Florian Frank](mailto:flori@ping.de)
|
478
478
|
|
479
479
|
## License
|
480
480
|
|
data/Rakefile
CHANGED
@@ -28,10 +28,8 @@ GemHadar do
|
|
28
28
|
dependency 'infobar', '~> 0.8'
|
29
29
|
dependency 'term-ansicolor', '~> 1.11'
|
30
30
|
dependency 'redis', '~> 5.0'
|
31
|
-
dependency 'numo-narray', '~> 0.9'
|
32
|
-
dependency 'more_math', '~> 1.1'
|
33
31
|
dependency 'mime-types', '~> 3.0'
|
34
|
-
dependency 'reverse_markdown', '~>
|
32
|
+
dependency 'reverse_markdown', '~> 3.0'
|
35
33
|
dependency 'complex_config', '~> 0.22', '>= 0.22.2'
|
36
34
|
dependency 'search_ui', '~> 0.0'
|
37
35
|
dependency 'amatch', '~> 0.4.1'
|
@@ -42,10 +40,11 @@ GemHadar do
|
|
42
40
|
dependency 'tins', '~> 1.34'
|
43
41
|
dependency 'kramdown-ansi', '~> 0.0', '>= 0.0.1'
|
44
42
|
dependency 'ostruct', '~> 0.0'
|
45
|
-
dependency '
|
46
|
-
dependency '
|
43
|
+
dependency 'rss', '~> 0.3'
|
44
|
+
dependency 'documentrix', '~> 0.0'
|
47
45
|
development_dependency 'all_images', '~> 0.6'
|
48
46
|
development_dependency 'rspec', '~> 3.2'
|
47
|
+
development_dependency 'kramdown', '~> 2.0'
|
49
48
|
development_dependency 'webmock'
|
50
49
|
development_dependency 'debug'
|
51
50
|
development_dependency 'simplecov'
|
data/bin/ollama_chat
CHANGED
@@ -15,6 +15,7 @@ require 'rss'
|
|
15
15
|
require 'pdf/reader'
|
16
16
|
require 'csv'
|
17
17
|
require 'xdg'
|
18
|
+
require 'documentrix'
|
18
19
|
|
19
20
|
class OllamaChatConfig
|
20
21
|
include ComplexConfig
|
@@ -69,7 +70,7 @@ class OllamaChatConfig
|
|
69
70
|
splitter:
|
70
71
|
name: RecursiveCharacter
|
71
72
|
chunk_size: 1024
|
72
|
-
cache: Ollama::Documents::
|
73
|
+
cache: Ollama::Documents::SQLiteCache
|
73
74
|
redis:
|
74
75
|
documents:
|
75
76
|
url: <%= ENV.fetch('REDIS_URL', 'null') %>
|
@@ -323,7 +324,7 @@ def search_web(query, n = nil)
|
|
323
324
|
n < 1 and n = 1
|
324
325
|
query = URI.encode_uri_component(query)
|
325
326
|
url = "https://www.duckduckgo.com/html/?q=#{query}"
|
326
|
-
Utils::Fetcher.get(url, debug: $config.debug) do |tmp|
|
327
|
+
Ollama::Utils::Fetcher.get(url, debug: $config.debug) do |tmp|
|
327
328
|
result = []
|
328
329
|
doc = Nokogiri::HTML(tmp)
|
329
330
|
doc.css('.results_links').each do |link|
|
@@ -520,7 +521,7 @@ def fetch_source(source, &block)
|
|
520
521
|
case source
|
521
522
|
when %r(\A!(.*))
|
522
523
|
command = $1
|
523
|
-
Utils::Fetcher.execute(command) do |tmp|
|
524
|
+
Ollama::Utils::Fetcher.execute(command) do |tmp|
|
524
525
|
block.(tmp)
|
525
526
|
end
|
526
527
|
when %r(\Ahttps?://\S+)
|
@@ -598,17 +599,17 @@ def embed_source(source_io, source, count: nil)
|
|
598
599
|
inputs = nil
|
599
600
|
case splitter_config.name
|
600
601
|
when 'Character'
|
601
|
-
splitter = Documents::Splitters::Character.new(
|
602
|
+
splitter = Documentrix::Documents::Splitters::Character.new(
|
602
603
|
chunk_size: splitter_config.chunk_size,
|
603
604
|
)
|
604
605
|
inputs = splitter.split(text)
|
605
606
|
when 'RecursiveCharacter'
|
606
|
-
splitter = Documents::Splitters::RecursiveCharacter.new(
|
607
|
+
splitter = Documentrix::Documents::Splitters::RecursiveCharacter.new(
|
607
608
|
chunk_size: splitter_config.chunk_size,
|
608
609
|
)
|
609
610
|
inputs = splitter.split(text)
|
610
611
|
when 'Semantic'
|
611
|
-
splitter = Documents::Splitters::Semantic.new(
|
612
|
+
splitter = Documentrix::Documents::Splitters::Semantic.new(
|
612
613
|
ollama:, model: $config.embedding.model.name,
|
613
614
|
chunk_size: splitter_config.chunk_size,
|
614
615
|
)
|
@@ -648,7 +649,7 @@ end
|
|
648
649
|
|
649
650
|
def parse_content(content, images)
|
650
651
|
images.clear
|
651
|
-
tags = Utils::Tags.new
|
652
|
+
tags = Documentrix::Utils::Tags.new
|
652
653
|
|
653
654
|
contents = [ content ]
|
654
655
|
content.scan(%r((https?://\S+)|(#\S+)|(?:file://)?(\S*\/\S+))).each do |url, tag, file|
|
@@ -695,7 +696,7 @@ end
|
|
695
696
|
def choose_model(cli_model, current_model)
|
696
697
|
models = ollama.tags.models.map(&:name).sort
|
697
698
|
model = if cli_model == ''
|
698
|
-
Utils::Chooser.choose(models) || current_model
|
699
|
+
Ollama::Utils::Chooser.choose(models) || current_model
|
699
700
|
else
|
700
701
|
cli_model || current_model
|
701
702
|
end
|
@@ -712,7 +713,7 @@ def choose_collection(current_collection)
|
|
712
713
|
collections = [ current_collection ] + $documents.collections
|
713
714
|
collections = collections.compact.map(&:to_s).uniq.sort
|
714
715
|
collections.unshift('[EXIT]').unshift('[NEW]')
|
715
|
-
collection = Utils::Chooser.choose(collections) || current_collection
|
716
|
+
collection = Ollama::Utils::Chooser.choose(collections) || current_collection
|
716
717
|
case collection
|
717
718
|
when '[NEW]'
|
718
719
|
$documents.collection = ask?(prompt: "Enter name of the new collection: ")
|
@@ -736,7 +737,7 @@ def choose_document_policy
|
|
736
737
|
policies.first
|
737
738
|
end
|
738
739
|
policies.unshift('[EXIT]')
|
739
|
-
policy = Utils::Chooser.choose(policies)
|
740
|
+
policy = Ollama::Utils::Chooser.choose(policies)
|
740
741
|
case policy
|
741
742
|
when nil, '[EXIT]'
|
742
743
|
puts "Exiting chooser."
|
@@ -760,13 +761,13 @@ end
|
|
760
761
|
|
761
762
|
def configure_cache
|
762
763
|
if $opts[?M]
|
763
|
-
Documents::MemoryCache
|
764
|
+
Documentrix::Documents::MemoryCache
|
764
765
|
else
|
765
766
|
Object.const_get($config.cache)
|
766
767
|
end
|
767
768
|
rescue => e
|
768
769
|
STDERR.puts "Caught #{e.class}: #{e} => Falling back to MemoryCache."
|
769
|
-
Documents::MemoryCache
|
770
|
+
Documentrix::Documents::MemoryCache
|
770
771
|
end
|
771
772
|
|
772
773
|
def show_system_prompt
|
@@ -797,7 +798,7 @@ end
|
|
797
798
|
def change_system_prompt(messages, default, system: nil)
|
798
799
|
selector = Regexp.new(system.to_s[1..-1].to_s)
|
799
800
|
prompts = $config.system_prompts.attribute_names.compact.grep(selector)
|
800
|
-
chosen = Utils::Chooser.choose(prompts, return_immediately: true)
|
801
|
+
chosen = Ollama::Utils::Chooser.choose(prompts, return_immediately: true)
|
801
802
|
system = if chosen
|
802
803
|
$config.system_prompts.send(chosen)
|
803
804
|
else
|
@@ -807,7 +808,7 @@ def change_system_prompt(messages, default, system: nil)
|
|
807
808
|
end
|
808
809
|
|
809
810
|
def change_voice
|
810
|
-
chosen = Utils::Chooser.choose($config.voice.list)
|
811
|
+
chosen = Ollama::Utils::Chooser.choose($config.voice.list)
|
811
812
|
$current_voice = chosen.full? || $config.voice.default
|
812
813
|
end
|
813
814
|
|
@@ -944,7 +945,7 @@ else
|
|
944
945
|
if $opts[?s] =~ /\A\?/
|
945
946
|
change_system_prompt(messages, default, system: $opts[?s])
|
946
947
|
else
|
947
|
-
system = Utils::FileArgument.get_file_argument($opts[?s], default:)
|
948
|
+
system = Ollama::Utils::FileArgument.get_file_argument($opts[?s], default:)
|
948
949
|
system.present? and set_system_prompt(messages, system)
|
949
950
|
end
|
950
951
|
end
|
@@ -954,7 +955,7 @@ if $embedding.on?
|
|
954
955
|
$embedding_model_options = Options[$config.embedding.model.options]
|
955
956
|
pull_model_unless_present($embedding_model, $embedding_model_options)
|
956
957
|
collection = $opts[?C] || $config.embedding.collection
|
957
|
-
$documents = Documents.new(
|
958
|
+
$documents = Documentrix::Documents.new(
|
958
959
|
ollama:,
|
959
960
|
model: $embedding_model,
|
960
961
|
model_options: $config.embedding.model.options,
|
@@ -995,7 +996,7 @@ else
|
|
995
996
|
end
|
996
997
|
|
997
998
|
if redis_expiring_url = $config.redis.expiring.url?
|
998
|
-
$cache = Documents::RedisCache.new(
|
999
|
+
$cache = Documentrix::Documents::RedisCache.new(
|
999
1000
|
prefix: 'Expiring-',
|
1000
1001
|
url: redis_expiring_url,
|
1001
1002
|
ex: $config.redis.expiring.ex,
|
@@ -1174,9 +1175,14 @@ loop do
|
|
1174
1175
|
end
|
1175
1176
|
end
|
1176
1177
|
when nil
|
1177
|
-
|
1178
|
-
|
1179
|
-
|
1178
|
+
if $links.empty?
|
1179
|
+
puts "List is empty."
|
1180
|
+
else
|
1181
|
+
Math.log10($links.size).ceil
|
1182
|
+
format = "% #{}s. %s"
|
1183
|
+
connect = -> link { hyperlink(link) { link } }
|
1184
|
+
puts $links.each_with_index.map { |x, i| format % [ i + 1, connect.(x) ] }
|
1185
|
+
end
|
1180
1186
|
end
|
1181
1187
|
next
|
1182
1188
|
when %r(^/load\s+(.+)$)
|
@@ -1200,7 +1206,7 @@ loop do
|
|
1200
1206
|
content, tags = if parse_content
|
1201
1207
|
parse_content(content, images)
|
1202
1208
|
else
|
1203
|
-
[ content, Utils::Tags.new ]
|
1209
|
+
[ content, Documentrix::Utils::Tags.new ]
|
1204
1210
|
end
|
1205
1211
|
|
1206
1212
|
if $embedding.on? && content
|
@@ -2,8 +2,8 @@ module Ollama::Client::Command
|
|
2
2
|
extend Tins::Concern
|
3
3
|
|
4
4
|
module ClassMethods
|
5
|
-
# Create Command
|
6
|
-
# default, otherwise default_handler
|
5
|
+
# Create Command `name`, if `stream` was true, set `stream_handler` as
|
6
|
+
# default, otherwise `default_handler`.
|
7
7
|
def command(name, default_handler:, stream_handler: nil)
|
8
8
|
klass = Ollama::Commands.const_get(name.to_s.camelize)
|
9
9
|
doc Ollama::Client::Doc.new(name)
|
data/lib/ollama/version.rb
CHANGED
data/lib/ollama.rb
CHANGED
@@ -16,9 +16,6 @@ end
|
|
16
16
|
|
17
17
|
module Ollama::Utils
|
18
18
|
end
|
19
|
-
require 'ollama/utils/tags'
|
20
|
-
require 'ollama/utils/math'
|
21
|
-
require 'ollama/utils/colorize_texts'
|
22
19
|
require 'ollama/utils/fetcher'
|
23
20
|
require 'ollama/utils/chooser'
|
24
21
|
require 'ollama/utils/file_argument'
|
@@ -34,7 +31,6 @@ require 'ollama/tool/function/parameters'
|
|
34
31
|
require 'ollama/tool/function/parameters/property'
|
35
32
|
require 'ollama/response'
|
36
33
|
require 'ollama/options'
|
37
|
-
require 'ollama/documents'
|
38
34
|
|
39
35
|
class Ollama::Commands
|
40
36
|
end
|
data/ollama-ruby.gemspec
CHANGED
@@ -1,32 +1,33 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
# stub: ollama-ruby 0.
|
2
|
+
# stub: ollama-ruby 0.13.0 ruby lib
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "ollama-ruby".freeze
|
6
|
-
s.version = "0.
|
6
|
+
s.version = "0.13.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-
|
11
|
+
s.date = "2024-12-07"
|
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_chat".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/
|
16
|
-
s.files = [".envrc".freeze, "CHANGES.md".freeze, "Gemfile".freeze, "LICENSE".freeze, "README.md".freeze, "Rakefile".freeze, "bin/ollama_chat".freeze, "bin/ollama_cli".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/
|
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/cache_fetcher.rb".freeze, "lib/ollama/utils/chooser.rb".freeze, "lib/ollama/utils/fetcher.rb".freeze, "lib/ollama/utils/file_argument.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_chat".freeze, "bin/ollama_cli".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/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/cache_fetcher.rb".freeze, "lib/ollama/utils/chooser.rb".freeze, "lib/ollama/utils/fetcher.rb".freeze, "lib/ollama/utils/file_argument.rb".freeze, "lib/ollama/version.rb".freeze, "ollama-ruby.gemspec".freeze, "spec/assets/kitten.jpg".freeze, "spec/assets/prompt.txt".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/cache_fetcher_spec.rb".freeze, "spec/ollama/utils/fetcher_spec.rb".freeze, "spec/ollama/utils/file_argument_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.
|
21
|
+
s.rubygems_version = "3.5.23".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/
|
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/cache_fetcher_spec.rb".freeze, "spec/ollama/utils/fetcher_spec.rb".freeze, "spec/ollama/utils/file_argument_spec.rb".freeze, "spec/spec_helper.rb".freeze]
|
24
24
|
|
25
25
|
s.specification_version = 4
|
26
26
|
|
27
27
|
s.add_development_dependency(%q<gem_hadar>.freeze, ["~> 1.19".freeze])
|
28
28
|
s.add_development_dependency(%q<all_images>.freeze, ["~> 0.6".freeze])
|
29
29
|
s.add_development_dependency(%q<rspec>.freeze, ["~> 3.2".freeze])
|
30
|
+
s.add_development_dependency(%q<kramdown>.freeze, ["~> 2.0".freeze])
|
30
31
|
s.add_development_dependency(%q<webmock>.freeze, [">= 0".freeze])
|
31
32
|
s.add_development_dependency(%q<debug>.freeze, [">= 0".freeze])
|
32
33
|
s.add_development_dependency(%q<simplecov>.freeze, [">= 0".freeze])
|
@@ -34,10 +35,8 @@ Gem::Specification.new do |s|
|
|
34
35
|
s.add_runtime_dependency(%q<infobar>.freeze, ["~> 0.8".freeze])
|
35
36
|
s.add_runtime_dependency(%q<term-ansicolor>.freeze, ["~> 1.11".freeze])
|
36
37
|
s.add_runtime_dependency(%q<redis>.freeze, ["~> 5.0".freeze])
|
37
|
-
s.add_runtime_dependency(%q<numo-narray>.freeze, ["~> 0.9".freeze])
|
38
|
-
s.add_runtime_dependency(%q<more_math>.freeze, ["~> 1.1".freeze])
|
39
38
|
s.add_runtime_dependency(%q<mime-types>.freeze, ["~> 3.0".freeze])
|
40
|
-
s.add_runtime_dependency(%q<reverse_markdown>.freeze, ["~>
|
39
|
+
s.add_runtime_dependency(%q<reverse_markdown>.freeze, ["~> 3.0".freeze])
|
41
40
|
s.add_runtime_dependency(%q<complex_config>.freeze, ["~> 0.22".freeze, ">= 0.22.2".freeze])
|
42
41
|
s.add_runtime_dependency(%q<search_ui>.freeze, ["~> 0.0".freeze])
|
43
42
|
s.add_runtime_dependency(%q<amatch>.freeze, ["~> 0.4.1".freeze])
|
@@ -48,6 +47,6 @@ Gem::Specification.new do |s|
|
|
48
47
|
s.add_runtime_dependency(%q<tins>.freeze, ["~> 1.34".freeze])
|
49
48
|
s.add_runtime_dependency(%q<kramdown-ansi>.freeze, ["~> 0.0".freeze, ">= 0.0.1".freeze])
|
50
49
|
s.add_runtime_dependency(%q<ostruct>.freeze, ["~> 0.0".freeze])
|
51
|
-
s.add_runtime_dependency(%q<
|
52
|
-
s.add_runtime_dependency(%q<
|
50
|
+
s.add_runtime_dependency(%q<rss>.freeze, ["~> 0.3".freeze])
|
51
|
+
s.add_runtime_dependency(%q<documentrix>.freeze, ["~> 0.0".freeze])
|
53
52
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ollama-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.13.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Florian Frank
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-12-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gem_hadar
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '3.2'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: kramdown
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '2.0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '2.0'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: webmock
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -150,34 +164,6 @@ dependencies:
|
|
150
164
|
- - "~>"
|
151
165
|
- !ruby/object:Gem::Version
|
152
166
|
version: '5.0'
|
153
|
-
- !ruby/object:Gem::Dependency
|
154
|
-
name: numo-narray
|
155
|
-
requirement: !ruby/object:Gem::Requirement
|
156
|
-
requirements:
|
157
|
-
- - "~>"
|
158
|
-
- !ruby/object:Gem::Version
|
159
|
-
version: '0.9'
|
160
|
-
type: :runtime
|
161
|
-
prerelease: false
|
162
|
-
version_requirements: !ruby/object:Gem::Requirement
|
163
|
-
requirements:
|
164
|
-
- - "~>"
|
165
|
-
- !ruby/object:Gem::Version
|
166
|
-
version: '0.9'
|
167
|
-
- !ruby/object:Gem::Dependency
|
168
|
-
name: more_math
|
169
|
-
requirement: !ruby/object:Gem::Requirement
|
170
|
-
requirements:
|
171
|
-
- - "~>"
|
172
|
-
- !ruby/object:Gem::Version
|
173
|
-
version: '1.1'
|
174
|
-
type: :runtime
|
175
|
-
prerelease: false
|
176
|
-
version_requirements: !ruby/object:Gem::Requirement
|
177
|
-
requirements:
|
178
|
-
- - "~>"
|
179
|
-
- !ruby/object:Gem::Version
|
180
|
-
version: '1.1'
|
181
167
|
- !ruby/object:Gem::Dependency
|
182
168
|
name: mime-types
|
183
169
|
requirement: !ruby/object:Gem::Requirement
|
@@ -198,14 +184,14 @@ dependencies:
|
|
198
184
|
requirements:
|
199
185
|
- - "~>"
|
200
186
|
- !ruby/object:Gem::Version
|
201
|
-
version: '
|
187
|
+
version: '3.0'
|
202
188
|
type: :runtime
|
203
189
|
prerelease: false
|
204
190
|
version_requirements: !ruby/object:Gem::Requirement
|
205
191
|
requirements:
|
206
192
|
- - "~>"
|
207
193
|
- !ruby/object:Gem::Version
|
208
|
-
version: '
|
194
|
+
version: '3.0'
|
209
195
|
- !ruby/object:Gem::Dependency
|
210
196
|
name: complex_config
|
211
197
|
requirement: !ruby/object:Gem::Requirement
|
@@ -359,39 +345,33 @@ dependencies:
|
|
359
345
|
- !ruby/object:Gem::Version
|
360
346
|
version: '0.0'
|
361
347
|
- !ruby/object:Gem::Dependency
|
362
|
-
name:
|
348
|
+
name: rss
|
363
349
|
requirement: !ruby/object:Gem::Requirement
|
364
350
|
requirements:
|
365
351
|
- - "~>"
|
366
352
|
- !ruby/object:Gem::Version
|
367
|
-
version: '0.
|
353
|
+
version: '0.3'
|
368
354
|
type: :runtime
|
369
355
|
prerelease: false
|
370
356
|
version_requirements: !ruby/object:Gem::Requirement
|
371
357
|
requirements:
|
372
358
|
- - "~>"
|
373
359
|
- !ruby/object:Gem::Version
|
374
|
-
version: '0.
|
360
|
+
version: '0.3'
|
375
361
|
- !ruby/object:Gem::Dependency
|
376
|
-
name:
|
362
|
+
name: documentrix
|
377
363
|
requirement: !ruby/object:Gem::Requirement
|
378
364
|
requirements:
|
379
365
|
- - "~>"
|
380
366
|
- !ruby/object:Gem::Version
|
381
|
-
version: '
|
382
|
-
- - ">="
|
383
|
-
- !ruby/object:Gem::Version
|
384
|
-
version: 2.0.1
|
367
|
+
version: '0.0'
|
385
368
|
type: :runtime
|
386
369
|
prerelease: false
|
387
370
|
version_requirements: !ruby/object:Gem::Requirement
|
388
371
|
requirements:
|
389
372
|
- - "~>"
|
390
373
|
- !ruby/object:Gem::Version
|
391
|
-
version: '
|
392
|
-
- - ">="
|
393
|
-
- !ruby/object:Gem::Version
|
394
|
-
version: 2.0.1
|
374
|
+
version: '0.0'
|
395
375
|
description: Library that allows interacting with the Ollama API
|
396
376
|
email: flori@ping.de
|
397
377
|
executables:
|
@@ -418,15 +398,6 @@ extra_rdoc_files:
|
|
418
398
|
- lib/ollama/commands/push.rb
|
419
399
|
- lib/ollama/commands/show.rb
|
420
400
|
- lib/ollama/commands/tags.rb
|
421
|
-
- lib/ollama/documents.rb
|
422
|
-
- lib/ollama/documents/cache/common.rb
|
423
|
-
- lib/ollama/documents/cache/memory_cache.rb
|
424
|
-
- lib/ollama/documents/cache/records.rb
|
425
|
-
- lib/ollama/documents/cache/redis_backed_memory_cache.rb
|
426
|
-
- lib/ollama/documents/cache/redis_cache.rb
|
427
|
-
- lib/ollama/documents/cache/sqlite_cache.rb
|
428
|
-
- lib/ollama/documents/splitters/character.rb
|
429
|
-
- lib/ollama/documents/splitters/semantic.rb
|
430
401
|
- lib/ollama/dto.rb
|
431
402
|
- lib/ollama/errors.rb
|
432
403
|
- lib/ollama/handlers.rb
|
@@ -450,14 +421,12 @@ extra_rdoc_files:
|
|
450
421
|
- lib/ollama/tool/function/parameters/property.rb
|
451
422
|
- lib/ollama/utils/cache_fetcher.rb
|
452
423
|
- lib/ollama/utils/chooser.rb
|
453
|
-
- lib/ollama/utils/colorize_texts.rb
|
454
424
|
- lib/ollama/utils/fetcher.rb
|
455
425
|
- lib/ollama/utils/file_argument.rb
|
456
|
-
- lib/ollama/utils/math.rb
|
457
|
-
- lib/ollama/utils/tags.rb
|
458
426
|
- lib/ollama/version.rb
|
459
427
|
files:
|
460
428
|
- ".envrc"
|
429
|
+
- ".yardopts"
|
461
430
|
- CHANGES.md
|
462
431
|
- Gemfile
|
463
432
|
- LICENSE
|
@@ -485,15 +454,6 @@ files:
|
|
485
454
|
- lib/ollama/commands/push.rb
|
486
455
|
- lib/ollama/commands/show.rb
|
487
456
|
- lib/ollama/commands/tags.rb
|
488
|
-
- lib/ollama/documents.rb
|
489
|
-
- lib/ollama/documents/cache/common.rb
|
490
|
-
- lib/ollama/documents/cache/memory_cache.rb
|
491
|
-
- lib/ollama/documents/cache/records.rb
|
492
|
-
- lib/ollama/documents/cache/redis_backed_memory_cache.rb
|
493
|
-
- lib/ollama/documents/cache/redis_cache.rb
|
494
|
-
- lib/ollama/documents/cache/sqlite_cache.rb
|
495
|
-
- lib/ollama/documents/splitters/character.rb
|
496
|
-
- lib/ollama/documents/splitters/semantic.rb
|
497
457
|
- lib/ollama/dto.rb
|
498
458
|
- lib/ollama/errors.rb
|
499
459
|
- lib/ollama/handlers.rb
|
@@ -517,14 +477,10 @@ files:
|
|
517
477
|
- lib/ollama/tool/function/parameters/property.rb
|
518
478
|
- lib/ollama/utils/cache_fetcher.rb
|
519
479
|
- lib/ollama/utils/chooser.rb
|
520
|
-
- lib/ollama/utils/colorize_texts.rb
|
521
480
|
- lib/ollama/utils/fetcher.rb
|
522
481
|
- lib/ollama/utils/file_argument.rb
|
523
|
-
- lib/ollama/utils/math.rb
|
524
|
-
- lib/ollama/utils/tags.rb
|
525
482
|
- lib/ollama/version.rb
|
526
483
|
- ollama-ruby.gemspec
|
527
|
-
- spec/assets/embeddings.json
|
528
484
|
- spec/assets/kitten.jpg
|
529
485
|
- spec/assets/prompt.txt
|
530
486
|
- spec/ollama/client/doc_spec.rb
|
@@ -541,13 +497,6 @@ files:
|
|
541
497
|
- spec/ollama/commands/push_spec.rb
|
542
498
|
- spec/ollama/commands/show_spec.rb
|
543
499
|
- spec/ollama/commands/tags_spec.rb
|
544
|
-
- spec/ollama/documents/cache/memory_cache_spec.rb
|
545
|
-
- spec/ollama/documents/cache/redis_backed_memory_cache_spec.rb
|
546
|
-
- spec/ollama/documents/cache/redis_cache_spec.rb
|
547
|
-
- spec/ollama/documents/cache/sqlite_cache_spec.rb
|
548
|
-
- spec/ollama/documents/splitters/character_spec.rb
|
549
|
-
- spec/ollama/documents/splitters/semantic_spec.rb
|
550
|
-
- spec/ollama/documents_spec.rb
|
551
500
|
- spec/ollama/handlers/collector_spec.rb
|
552
501
|
- spec/ollama/handlers/dump_json_spec.rb
|
553
502
|
- spec/ollama/handlers/dump_yaml_spec.rb
|
@@ -562,10 +511,8 @@ files:
|
|
562
511
|
- spec/ollama/options_spec.rb
|
563
512
|
- spec/ollama/tool_spec.rb
|
564
513
|
- spec/ollama/utils/cache_fetcher_spec.rb
|
565
|
-
- spec/ollama/utils/colorize_texts_spec.rb
|
566
514
|
- spec/ollama/utils/fetcher_spec.rb
|
567
515
|
- spec/ollama/utils/file_argument_spec.rb
|
568
|
-
- spec/ollama/utils/tags_spec.rb
|
569
516
|
- spec/spec_helper.rb
|
570
517
|
- tmp/.keep
|
571
518
|
homepage: https://github.com/flori/ollama-ruby
|
@@ -591,7 +538,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
591
538
|
- !ruby/object:Gem::Version
|
592
539
|
version: '0'
|
593
540
|
requirements: []
|
594
|
-
rubygems_version: 3.5.
|
541
|
+
rubygems_version: 3.5.23
|
595
542
|
signing_key:
|
596
543
|
specification_version: 4
|
597
544
|
summary: Interacting with the Ollama API
|
@@ -610,13 +557,6 @@ test_files:
|
|
610
557
|
- spec/ollama/commands/push_spec.rb
|
611
558
|
- spec/ollama/commands/show_spec.rb
|
612
559
|
- spec/ollama/commands/tags_spec.rb
|
613
|
-
- spec/ollama/documents/cache/memory_cache_spec.rb
|
614
|
-
- spec/ollama/documents/cache/redis_backed_memory_cache_spec.rb
|
615
|
-
- spec/ollama/documents/cache/redis_cache_spec.rb
|
616
|
-
- spec/ollama/documents/cache/sqlite_cache_spec.rb
|
617
|
-
- spec/ollama/documents/splitters/character_spec.rb
|
618
|
-
- spec/ollama/documents/splitters/semantic_spec.rb
|
619
|
-
- spec/ollama/documents_spec.rb
|
620
560
|
- spec/ollama/handlers/collector_spec.rb
|
621
561
|
- spec/ollama/handlers/dump_json_spec.rb
|
622
562
|
- spec/ollama/handlers/dump_yaml_spec.rb
|
@@ -631,8 +571,6 @@ test_files:
|
|
631
571
|
- spec/ollama/options_spec.rb
|
632
572
|
- spec/ollama/tool_spec.rb
|
633
573
|
- spec/ollama/utils/cache_fetcher_spec.rb
|
634
|
-
- spec/ollama/utils/colorize_texts_spec.rb
|
635
574
|
- spec/ollama/utils/fetcher_spec.rb
|
636
575
|
- spec/ollama/utils/file_argument_spec.rb
|
637
|
-
- spec/ollama/utils/tags_spec.rb
|
638
576
|
- spec/spec_helper.rb
|