ollama-ruby 0.12.1 → 0.14.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (46) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +1 -0
  3. data/CHANGES.md +39 -0
  4. data/README.md +70 -144
  5. data/Rakefile +5 -17
  6. data/bin/ollama_cli +37 -6
  7. data/lib/ollama/client/command.rb +2 -2
  8. data/lib/ollama/dto.rb +4 -0
  9. data/lib/ollama/version.rb +1 -1
  10. data/lib/ollama.rb +0 -11
  11. data/ollama-ruby.gemspec +11 -22
  12. data/spec/ollama/message_spec.rb +9 -0
  13. metadata +25 -255
  14. data/bin/ollama_chat +0 -1248
  15. data/config/redis.conf +0 -5
  16. data/docker-compose.yml +0 -10
  17. data/lib/ollama/documents/cache/common.rb +0 -36
  18. data/lib/ollama/documents/cache/memory_cache.rb +0 -44
  19. data/lib/ollama/documents/cache/records.rb +0 -87
  20. data/lib/ollama/documents/cache/redis_backed_memory_cache.rb +0 -39
  21. data/lib/ollama/documents/cache/redis_cache.rb +0 -68
  22. data/lib/ollama/documents/cache/sqlite_cache.rb +0 -215
  23. data/lib/ollama/documents/splitters/character.rb +0 -72
  24. data/lib/ollama/documents/splitters/semantic.rb +0 -91
  25. data/lib/ollama/documents.rb +0 -184
  26. data/lib/ollama/utils/cache_fetcher.rb +0 -38
  27. data/lib/ollama/utils/chooser.rb +0 -52
  28. data/lib/ollama/utils/colorize_texts.rb +0 -65
  29. data/lib/ollama/utils/fetcher.rb +0 -175
  30. data/lib/ollama/utils/file_argument.rb +0 -34
  31. data/lib/ollama/utils/math.rb +0 -48
  32. data/lib/ollama/utils/tags.rb +0 -67
  33. data/spec/assets/embeddings.json +0 -1
  34. data/spec/assets/prompt.txt +0 -1
  35. data/spec/ollama/documents/cache/memory_cache_spec.rb +0 -97
  36. data/spec/ollama/documents/cache/redis_backed_memory_cache_spec.rb +0 -118
  37. data/spec/ollama/documents/cache/redis_cache_spec.rb +0 -121
  38. data/spec/ollama/documents/cache/sqlite_cache_spec.rb +0 -141
  39. data/spec/ollama/documents/splitters/character_spec.rb +0 -110
  40. data/spec/ollama/documents/splitters/semantic_spec.rb +0 -56
  41. data/spec/ollama/documents_spec.rb +0 -162
  42. data/spec/ollama/utils/cache_fetcher_spec.rb +0 -43
  43. data/spec/ollama/utils/colorize_texts_spec.rb +0 -13
  44. data/spec/ollama/utils/fetcher_spec.rb +0 -137
  45. data/spec/ollama/utils/file_argument_spec.rb +0 -17
  46. data/spec/ollama/utils/tags_spec.rb +0 -53
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b1a5d95ed76e20288199c655d7a48751f403db0228999a2703c50288a9f4816e
4
- data.tar.gz: '0727293192245719c82619e8cd71423f7e477dfef194504585d7a5f756c96cca'
3
+ metadata.gz: e85337f5e36db83bab1c64782948ca58193d888ca4cac057b9df4142977b3d1d
4
+ data.tar.gz: c0c5dec70d721ff530614382f22dfb400903f2a5086af1e63dd539578bd61194
5
5
  SHA512:
6
- metadata.gz: c6c9f7ba3da2ba8f87182ee7acc53536a8b30fcc227a467b7d1cae8dee14d8b7258ad3e97b7960d9a079cfa2d28b5a1dea2a5776a27a1119a7515f515d0f5c3e
7
- data.tar.gz: 753a7812dbf850e21f042f8cbccec96163f21c7766a6a54d552cc0de98ba0581133140b5be9f11ae55a5faf98ea71101e13280bc673dd3ee67f2c26945e4005f
6
+ metadata.gz: d68085b5c0fa5a2069260ca7da9af716bebdfe953a0318f95f93a9c718e7bc6d8f3f659117f1f3d2703c6212758caa55a1207040ec921ce97bfc6cb4da560384
7
+ data.tar.gz: 4255495ef2ddb5e221981f3d771e2e2513c5811f1d1179b1775c2fc08bba9dc80594e5366c9f58eaf6eeacfc0dc1cca99fbbece35f14b1145d19afbdbe6f3ee8
data/.yardopts ADDED
@@ -0,0 +1 @@
1
+ --markup markdown
data/CHANGES.md CHANGED
@@ -1,5 +1,44 @@
1
1
  # Changes
2
2
 
