documentrix 0.6.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGES.md +15 -0
- data/documentrix.gemspec +4 -4
- data/lib/documentrix/documents/splitters/semantic.rb +3 -3
- data/lib/documentrix/documents.rb +3 -3
- data/lib/documentrix/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bd386c4c61e93a3c711116c94d8373b6051d43d46c7387ab86e46e139eaa8c5e
|
|
4
|
+
data.tar.gz: d4c490c4faf11f0785172cf8e2d70e53e92652edb59261f0579f6a11c3bf92a2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 6ccf9b47eeca82500116a7cacb370ba5f2981cc39815b11e7f05c1be826094c0a932ab6226a3436294941af9e63e3be7e1021061f3c4a3a9903422a9b19a9c3d
|
|
7
|
+
data.tar.gz: 2bd7415288c8a45291c669d7d7012d676770d967d4954184b309f84350e2b13dd741fea4b79130aa1f857aac288b9d4f083dee00b3011d54a15ee0a53c09672e
|
data/CHANGES.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changes
|
|
2
2
|
|
|
3
|
+
## 2026-09-12 v0.7.0
|
|
4
|
+
|
|
5
|
+
* `Documents#initialize`: Changed `model_options` default contract from
|
|
6
|
+
`Hash` to `#to_h` in YARD docs and normalized with `.to_h` on assignment to
|
|
7
|
+
ensure `@model_options` is always a `Hash`
|
|
8
|
+
* `Documents#fetch_embeddings`: Changed `options` keyword default from `nil`
|
|
9
|
+
to `{}` to avoid passing `nil` to `Ollama::Client#embed`
|
|
10
|
+
* `Splitters::Semantic#initialize`: Changed `model_options` default from
|
|
11
|
+
`nil` to `{}`, normalized with `.to_h` on assignment, and updated YARD type
|
|
12
|
+
from `[Hash, nil]` to `[#to_h]`
|
|
13
|
+
* Updated `rubygems_version` in `documentrix.gemspec` from **4.0.10** to
|
|
14
|
+
**4.0.17**
|
|
15
|
+
* Raised `gem_hadar` development dependency minimum version from **2.17.1**
|
|
16
|
+
to **2.18.0**
|
|
17
|
+
|
|
3
18
|
## 2026-06-17 v0.6.0
|
|
4
19
|
|
|
5
20
|
### Changed
|
data/documentrix.gemspec
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
|
2
|
-
# stub: documentrix 0.
|
|
2
|
+
# stub: documentrix 0.7.0 ruby lib
|
|
3
3
|
|
|
4
4
|
Gem::Specification.new do |s|
|
|
5
5
|
s.name = "documentrix".freeze
|
|
6
|
-
s.version = "0.
|
|
6
|
+
s.version = "0.7.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]
|
|
@@ -17,13 +17,13 @@ Gem::Specification.new do |s|
|
|
|
17
17
|
s.licenses = ["MIT".freeze]
|
|
18
18
|
s.rdoc_options = ["--title".freeze, "Documentrix - Ruby library for embedding vector database".freeze, "--main".freeze, "README.md".freeze]
|
|
19
19
|
s.required_ruby_version = Gem::Requirement.new(">= 3.1".freeze)
|
|
20
|
-
s.rubygems_version = "4.0.
|
|
20
|
+
s.rubygems_version = "4.0.17".freeze
|
|
21
21
|
s.summary = "Ruby library for embedding vector database".freeze
|
|
22
22
|
s.test_files = ["spec/documentrix/documents/cache/interface_spec.rb".freeze, "spec/documentrix/documents/cache/memory_cache_spec.rb".freeze, "spec/documentrix/documents/cache/redis_cache_spec.rb".freeze, "spec/documentrix/documents/cache/sqlite_cache_spec.rb".freeze, "spec/documentrix/documents/splitters/character_spec.rb".freeze, "spec/documentrix/documents/splitters/semantic_spec.rb".freeze, "spec/documents_spec.rb".freeze, "spec/spec_helper.rb".freeze, "spec/utils/colorize_texts_spec.rb".freeze, "spec/utils/digests_spec.rb".freeze, "spec/utils/tags_spec.rb".freeze]
|
|
23
23
|
|
|
24
24
|
s.specification_version = 4
|
|
25
25
|
|
|
26
|
-
s.add_development_dependency(%q<gem_hadar>.freeze, [">= 2.
|
|
26
|
+
s.add_development_dependency(%q<gem_hadar>.freeze, [">= 2.18.0".freeze])
|
|
27
27
|
s.add_development_dependency(%q<all_images>.freeze, ["~> 0.12".freeze])
|
|
28
28
|
s.add_development_dependency(%q<rspec>.freeze, ["~> 3.2".freeze])
|
|
29
29
|
s.add_development_dependency(%q<kramdown>.freeze, ["~> 2.0".freeze])
|
|
@@ -28,13 +28,13 @@ module Documentrix::Documents::Splitters
|
|
|
28
28
|
#
|
|
29
29
|
# @param ollama [Ollama::Client] the client used for generating embeddings
|
|
30
30
|
# @param model [String] the embedding model name
|
|
31
|
-
# @param model_options [
|
|
31
|
+
# @param model_options [#to_h] optional parameters passed to the embedding model
|
|
32
32
|
# @param separator [Regexp] the regex used to identify sentence boundaries
|
|
33
33
|
# @param chunk_size [Integer] the maximum character length of a resulting chunk
|
|
34
34
|
# @param force [Boolean] whether to force split chunks that exceed chunk_size (defaults to false)
|
|
35
|
-
def initialize(ollama:, model:, model_options:
|
|
35
|
+
def initialize(ollama:, model:, model_options: {}, separator: DEFAULT_SEPARATOR, chunk_size: 4096, force: false)
|
|
36
36
|
@ollama, @model, @model_options, @separator, @chunk_size, @force =
|
|
37
|
-
ollama, model, model_options, separator, chunk_size, force
|
|
37
|
+
ollama, model, model_options.to_h, separator, chunk_size, force
|
|
38
38
|
end
|
|
39
39
|
|
|
40
40
|
# Splits the given text into semantic chunks.
|
|
@@ -69,7 +69,7 @@ class Documentrix::Documents
|
|
|
69
69
|
#
|
|
70
70
|
# @param ollama [ Ollama::Client ] the client used for embedding
|
|
71
71
|
# @param model [ String ] the name of the model to use for embeddings
|
|
72
|
-
# @param model_options [
|
|
72
|
+
# @param model_options [ #to_h ] optional parameters for the model
|
|
73
73
|
# @param collection [ Symbol ] the default collection to use (defaults to :default)
|
|
74
74
|
# @param embedding_length [ Integer ] the length of the embeddings (defaults to 1024)
|
|
75
75
|
# @param cache [ Documentrix::Cache ] the cache to use for storing documents (defaults to MemoryCache)
|
|
@@ -80,7 +80,7 @@ class Documentrix::Documents
|
|
|
80
80
|
def initialize(ollama:, model:, model_options: nil, collection: nil, embedding_length: 1_024, cache: MemoryCache, database_filename: nil, redis_url: nil, debug: false, database_busy_timeout: 5000)
|
|
81
81
|
collection ||= default_collection
|
|
82
82
|
@ollama, @model, @model_options, @collection, @debug =
|
|
83
|
-
ollama, model, model_options, collection.to_sym, debug
|
|
83
|
+
ollama, model, model_options.to_h, collection.to_sym, debug
|
|
84
84
|
database_filename ||= ':memory:'
|
|
85
85
|
@cache = connect_cache(cache, redis_url, embedding_length, database_filename, database_busy_timeout)
|
|
86
86
|
end
|
|
@@ -486,7 +486,7 @@ class Documentrix::Documents
|
|
|
486
486
|
# @param options [ Hash ] optional parameters for the embedding process
|
|
487
487
|
#
|
|
488
488
|
# @return [ Array<Array<Float>> ] an array containing the embeddings for each input string
|
|
489
|
-
def fetch_embeddings(model:, input:, options:
|
|
489
|
+
def fetch_embeddings(model:, input:, options: {})
|
|
490
490
|
@ollama.embed(model:, input:, options:).embeddings
|
|
491
491
|
end
|
|
492
492
|
|
data/lib/documentrix/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: documentrix
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.7.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Florian Frank
|
|
@@ -15,14 +15,14 @@ dependencies:
|
|
|
15
15
|
requirements:
|
|
16
16
|
- - ">="
|
|
17
17
|
- !ruby/object:Gem::Version
|
|
18
|
-
version: 2.
|
|
18
|
+
version: 2.18.0
|
|
19
19
|
type: :development
|
|
20
20
|
prerelease: false
|
|
21
21
|
version_requirements: !ruby/object:Gem::Requirement
|
|
22
22
|
requirements:
|
|
23
23
|
- - ">="
|
|
24
24
|
- !ruby/object:Gem::Version
|
|
25
|
-
version: 2.
|
|
25
|
+
version: 2.18.0
|
|
26
26
|
- !ruby/object:Gem::Dependency
|
|
27
27
|
name: all_images
|
|
28
28
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -319,7 +319,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
319
319
|
- !ruby/object:Gem::Version
|
|
320
320
|
version: '0'
|
|
321
321
|
requirements: []
|
|
322
|
-
rubygems_version: 4.0.
|
|
322
|
+
rubygems_version: 4.0.17
|
|
323
323
|
specification_version: 4
|
|
324
324
|
summary: Ruby library for embedding vector database
|
|
325
325
|
test_files:
|