chromable 0.3.1 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/chromable/version.rb +1 -1
- data/lib/chromable.rb +3 -5
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 30a53a0c8bde8c1d4c091e073058d6273d57cfd191cfeff0f4f48817e2bf14d4
|
4
|
+
data.tar.gz: 4374788d45a3acb8e491c452f862bb20bf5634dcfb483cf194d9c7090b349de7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2488713488c214ab53be05616da9ca3a7ee7e3c619c4627d3b338a1454680add7284b2fef6e84007285acc0f3830d24290f09024b5189241e3657bb9086cce17
|
7
|
+
data.tar.gz: bf63bb358eb179ae5ab7e02fcdeb88d1657d2d3009e28b3e3c5d7354a8bb0a7e387a09020920d8bc88cb03ad10fb18ac4d5f3ac8926a979094a0fa575340af2e
|
data/README.md
CHANGED
@@ -73,7 +73,7 @@ Post.query(
|
|
73
73
|
is_query: true # `is_query` here will be passed to `Post.embed` as an option.
|
74
74
|
)
|
75
75
|
|
76
|
-
Post.first.neighbors(results: 20) # => [#<Post:0x0000ffff9e0b5f10 id: "0beb0f98, ...>, ...]
|
76
|
+
Post.first.neighbors(results: 20) # => [#<Post:0x0000ffff9e0b5f10 id: "0beb0f98...", ...>, ...]
|
77
77
|
```
|
78
78
|
|
79
79
|
Also, `chromable` provides the following methods for each model instance:
|
data/lib/chromable/version.rb
CHANGED
data/lib/chromable.rb
CHANGED
@@ -56,8 +56,7 @@ module Chromable
|
|
56
56
|
query_embeddings: [send(chromable_settings.embedder, text, **embedder_options)],
|
57
57
|
results: results,
|
58
58
|
where: where,
|
59
|
-
where_document: where_document
|
60
|
-
include: include
|
59
|
+
where_document: where_document
|
61
60
|
).map(&:id))
|
62
61
|
end
|
63
62
|
end
|
@@ -96,8 +95,7 @@ module Chromable
|
|
96
95
|
query_embeddings: [embedding],
|
97
96
|
results: results,
|
98
97
|
where: where,
|
99
|
-
where_document: where_document
|
100
|
-
include: include
|
98
|
+
where_document: where_document
|
101
99
|
).map(&:id))
|
102
100
|
end
|
103
101
|
|
@@ -105,7 +103,7 @@ module Chromable
|
|
105
103
|
|
106
104
|
def build_embedding
|
107
105
|
Chroma::Resources::Embedding.new(
|
108
|
-
id: id,
|
106
|
+
id: id.to_s,
|
109
107
|
document: document_to_embed,
|
110
108
|
embedding: document_embedding,
|
111
109
|
metadata: embedding_metadata
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chromable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ali Hamdi Ali Fadel
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-12-
|
11
|
+
date: 2023-12-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: chroma-db
|