3
+ ## 2025-01-29 v0.14.0
4
+
5
+ * Removed `term-ansicolor`, `redis`, `mime-types`, `reverse_markdown`,
6
+ `complex_config`, `search_ui`, `amatch`, `pdf-reader`, and `logger`
7
+ dependencies from gemspec.
8
+ * Added `kramdown-ansi` dependency to gemspec.
9
+ * Moved `ollama_chat` executable to its own gem.
10
+ * Refactored Ollama library by removing no longer used utils files, and specs.
11
+ * Removed test prompt from spec/assets/prompt.txt file.
12
+ * Removed Redis configuration.
13
+ * Removed docker-compose.yml.
14
+ * Removed corpus from .gitignore.
15
+ * Updated Docker setup for Gem installation:
16
+ + Updated `.all_images.yml` to remove unnecessary `gem update --system` and
17
+ `gem install bundler` commands.
18
+ * Added new image configuration for **ruby:3.4-alpine** container:
19
+ + Update `.all_images.yml` to include `ruby:3.4-alpine` environment.
20
+ * Implemented equals method for Ollama::DTO and added tests for it:
21
+ + Added `==` method to `Ollama::DTO` class.
22
+ + Added two new specs to `message_spec.rb`:
23
+ - Test that a message is equal to itself using the `eq` matcher.
24
+ - Test that a message is not equal to its duplicate using the `equal` matcher.
25
+ * Simplified System Prompt Changer:
26
+ + Removed redundant variable assignments for `chosen` and `system`.
27
+ + Introduced a simple prompt selection logic when only one option is available.
28
+ + Added options to exit or create a new prompt in the chooser interface.
29
+ * Improvements to system prompt display:
30
+ + Added system prompt length display using **bold** formatting.
31
+ * Added new command to output current configuration:
32
+ + Added `/config` command to display current chat configuration in `ollama_chat.rb`
33
+ + Modified `display_chat_help` method to include `/config` option
34
+ + Implemented pager functionality for displaying large configurations.
35
+
36
+ ## 2024-12-07 v0.13.0
37
+
38
+ * Refactor: Extract documents database logic into separate gem `documentrix`.
39
+ * Updated dependencies in Rakefile
40
+ * Added `--markup markdown` to `.yardopts`
41
+
3
42
  ## 2024-11-27 v0.12.1
4
43
 
5
44
  * Added handling for empty links list:
data/README.md CHANGED
@@ -12,7 +12,7 @@ To install Ollama, you can use the following methods:
12
12
 
13
13
  1. Type
14
14
 
15
- ```
15
+ ```bash
16
16
  gem install ollama-ruby
17
17
  ```
18
18
 
@@ -20,7 +20,7 @@ in your terminal.
20
20
 
21
21
  1. Or add the line
22
22
 
23
- ```
23
+ ```bash
24
24
  gem 'ollama-ruby'
25
25
  ```
26
26
 
@@ -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 "ollama"
34
+ require 'ollama'
35
35
  include Ollama
36
36
 
37
37
  ollama = Client.new(base_url: 'http://localhost:11434')
@@ -48,8 +48,8 @@ This is an interactive console where you can try out the different commands
48
48
  provided by an `Ollama::Client` instance. For example, this command generates a
49
49
  response and displays it on the screen using the Markdown handler:
50
50
 
51
- ```
52
- $ ollama_console
51
+ ```bash
52
+ ollama_console
53
53
  Commands: chat,copy,create,delete,embeddings,generate,help,ps,pull,push,show,tags
54
54
  >> generate(model: 'llama3.1', stream: true, prompt: 'tell story w/ emoji and markdown', &Markdown)
55
55
  ```
@@ -312,159 +312,85 @@ For more generic errors an `Ollama::Errors::Error` is raised.
312
312
 
313
313
  ## Other executables
314
314
 
315
- ### ollama\_chat
315
+ ### ollama\_cli
316
316
 
317
- This a chat client, that can be used to connect to an ollama server and enter a
318
- chat converstation with a LLM. It can be called with the following arguments:
317
+ The `ollama_cli` executable is a command-line interface for interacting with
318
+ the Ollama API. It allows users to generate text, and perform other tasks using
319
+ a variety of options.
319
320
 
320
- ```
321
- Usage: ollama_chat [OPTIONS]
322
-
323
- -f CONFIG config file to read
324
- -u URL the ollama base url, OLLAMA_URL
325
- -m MODEL the ollama model to chat with, OLLAMA_CHAT_MODEL
326
- -s SYSTEM the system prompt to use as a file, OLLAMA_CHAT_SYSTEM
327
- -c CHAT a saved chat conversation to load
328
- -C COLLECTION name of the collection used in this conversation
329
- -D DOCUMENT load document and add to embeddings collection (multiple)
330
- -M use (empty) MemoryCache for this chat session
331
- -E disable embeddings for this chat session
332
- -V display the current version number and quit
333
- -h this help
321
+ #### Usage
322
+
323
+ To use `ollama_cli`, simply run it from the command line and follow the usage
324
+ instructions:
325
+
326
+ ```bash
327
+ ollama_cli [OPTIONS]
334
328
  ```
335
329
 
336
- The base URL can be either set by the environment variable `OLLAMA_URL` or it
337
- is derived from the environment variable `OLLAMA_HOST`. The default model to
338
- connect can be configured in the environment variable `OLLAMA_MODEL`.
330
+ The available options are:
339
331
 
