chroma-db 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +2 -0
- data/Gemfile.lock +13 -1
- data/lib/chroma/api_operations/request.rb +125 -0
- data/lib/chroma/chroma.rb +29 -0
- data/lib/chroma/chroma_configuration.rb +75 -0
- data/lib/chroma/errors.rb +71 -0
- data/lib/chroma/resources/collection.rb +384 -0
- data/lib/chroma/resources/database.rb +69 -0
- data/lib/chroma/resources/embedding.rb +23 -0
- data/lib/chroma/util.rb +70 -0
- data/lib/chroma/version.rb +1 -1
- data/lib/chroma-db.rb +18 -0
- data/notebook/Chroma Gem.ipynb +851 -0
- data/notebook/ruby.txt +58 -0
- metadata +13 -3
- data/lib/chroma.rb +0 -6
data/notebook/ruby.txt
ADDED
@@ -0,0 +1,58 @@
|
|
1
|
+
Array#any?
|
2
|
+
|
3
|
+
any? → true or false
|
4
|
+
any? {|element| ... } → true or false
|
5
|
+
any?(obj) → true or false
|
6
|
+
|
7
|
+
Returns true if any element of self meets a given criterion.
|
8
|
+
|
9
|
+
With no block given and no argument, returns true if self has any truthy element, false otherwise:
|
10
|
+
|
11
|
+
[nil, 0, false].any? # => true
|
12
|
+
[nil, false].any? # => false
|
13
|
+
[].any? # => false
|
14
|
+
With a block given and no argument, calls the block with each element in self; returns true if the block returns any truthy value, false otherwise:
|
15
|
+
|
16
|
+
[0, 1, 2].any? {|element| element > 1 } # => true
|
17
|
+
[0, 1, 2].any? {|element| element > 2 } # => false
|
18
|
+
If argument obj is given, returns true if obj.=== any element, false otherwise:
|
19
|
+
|
20
|
+
['food', 'drink'].any?(/foo/) # => true
|
21
|
+
['food', 'drink'].any?(/bar/) # => false
|
22
|
+
[].any?(/foo/) # => false
|
23
|
+
[0, 1, 2].any?(1) # => true
|
24
|
+
[0, 1, 2].any?(3) # => false
|
25
|
+
Related: Enumerable#any?
|
26
|
+
|
27
|
+
|
28
|
+
Array#map Array#map!
|
29
|
+
|
30
|
+
map {|element| ... } → new_array
|
31
|
+
map → new_enumerator
|
32
|
+
Calls the block, if given, with each element of self; returns a new Array whose elements are the return values from the block:
|
33
|
+
|
34
|
+
a = [:foo, 'bar', 2]
|
35
|
+
a1 = a.map {|element| element.class }
|
36
|
+
a1 # => [Symbol, String, Integer]
|
37
|
+
Returns a new Enumerator if no block given:
|
38
|
+
|
39
|
+
a = [:foo, 'bar', 2]
|
40
|
+
a1 = a.map
|
41
|
+
a1 # => #<Enumerator: [:foo, "bar", 2]:map>
|
42
|
+
Array#collect is an alias for Array#map.
|
43
|
+
|
44
|
+
Alias for: collect
|
45
|
+
map! {|element| ... } → self
|
46
|
+
map! → new_enumerator
|
47
|
+
Calls the block, if given, with each element; replaces the element with the block’s return value:
|
48
|
+
|
49
|
+
a = [:foo, 'bar', 2]
|
50
|
+
a.map! { |element| element.class } # => [Symbol, String, Integer]
|
51
|
+
Returns a new Enumerator if no block given:
|
52
|
+
|
53
|
+
a = [:foo, 'bar', 2]
|
54
|
+
a1 = a.map!
|
55
|
+
a1 # => #<Enumerator: [:foo, "bar", 2]:map!>
|
56
|
+
Array#collect! is an alias for Array#map!.
|
57
|
+
|
58
|
+
Alias for: collect!
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: chroma-db
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mario Alberto Chávez
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-05-
|
11
|
+
date: 2023-05-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dry-monads
|
@@ -39,8 +39,18 @@ files:
|
|
39
39
|
- LICENSE.txt
|
40
40
|
- README.md
|
41
41
|
- Rakefile
|
42
|
-
- lib/chroma.rb
|
42
|
+
- lib/chroma-db.rb
|
43
|
+
- lib/chroma/api_operations/request.rb
|
44
|
+
- lib/chroma/chroma.rb
|
45
|
+
- lib/chroma/chroma_configuration.rb
|
46
|
+
- lib/chroma/errors.rb
|
47
|
+
- lib/chroma/resources/collection.rb
|
48
|
+
- lib/chroma/resources/database.rb
|
49
|
+
- lib/chroma/resources/embedding.rb
|
50
|
+
- lib/chroma/util.rb
|
43
51
|
- lib/chroma/version.rb
|
52
|
+
- notebook/Chroma Gem.ipynb
|
53
|
+
- notebook/ruby.txt
|
44
54
|
- sig/chroma.rbs
|
45
55
|
homepage: https://mariochavez.io
|
46
56
|
licenses:
|