chromable 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -10
- data/lib/chromable/version.rb +1 -1
- data/lib/chromable.rb +2 -2
- 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: 5b0b02fff83da824d9195113352c1d68dfaaa06bde568eba6448fb4cb79e0919
|
4
|
+
data.tar.gz: 879ac8e61ba6be8a9490174f13517c509409c0d271fd93e9fd06d6a22cf3f1fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5a97a3c29f46ee311eafa1d2ea9d51d032568a2bafa64877d22590403152b623318a93d650328af3db1db005e5315b4a90002185a9bfa0c328fcb81dd374276
|
7
|
+
data.tar.gz: cc14d192452c5e4f72ee090f5423c7b78afe1449e1cd1b25009fcb7d4db29394fe50a2093e107c438f9d4b0d60a46ff8f3230f4a6fd9a1aab5f5b33cdc99798e
|
data/README.md
CHANGED
@@ -4,19 +4,11 @@ Ruby on Rails integration for ChromaDB based on `chroma-db` gem.
|
|
4
4
|
|
5
5
|
## Installation
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
$ bundle add chroma-db
|
10
|
-
|
11
|
-
Or, if you are not using bundler, install it by executing:
|
12
|
-
|
13
|
-
$ gem install chroma-db
|
14
|
-
|
15
|
-
Then, install `chromable` and add to the application's Gemfile by executing:
|
7
|
+
Install `chromable` and add it to the application's Gemfile by executing:
|
16
8
|
|
17
9
|
$ bundle add chromable
|
18
10
|
|
19
|
-
Or, if
|
11
|
+
Or, if bundler is not being used to manage dependencies, install `chromable` by executing:
|
20
12
|
|
21
13
|
$ gem install chromable
|
22
14
|
|
@@ -39,6 +31,10 @@ class Post < ApplicationRecord
|
|
39
31
|
include Chromable
|
40
32
|
|
41
33
|
chromable document: :content, metadata: %i[author category], embedder: :embed
|
34
|
+
|
35
|
+
def embed
|
36
|
+
# Call OpenAI now please :)
|
37
|
+
end
|
42
38
|
end
|
43
39
|
```
|
44
40
|
|
@@ -51,6 +47,8 @@ Optionaly you can pass `collection_name:`. If not passed, the plural form of the
|
|
51
47
|
|
52
48
|
All `chromable` method arguments are optional.
|
53
49
|
|
50
|
+
At this point, `chromable` will create, update, and destroy the ChromaDB embeddings for your objects based on Rails callbacks.
|
51
|
+
|
54
52
|
To interact with the ChromaDB collection, `chromable` provides `Model.collection` method to retrieve the collection instance.
|
55
53
|
Also, `chromable` provides the following methods for each model instance:
|
56
54
|
|
data/lib/chromable/version.rb
CHANGED
data/lib/chromable.rb
CHANGED
@@ -53,6 +53,6 @@ module Chromable
|
|
53
53
|
end
|
54
54
|
|
55
55
|
alias embedding chroma_embedding unless method_defined? :embedding
|
56
|
-
alias upsert_embedding
|
57
|
-
alias destroy_embedding
|
56
|
+
alias upsert_embedding chroma_upsert_embedding unless method_defined? :upsert_embedding
|
57
|
+
alias destroy_embedding chroma_destroy_embedding unless method_defined? :destroy_embedding
|
58
58
|
end
|
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.1.
|
4
|
+
version: 0.1.4
|
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-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|