340
- The YAML config file in `$XDG_CONFIG_HOME/ollama_chat/config.yml`, that you can
341
- use for more complex settings, it looks like this:
332
+ * `-u URL`: The Ollama base URL. Can be set as an environment variable
333
+ `OLLAMA_URL`.
334
+ * `-m MODEL`: The Ollama model to chat with. Defaults to `llama3.1` if not
335
+ specified.
336
+ * `-M OPTIONS`: The Ollama model options to use. Can be set as an environment
337
+ variable `OLLAMA_MODEL_OPTIONS`.
338
+ * `-s SYSTEM`: The system prompt to use as a file. Can be set as an environment
339
+ variable `OLLAMA_SYSTEM`.
340
+ * `-p PROMPT`: The user prompt to use as a file. If it contains `%{stdin}`, it
341
+ will be substituted with the standard input. If not given, stdin will be used
342
+ as the prompt.
343
+ * `-P VARIABLE`: Sets a prompt variable, e.g. `foo=bar`. Can be used multiple
344
+ times.
345
+ * `-H HANDLER`: The handler to use for the response. Defaults to `Print`.
346
+ * `-S`: Use streaming for generation.
342
347
 
343
- ```
344
- ---
345
- url: <%= ENV['OLLAMA_URL'] || 'http://%s' % ENV.fetch('OLLAMA_HOST') %>
346
- model:
347
- name: <%= ENV.fetch('OLLAMA_CHAT_MODEL', 'llama3.1') %>
348
- options:
349
- num_ctx: 8192
350
- system: <%= ENV.fetch('OLLAMA_CHAT_SYSTEM', 'null') %>
351
- voice: Samantha
352
- markdown: true
353
- embedding:
354
- enabled: true
355
- model:
356
- name: mxbai-embed-large
357
- options: {}
358
- collection: <%= ENV.fetch('OLLAMA_CHAT_COLLECTION', 'ollama_chat') %>
359
- found_texts_size: 4096
360
- splitter:
361
- name: RecursiveCharacter
362
- chunk_size: 1024
363
- cache: Ollama::Documents::RedisCache
364
- redis:
365
- url: <%= ENV.fetch('REDIS_URL', 'null') %>
366
- debug: <%= ENV['OLLAMA_CHAT_DEBUG'].to_i == 1 ? true : false %>
367
- ```
348
+ #### Environment Variables
368
349
 
369
- If you want to store embeddings persistently, set an environment variable
370
- `REDIS_URL` or update the `redis.url` setting in your `config.yml` file to
371
- connect to a Redis server. Without this setup, embeddings will only be stored
372
- in process memory, which is less durable.
350
+ The following environment variables can be set to customize the behavior of
351
+ `ollama_cli`:
373
352
 
374
- Some settings can be passed as arguments as well, e. g. if you want to choose a
375
- specific system prompt:
353
+ * `OLLAMA_URL`: The Ollama base URL.
354
+ * `OLLAMA_MODEL`: The Ollama model to chat with.
355
+ * `OLLAMA_MODEL_OPTIONS`: The Ollama model options to use.
356
+ * `OLLAMA_SYSTEM`: The system prompt to use as a file.
357
+ * `OLLAMA_PROMPT`: The user prompt to use as a file.
376
358
 
377
- ```
378
- $ ollama_chat -s sherlock.txt
379
- Model with architecture llama found.
380
- Connecting to llama3.1@http://ollama.local.net:11434 now…
381
- Configured system prompt is:
382
- You are Sherlock Holmes and the user is your new client, Dr. Watson is also in
383
- the room. You will talk and act in the typical manner of Sherlock Holmes do and
384
- try to solve the user's case using logic and deduction.
385
-
386
- Type /help to display the chat help.
387
- 📨 user:
388
- Good morning.
389
- 📨 assistant:
390
- Ah, good morning, my dear fellow! It is a pleasure to make your acquaintance. I
391
- am Sherlock Holmes, the renowned detective, and this is my trusty sidekick, Dr.
392
- Watson. Please, have a seat and tell us about the nature of your visit. What
393
- seems to be the problem that has brought you to our humble abode at 221B Baker
394
- Street?
395
-
396
- (Watson nods in encouragement as he takes notes)
397
-
398
- Now, pray tell, what is it that puzzles you, my dear client? A missing item,
399
- perhaps? Or a mysterious occurrence that requires clarification? The game, as
400
- they say, is afoot!
401
- ```
359
+ #### Debug Mode
402
360
 
403
- This example shows how an image like this can be sent to a vision model for
404
- analysis:
361
+ If the `DEBUG` environment variable is set to `1`, `ollama_cli` will print out
362
+ the values of various variables, including the base URL, model, system prompt,
363
+ and options. This can be useful for debugging purposes.
405
364
 
406
- ![cat](spec/assets/kitten.jpg)
365
+ #### Handler Options
407
366
 
