weaviate-ruby 0.8.0 → 0.8.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +13 -9
- data/README.md +5 -2
- data/lib/weaviate/client.rb +2 -0
- data/lib/weaviate/version.rb +1 -1
- metadata +20 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4bcf8baba483726456d4c887dc2e7195a5b879992ed417d7d250c4d57c9937d4
|
4
|
+
data.tar.gz: 6d5934c6ac503b6883fbc06efc505f2df9cc69a6441d10ab4793a86ec7bd61c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 21f5725a8751126d0468c3e48cdefc30ac37650193f7140e052bee082d1cdc572083896e0df0d5b3c0943958c56afb1d3cb0bcaf87cc1567fa7e2510674460cd
|
7
|
+
data.tar.gz: 52fffd1f50a8f981f650b12487179ea47c4791f08d469389a03b15648017d52214db21eb9b61c3d82609c6b32b2b6f5e5d0ffd39d3c44710c64f13d7707ae828
|
data/Gemfile.lock
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
weaviate-ruby (0.8.
|
5
|
-
faraday (~>
|
6
|
-
|
4
|
+
weaviate-ruby (0.8.2)
|
5
|
+
faraday (~> 1)
|
6
|
+
faraday_middleware (~> 1)
|
7
|
+
graphlient (~> 0.6.0)
|
7
8
|
|
8
9
|
GEM
|
9
10
|
remote: https://rubygems.org/
|
@@ -18,12 +19,14 @@ GEM
|
|
18
19
|
coderay (1.1.3)
|
19
20
|
concurrent-ruby (1.2.2)
|
20
21
|
diff-lcs (1.5.0)
|
21
|
-
faraday (2.
|
22
|
-
|
23
|
-
ruby2_keywords
|
24
|
-
|
25
|
-
|
26
|
-
|
22
|
+
faraday (1.2.0)
|
23
|
+
multipart-post (>= 1.2, < 3)
|
24
|
+
ruby2_keywords
|
25
|
+
faraday_middleware (1.2.0)
|
26
|
+
faraday (~> 1.0)
|
27
|
+
graphlient (0.6.0)
|
28
|
+
faraday (>= 1.0)
|
29
|
+
faraday_middleware
|
27
30
|
graphql-client
|
28
31
|
graphql (2.0.19)
|
29
32
|
graphql-client (0.18.0)
|
@@ -35,6 +38,7 @@ GEM
|
|
35
38
|
language_server-protocol (3.17.0.3)
|
36
39
|
method_source (1.0.0)
|
37
40
|
minitest (5.18.0)
|
41
|
+
multipart-post (2.3.0)
|
38
42
|
parallel (1.22.1)
|
39
43
|
parser (3.2.1.1)
|
40
44
|
ast (~> 2.4.1)
|
data/README.md
CHANGED
@@ -30,8 +30,8 @@ require 'weaviate'
|
|
30
30
|
client = Weaviate::Client.new(
|
31
31
|
url: 'https://some-endpoint.weaviate.network', # Replace with your endpoint
|
32
32
|
api_key: '', # Weaviate API key
|
33
|
-
model_service: :openai, # Service that will be used to generate vectors. Possible values: :openai, :cohere, :huggingface
|
34
|
-
model_service_api_key: 'xxxxxxx' # Either OpenAI, Cohere or Hugging Face API key
|
33
|
+
model_service: :openai, # Service that will be used to generate vectors. Possible values: :openai, :azure_openai, :cohere, :huggingface
|
34
|
+
model_service_api_key: 'xxxxxxx' # Either OpenAI, Azure OpenAI, Cohere or Hugging Face API key
|
35
35
|
)
|
36
36
|
```
|
37
37
|
|
@@ -169,6 +169,7 @@ client.objects.batch_delete(
|
|
169
169
|
#### Get{}
|
170
170
|
```ruby
|
171
171
|
near_text = '{ concepts: ["biology"] }'
|
172
|
+
near_vector = '{ vector: [0.1, 0.2, ...] }'
|
172
173
|
sort_obj = '{ path: ["category"], order: desc }'
|
173
174
|
where_obj = '{ path: ["id"], operator: Equal, valueString: "..." }'
|
174
175
|
with_hybrid = '{ query: "Sweets", alpha: 0.5 }'
|
@@ -188,6 +189,8 @@ client.query.get(
|
|
188
189
|
|
189
190
|
# To use this parameter you must have created your schema by setting the `vectorizer:` property to 'multi2vec-clip' or 'img2vec-neural'
|
190
191
|
near_image: near_image,
|
192
|
+
|
193
|
+
near_vector: near_vector,
|
191
194
|
|
192
195
|
with_hybrid: with_hybrid,
|
193
196
|
|
data/lib/weaviate/client.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "faraday"
|
4
|
+
require "faraday_middleware"
|
4
5
|
require "graphlient"
|
5
6
|
|
6
7
|
module Weaviate
|
@@ -11,6 +12,7 @@ module Weaviate
|
|
11
12
|
|
12
13
|
API_KEY_HEADERS = {
|
13
14
|
openai: "X-OpenAI-Api-Key",
|
15
|
+
azure_openai: "X-Azure-Api-Key",
|
14
16
|
cohere: "X-Cohere-Api-Key",
|
15
17
|
huggingface: "X-HuggingFace-Api-Key"
|
16
18
|
}
|
data/lib/weaviate/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: weaviate-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrei Bondarev
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-05-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -16,28 +16,42 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '1'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
26
|
+
version: '1'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: faraday_middleware
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: graphlient
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
30
44
|
requirements:
|
31
45
|
- - "~>"
|
32
46
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.
|
47
|
+
version: 0.6.0
|
34
48
|
type: :runtime
|
35
49
|
prerelease: false
|
36
50
|
version_requirements: !ruby/object:Gem::Requirement
|
37
51
|
requirements:
|
38
52
|
- - "~>"
|
39
53
|
- !ruby/object:Gem::Version
|
40
|
-
version: 0.
|
54
|
+
version: 0.6.0
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: pry-byebug
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|