408
- ```
409
- $ ollama_chat -m llava-llama3
410
- Model with architecture llama found.
411
- Connecting to llava-llama3@http://localhost:11434 now…
412
- Type /help to display the chat help.
413
- 📸 user> What's on this image? ./spec/assets/kitten.jpg
414
- 📨 assistant:
415
- The image captures a moment of tranquility featuring a young cat. The cat,
416
- adorned with gray and white fur marked by black stripes on its face and legs,
417
- is the central figure in this scene. Its eyes, a striking shade of blue, are
418
- wide open and directed towards the camera, giving an impression of curiosity or
419
- alertness.
420
-
421
- The cat is comfortably nestled on a red blanket, which contrasts vividly with
422
- its fur. The blanket, soft and inviting, provides a sense of warmth to the
423
- image. In the background, partially obscured by the cat's head, is another
424
- blanket of similar red hue. The repetition of the color adds a sense of harmony
425
- to the composition.
426
-
427
- The cat's position on the right side of the photo creates an interesting
428
- asymmetry with the camera lens, which occupies the left side of the frame. This
429
- visual balance enhances the overall composition of the image.
430
-
431
- There are no discernible texts or other objects in the image. The focus is
432
- solely on the cat and its immediate surroundings. The image does not provide
433
- any information about the location or setting beyond what has been described.
434
- The simplicity of the scene allows the viewer to concentrate on the main
435
- subject - the young, blue-eyed cat.
436
- ```
367
+ The `-H` option specifies the handler to use for the response. The available
368
+ handlers are:
437
369
 
438
- The following commands can be given inside the chat, if prefixed by a `/`:
370
+ * `Print`: Prints the response to the console. This is the default.
371
+ * `Markdown`: Prints the response to the console as markdown.
372
+ * `DumpJSON`: Dumps all responses as JSON to the output.
373
+ * `DumpYAML`: Dumps all responses as YAML to the output.
374
+ * `Say`: Outputs the response with a voice.
439
375
 
376
+ #### Streaming
377
+
378
+ The `-S` option enables streaming for generation. This allows the model to
379
+ generate text in chunks, rather than waiting for the entire response to be
380
+ generated.
381
+
382
+ ### ollama\_chat
383
+
384
+ This is a chat client that allows you to connect to an Ollama server and engage
385
+ in conversations with Large Language Models (LLMs). It can be installed using
386
+ the following command:
387
+
388
+ ```bash
389
+ gem install ollama-chat
440
390
  ```
441
- /copy to copy last response to clipboard
442
- /paste to paste content
443
- /markdown toggle markdown output
444
- /stream toggle stream output
445
- /location toggle location submission
446
- /voice( change) toggle voice output or change the voice
447
- /list [n] list the last n / all conversation exchanges
448
- /clear clear the whole conversation
449
- /clobber clear the conversation and collection
450
- /pop [n] pop the last n exchanges, defaults to 1
451
- /model change the model
452
- /system change system prompt (clears conversation)
453
- /regenerate the last answer message
454
- /collection( clear|change) change (default) collection or clear
455
- /info show information for current session
456
- /document_policy pick a scan policy for document references
457
- /import source import the source's content
458
- /summarize [n] source summarize the source's content in n words
459
- /embedding toggle embedding paused or not
460
- /embed source embed the source's content
461
- /web [n] query query web search & return n or 1 results
462
- /links( clear) display (or clear) links used in the chat
463
- /save filename store conversation messages
464
- /load filename load conversation messages
465
- /quit to quit
466
- /help to view this help
467
- ```
391
+
392
+ Once installed, you can run `ollama_chat` from your terminal or command prompt.
393
+ This will launch a chat interface where you can interact with an LLM.
468
394
 
469
395
  ## Download
470
396
 
@@ -474,7 +400,7 @@ The homepage of this library is located at
474
400
 
475
401
  ## Author
476
402
 
477
- <b>Ollama Ruby</b> was written by Florian Frank [Florian Frank](mailto:flori@ping.de)
403
+ <b>Ollama Ruby</b> was written by [Florian Frank](mailto:flori@ping.de)
478
404
 
479
405
  ## License
480
406
 
data/Rakefile CHANGED
@@ -14,38 +14,26 @@ GemHadar do
14
14
  test_dir 'spec'
15
15
  ignore '.*.sw[pon]', 'pkg', 'Gemfile.lock', '.AppleDouble', '.bundle',
16
16
  '.yardoc', 'doc', 'tags', 'errors.lst', 'cscope.out', 'coverage', 'tmp',
17
- 'corpus', 'yard'
17
+ 'yard'
18
18
  package_ignore '.all_images.yml', '.tool-versions', '.gitignore', 'VERSION',
19
19
  '.rspec', *Dir.glob('.github/**/*', File::FNM_DOTMATCH)
20
20
  readme 'README.md'
21
21
 
22
- executables << 'ollama_console' << 'ollama_chat' <<
23
- 'ollama_update' << 'ollama_cli'
22
+ executables << 'ollama_console' << 'ollama_update' << 'ollama_cli'
24
23
 
25
24
  required_ruby_version '~> 3.1'
26
25
 
27
26
  dependency 'excon', '~> 1.0'
28
27
  dependency 'infobar', '~> 0.8'
29
- dependency 'term-ansicolor', '~> 1.11'
30
- dependency 'redis', '~> 5.0'
31
- dependency 'numo-narray', '~> 0.9'
32
- dependency 'more_math', '~> 1.1'
33
- dependency 'mime-types', '~> 3.0'
34
- dependency 'reverse_markdown', '~> 2.0'
35
- dependency 'complex_config', '~> 0.22', '>= 0.22.2'
36
- dependency 'search_ui', '~> 0.0'
37
- dependency 'amatch', '~> 0.4.1'
38
- dependency 'pdf-reader', '~> 2.0'
39
- dependency 'logger', '~> 1.0'
40
28
  dependency 'json', '~> 2.0'
41
- dependency 'xdg', '~> 7.0'
42
29
  dependency 'tins', '~> 1.34'
30
+ dependency 'term-ansicolor', '~> 1.11'
43
31
  dependency 'kramdown-ansi', '~> 0.0', '>= 0.0.1'
44
32
  dependency 'ostruct', '~> 0.0'
45
- dependency 'sqlite-vec', '~> 0.0'
46
- dependency 'sqlite3', '~> 2.0', '>= 2.0.1'
33
+ dependency 'documentrix', '~> 0.0'
47
34
  development_dependency 'all_images', '~> 0.6'
48
35
  development_dependency 'rspec', '~> 3.2'
36
+ development_dependency 'kramdown', '~> 2.0'
49
37
  development_dependency 'webmock'
50
38
  development_dependency 'debug'
51
39
  development_dependency 'simplecov'
data/bin/ollama_cli CHANGED
@@ -2,20 +2,51 @@
2
2
 
3
3
  require 'ollama'
4
4
  include Ollama
5
- include Ollama::Utils::FileArgument
6
5
  require 'tins'
7
6
  include Tins::GO
8
7
  require 'json'
9
8
 
9
+ # Returns the contents of a file or string, or a default value if neither is provided.
10
+ #
11
+ # @param [String] path_or_content The path to a file or a string containing
12
+ # the content.
13
+ #
14
+ # @param [String] default The default value to return if no valid input is
15
+ # given. Defaults to nil.
16
+ #
17
+ # @return [String] The contents of the file, the string, or the default value.
18
+ #
19
+ # @example Get the contents of a file
20
+ # get_file_argument('path/to/file')
21
+ #
22
+ # @example Use a string as content
23
+ # get_file_argument('string content')
24
+ #
25
+ # @example Return a default value if no valid input is given
26
+ # get_file_argument(nil, default: 'default content')
27
+ def get_file_argument(path_or_content, default: nil)
28
+ if path_or_content.present? && path_or_content.size < 2 ** 15 &&
29
+ File.basename(path_or_content).size < 2 ** 8 &&
30
+ File.exist?(path_or_content)
31
+ then
32
+ File.read(path_or_content)
33
+ elsif path_or_content.present?
34
+ path_or_content
35
+ else
36
+ default
37
+ end
38
+ end
39
+
40
+ # Outputs usage information for the `ollama_cli`.
10
41
  def usage
11
42
  puts <<~EOT
12
43
  Usage: #{File.basename($0)} [OPTIONS]
13
44
 
14
- -u URL the ollama base url, OLLAMA_URL
15
- -m MODEL the ollama model to chat with, OLLAMA_MODEL
16
- -M OPTIONS the ollama model options to use, OLLAMA_MODEL_OPTIONS
17
- -s SYSTEM the system prompt to use as a file, OLLAMA_SYSTEM
18
- -p PROMPT the user prompt to use as a file, OLLAMA_PROMPT
45
+ -u URL the ollama base url, $OLLAMA_URL
46
+ -m MODEL the ollama model to chat with, $OLLAMA_MODEL
47
+ -M OPTIONS the ollama model options to use, $OLLAMA_MODEL_OPTIONS
48
+ -s SYSTEM the system prompt to use as a file, $OLLAMA_SYSTEM
49
+ -p PROMPT the user prompt to use as a file, $OLLAMA_PROMPT
19
50
  if it contains %{stdin} it is substituted by stdin input
20
51
  -P VARIABLE sets prompt var %{foo} to "bar" if VARIABLE is foo=bar
21
52
  -H HANDLER the handler to use for the response, defaults to Print
@@ -2,8 +2,8 @@ module Ollama::Client::Command
2
2
  extend Tins::Concern
3
3
 
4
4
  module ClassMethods
5
- # Create Command +name+, if +stream+ was true, set stream_handler as
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/dto.rb CHANGED
@@ -31,6 +31,10 @@ module Ollama::DTO
31
31
  reject { _2.nil? || _2.ask_and_send(:size) == 0 }
32
32
  end
33
33
 
34
+ def ==(other)
35
+ as_json == other.as_json
36
+ end
37
+
34
38
  alias to_hash as_json
35
39
 
36
40
  def empty?
@@ -1,6 +1,6 @@
1
1
  module Ollama
2
2
  # Ollama version
3
- VERSION = '0.12.1'
3
+ VERSION = '0.14.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,5 +1,4 @@
1
1
  require 'json'
2
- require 'logger'
3
2
  require 'excon'
4
3
  require 'tins'
5
4
  require 'tins/xt/full'
@@ -14,15 +13,6 @@ module Ollama
14
13
  include Ollama::Handlers
15
14
  end
16
15
 
17
- module Ollama::Utils
18
- end
19
- require 'ollama/utils/tags'
20
- require 'ollama/utils/math'
21
- require 'ollama/utils/colorize_texts'
22
- require 'ollama/utils/fetcher'
23
- require 'ollama/utils/chooser'
24
- require 'ollama/utils/file_argument'
25
-
26
16
  require 'ollama/version'
27
17
  require 'ollama/errors'
28
18
  require 'ollama/dto'
@@ -34,7 +24,6 @@ require 'ollama/tool/function/parameters'
34
24
  require 'ollama/tool/function/parameters/property'
35
25
  require 'ollama/response'
36
26
  require 'ollama/options'
37
- require 'ollama/documents'
38
27
 
39
28
  class Ollama::Commands
40
29
  end
data/ollama-ruby.gemspec CHANGED
@@ -1,53 +1,42 @@
1
1
  # -*- encoding: utf-8 -*-
2
- # stub: ollama-ruby 0.12.1 ruby lib
2
+ # stub: ollama-ruby 0.14.0 ruby lib
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "ollama-ruby".freeze
6
- s.version = "0.12.1".freeze
6
+ s.version = "0.14.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-27"
11
+ s.date = "2025-01-29"
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, "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/documents.rb".freeze, "lib/ollama/documents/cache/common.rb".freeze, "lib/ollama/documents/cache/memory_cache.rb".freeze, "lib/ollama/documents/cache/records.rb".freeze, "lib/ollama/documents/cache/redis_backed_memory_cache.rb".freeze, "lib/ollama/documents/cache/redis_cache.rb".freeze, "lib/ollama/documents/cache/sqlite_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/cache_fetcher.rb".freeze, "lib/ollama/utils/chooser.rb".freeze, "lib/ollama/utils/colorize_texts.rb".freeze, "lib/ollama/utils/fetcher.rb".freeze, "lib/ollama/utils/file_argument.rb".freeze, "lib/ollama/utils/math.rb".freeze, "lib/ollama/utils/tags.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_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/documents.rb".freeze, "lib/ollama/documents/cache/common.rb".freeze, "lib/ollama/documents/cache/memory_cache.rb".freeze, "lib/ollama/documents/cache/records.rb".freeze, "lib/ollama/documents/cache/redis_backed_memory_cache.rb".freeze, "lib/ollama/documents/cache/redis_cache.rb".freeze, "lib/ollama/documents/cache/sqlite_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/cache_fetcher.rb".freeze, "lib/ollama/utils/chooser.rb".freeze, "lib/ollama/utils/colorize_texts.rb".freeze, "lib/ollama/utils/fetcher.rb".freeze, "lib/ollama/utils/file_argument.rb".freeze, "lib/ollama/utils/math.rb".freeze, "lib/ollama/utils/tags.rb".freeze, "lib/ollama/version.rb".freeze, "ollama-ruby.gemspec".freeze, "spec/assets/embeddings.json".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/documents/cache/memory_cache_spec.rb".freeze, "spec/ollama/documents/cache/redis_backed_memory_cache_spec.rb".freeze, "spec/ollama/documents/cache/redis_cache_spec.rb".freeze, "spec/ollama/documents/cache/sqlite_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/cache_fetcher_spec.rb".freeze, "spec/ollama/utils/colorize_texts_spec.rb".freeze, "spec/ollama/utils/fetcher_spec.rb".freeze, "spec/ollama/utils/file_argument_spec.rb".freeze, "spec/ollama/utils/tags_spec.rb".freeze, "spec/spec_helper.rb".freeze, "tmp/.keep".freeze]
14
+ s.executables = ["ollama_console".freeze, "ollama_update".freeze, "ollama_cli".freeze]
15
+ s.extra_rdoc_files = ["README.md".freeze, "lib/ollama.rb".freeze, "lib/ollama/client.rb".freeze, "lib/ollama/client/command.rb".freeze, "lib/ollama/client/doc.rb".freeze, "lib/ollama/commands/chat.rb".freeze, "lib/ollama/commands/copy.rb".freeze, "lib/ollama/commands/create.rb".freeze, "lib/ollama/commands/delete.rb".freeze, "lib/ollama/commands/embed.rb".freeze, "lib/ollama/commands/embeddings.rb".freeze, "lib/ollama/commands/generate.rb".freeze, "lib/ollama/commands/ps.rb".freeze, "lib/ollama/commands/pull.rb".freeze, "lib/ollama/commands/push.rb".freeze, "lib/ollama/commands/show.rb".freeze, "lib/ollama/commands/tags.rb".freeze, "lib/ollama/dto.rb".freeze, "lib/ollama/errors.rb".freeze, "lib/ollama/handlers.rb".freeze, "lib/ollama/handlers/collector.rb".freeze, "lib/ollama/handlers/concern.rb".freeze, "lib/ollama/handlers/dump_json.rb".freeze, "lib/ollama/handlers/dump_yaml.rb".freeze, "lib/ollama/handlers/markdown.rb".freeze, "lib/ollama/handlers/nop.rb".freeze, "lib/ollama/handlers/print.rb".freeze, "lib/ollama/handlers/progress.rb".freeze, "lib/ollama/handlers/say.rb".freeze, "lib/ollama/handlers/single.rb".freeze, "lib/ollama/image.rb".freeze, "lib/ollama/message.rb".freeze, "lib/ollama/options.rb".freeze, "lib/ollama/response.rb".freeze, "lib/ollama/tool.rb".freeze, "lib/ollama/tool/function.rb".freeze, "lib/ollama/tool/function/parameters.rb".freeze, "lib/ollama/tool/function/parameters/property.rb".freeze, "lib/ollama/version.rb".freeze]
16
+ s.files = [".envrc".freeze, ".yardopts".freeze, "CHANGES.md".freeze, "Gemfile".freeze, "LICENSE".freeze, "README.md".freeze, "Rakefile".freeze, "bin/ollama_cli".freeze, "bin/ollama_console".freeze, "bin/ollama_update".freeze, "lib/ollama.rb".freeze, "lib/ollama/client.rb".freeze, "lib/ollama/client/command.rb".freeze, "lib/ollama/client/doc.rb".freeze, "lib/ollama/commands/chat.rb".freeze, "lib/ollama/commands/copy.rb".freeze, "lib/ollama/commands/create.rb".freeze, "lib/ollama/commands/delete.rb".freeze, "lib/ollama/commands/embed.rb".freeze, "lib/ollama/commands/embeddings.rb".freeze, "lib/ollama/commands/generate.rb".freeze, "lib/ollama/commands/ps.rb".freeze, "lib/ollama/commands/pull.rb".freeze, "lib/ollama/commands/push.rb".freeze, "lib/ollama/commands/show.rb".freeze, "lib/ollama/commands/tags.rb".freeze, "lib/ollama/dto.rb".freeze, "lib/ollama/errors.rb".freeze, "lib/ollama/handlers.rb".freeze, "lib/ollama/handlers/collector.rb".freeze, "lib/ollama/handlers/concern.rb".freeze, "lib/ollama/handlers/dump_json.rb".freeze, "lib/ollama/handlers/dump_yaml.rb".freeze, "lib/ollama/handlers/markdown.rb".freeze, "lib/ollama/handlers/nop.rb".freeze, "lib/ollama/handlers/print.rb".freeze, "lib/ollama/handlers/progress.rb".freeze, "lib/ollama/handlers/say.rb".freeze, "lib/ollama/handlers/single.rb".freeze, "lib/ollama/image.rb".freeze, "lib/ollama/message.rb".freeze, "lib/ollama/options.rb".freeze, "lib/ollama/response.rb".freeze, "lib/ollama/tool.rb".freeze, "lib/ollama/tool/function.rb".freeze, "lib/ollama/tool/function/parameters.rb".freeze, "lib/ollama/tool/function/parameters/property.rb".freeze, "lib/ollama/version.rb".freeze, "ollama-ruby.gemspec".freeze, "spec/assets/kitten.jpg".freeze, "spec/ollama/client/doc_spec.rb".freeze, "spec/ollama/client_spec.rb".freeze, "spec/ollama/commands/chat_spec.rb".freeze, "spec/ollama/commands/copy_spec.rb".freeze, "spec/ollama/commands/create_spec.rb".freeze, "spec/ollama/commands/delete_spec.rb".freeze, "spec/ollama/commands/embed_spec.rb".freeze, "spec/ollama/commands/embeddings_spec.rb".freeze, "spec/ollama/commands/generate_spec.rb".freeze, "spec/ollama/commands/ps_spec.rb".freeze, "spec/ollama/commands/pull_spec.rb".freeze, "spec/ollama/commands/push_spec.rb".freeze, "spec/ollama/commands/show_spec.rb".freeze, "spec/ollama/commands/tags_spec.rb".freeze, "spec/ollama/handlers/collector_spec.rb".freeze, "spec/ollama/handlers/dump_json_spec.rb".freeze, "spec/ollama/handlers/dump_yaml_spec.rb".freeze, "spec/ollama/handlers/markdown_spec.rb".freeze, "spec/ollama/handlers/nop_spec.rb".freeze, "spec/ollama/handlers/print_spec.rb".freeze, "spec/ollama/handlers/progress_spec.rb".freeze, "spec/ollama/handlers/say_spec.rb".freeze, "spec/ollama/handlers/single_spec.rb".freeze, "spec/ollama/image_spec.rb".freeze, "spec/ollama/message_spec.rb".freeze, "spec/ollama/options_spec.rb".freeze, "spec/ollama/tool_spec.rb".freeze, "spec/spec_helper.rb".freeze, "tmp/.keep".freeze]
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.22".freeze
21
+ s.rubygems_version = "3.6.2".freeze
22
22
  s.summary = "Interacting with the Ollama API".freeze
23
- s.test_files = ["spec/ollama/client/doc_spec.rb".freeze, "spec/ollama/client_spec.rb".freeze, "spec/ollama/commands/chat_spec.rb".freeze, "spec/ollama/commands/copy_spec.rb".freeze, "spec/ollama/commands/create_spec.rb".freeze, "spec/ollama/commands/delete_spec.rb".freeze, "spec/ollama/commands/embed_spec.rb".freeze, "spec/ollama/commands/embeddings_spec.rb".freeze, "spec/ollama/commands/generate_spec.rb".freeze, "spec/ollama/commands/ps_spec.rb".freeze, "spec/ollama/commands/pull_spec.rb".freeze, "spec/ollama/commands/push_spec.rb".freeze, "spec/ollama/commands/show_spec.rb".freeze, "spec/ollama/commands/tags_spec.rb".freeze, "spec/ollama/documents/cache/memory_cache_spec.rb".freeze, "spec/ollama/documents/cache/redis_backed_memory_cache_spec.rb".freeze, "spec/ollama/documents/cache/redis_cache_spec.rb".freeze, "spec/ollama/documents/cache/sqlite_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/cache_fetcher_spec.rb".freeze, "spec/ollama/utils/colorize_texts_spec.rb".freeze, "spec/ollama/utils/fetcher_spec.rb".freeze, "spec/ollama/utils/file_argument_spec.rb".freeze, "spec/ollama/utils/tags_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/handlers/collector_spec.rb".freeze, "spec/ollama/handlers/dump_json_spec.rb".freeze, "spec/ollama/handlers/dump_yaml_spec.rb".freeze, "spec/ollama/handlers/markdown_spec.rb".freeze, "spec/ollama/handlers/nop_spec.rb".freeze, "spec/ollama/handlers/print_spec.rb".freeze, "spec/ollama/handlers/progress_spec.rb".freeze, "spec/ollama/handlers/say_spec.rb".freeze, "spec/ollama/handlers/single_spec.rb".freeze, "spec/ollama/image_spec.rb".freeze, "spec/ollama/message_spec.rb".freeze, "spec/ollama/options_spec.rb".freeze, "spec/ollama/tool_spec.rb".freeze, "spec/spec_helper.rb".freeze]
24
24
 
25
25
  s.specification_version = 4
26
26
 
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])
33
34
  s.add_runtime_dependency(%q<excon>.freeze, ["~> 1.0".freeze])
34
35
  s.add_runtime_dependency(%q<infobar>.freeze, ["~> 0.8".freeze])
35
- s.add_runtime_dependency(%q<term-ansicolor>.freeze, ["~> 1.11".freeze])
36
- 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
- s.add_runtime_dependency(%q<mime-types>.freeze, ["~> 3.0".freeze])
40
- s.add_runtime_dependency(%q<reverse_markdown>.freeze, ["~> 2.0".freeze])
41
- s.add_runtime_dependency(%q<complex_config>.freeze, ["~> 0.22".freeze, ">= 0.22.2".freeze])
42
- s.add_runtime_dependency(%q<search_ui>.freeze, ["~> 0.0".freeze])
43
- s.add_runtime_dependency(%q<amatch>.freeze, ["~> 0.4.1".freeze])
44
- s.add_runtime_dependency(%q<pdf-reader>.freeze, ["~> 2.0".freeze])
45
- s.add_runtime_dependency(%q<logger>.freeze, ["~> 1.0".freeze])
46
36
  s.add_runtime_dependency(%q<json>.freeze, ["~> 2.0".freeze])
47
- s.add_runtime_dependency(%q<xdg>.freeze, ["~> 7.0".freeze])
48
37
  s.add_runtime_dependency(%q<tins>.freeze, ["~> 1.34".freeze])
38
+ s.add_runtime_dependency(%q<term-ansicolor>.freeze, ["~> 1.11".freeze])
49
39
  s.add_runtime_dependency(%q<kramdown-ansi>.freeze, ["~> 0.0".freeze, ">= 0.0.1".freeze])
50
40
  s.add_runtime_dependency(%q<ostruct>.freeze, ["~> 0.0".freeze])
51
- s.add_runtime_dependency(%q<sqlite-vec>.freeze, ["~> 0.0".freeze])
52
- s.add_runtime_dependency(%q<sqlite3>.freeze, ["~> 2.0".freeze, ">= 2.0.1".freeze])
41
+ s.add_runtime_dependency(%q<documentrix>.freeze, ["~> 0.0".freeze])
53
42
  end
@@ -33,4 +33,13 @@ RSpec.describe Ollama::Message do
33
33
  {"role":"user","content":"hello world","images":["dGVzdA==\n"]}
34
34
  end
35
35
  end
36
+
37
+ it 'can be eq(ual) to itself' do
38
+ expect(message).to eq message
39
+ end
40
+
41
+ it 'can be eq(ual) to other message' do
42
+ expect(message).to eq message.dup
43
+ expect(message).not_to equal message.dup
44
+ end
36
45
  end