weaviate-ruby 0.7.3 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/Gemfile.lock +1 -1
- data/README.md +2 -3
- data/lib/weaviate/client.rb +5 -7
- data/lib/weaviate/version.rb +1 -1
- 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: e3fbf2a33be8c215b77162ae797f54be34962fa8f26b9c47880b6e80028997da
|
4
|
+
data.tar.gz: 6e3cd21e2c087e180afa031366d4284b9c5a65cd98a4162e6cbf23049164fb0a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 182607f0a3efbdfbd473289c005218ef2987100f2eac33b22c1d01cdc38a39183ce589943232e61a504b17831722875546c56780caa96b33086adb1d031edf86
|
7
|
+
data.tar.gz: 9b3b1b947bc19268e11f53a3df2988bec3c3f124a3c8144b1ecb5b69c5220f2eb3c2158cde198fbeab43f3f73ff2f5f19feb9241b12c43d55d77980ec8bd84b2
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -28,8 +28,7 @@ If bundler is not being used to manage dependencies, install the gem by executin
|
|
28
28
|
require 'weaviate'
|
29
29
|
|
30
30
|
client = Weaviate::Client.new(
|
31
|
-
|
32
|
-
host: 'some-endpoint.weaviate.network', # Replace with your endpoint
|
31
|
+
url: 'https://some-endpoint.weaviate.network', # Replace with your endpoint
|
33
32
|
api_key: '', # Weaviate API key
|
34
33
|
model_service: :openai, # Service that will be used to generate vectors. Possible values: :openai, :cohere, :huggingface
|
35
34
|
model_service_api_key: 'xxxxxxx' # Either OpenAI, Cohere or Hugging Face API key
|
@@ -181,7 +180,7 @@ client.query.get(
|
|
181
180
|
offset: "1",
|
182
181
|
after: "id",
|
183
182
|
sort: sort_obj,
|
184
|
-
|
183
|
+
where: where_obj,
|
185
184
|
|
186
185
|
# To use this parameter you must have created your schema by setting the `vectorizer:` property to
|
187
186
|
# either 'text2vec-transformers', 'text2vec-contextionary', 'text2vec-openai', 'multi2vec-clip', 'text2vec-huggingface' or 'text2vec-cohere'
|
data/lib/weaviate/client.rb
CHANGED
@@ -5,7 +5,7 @@ require "graphlient"
|
|
5
5
|
|
6
6
|
module Weaviate
|
7
7
|
class Client
|
8
|
-
attr_reader :
|
8
|
+
attr_reader :url, :api_key, :model_service, :model_service_api_key, :adapter
|
9
9
|
|
10
10
|
API_VERSION = "v1"
|
11
11
|
|
@@ -16,8 +16,7 @@ module Weaviate
|
|
16
16
|
}
|
17
17
|
|
18
18
|
def initialize(
|
19
|
-
|
20
|
-
host:,
|
19
|
+
url:,
|
21
20
|
api_key: nil,
|
22
21
|
model_service: nil,
|
23
22
|
model_service_api_key: nil,
|
@@ -25,8 +24,7 @@ module Weaviate
|
|
25
24
|
)
|
26
25
|
validate_model_service!(model_service) unless model_service.nil?
|
27
26
|
|
28
|
-
@
|
29
|
-
@host = host
|
27
|
+
@url = url
|
30
28
|
@api_key = api_key
|
31
29
|
@model_service = model_service
|
32
30
|
@model_service_api_key = model_service_api_key
|
@@ -89,7 +87,7 @@ module Weaviate
|
|
89
87
|
end
|
90
88
|
|
91
89
|
@graphql ||= Graphlient::Client.new(
|
92
|
-
"#{
|
90
|
+
"#{url}/#{API_VERSION}/graphql",
|
93
91
|
headers: headers,
|
94
92
|
http_options: {
|
95
93
|
read_timeout: 20,
|
@@ -99,7 +97,7 @@ module Weaviate
|
|
99
97
|
end
|
100
98
|
|
101
99
|
def connection
|
102
|
-
@connection ||= Faraday.new(url: "#{
|
100
|
+
@connection ||= Faraday.new(url: "#{url}/#{API_VERSION}/") do |faraday|
|
103
101
|
if api_key
|
104
102
|
faraday.request :authorization, :Bearer, api_key
|
105
103
|
end
|
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.
|
4
|
+
version: 0.8.0
|
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-04-
|
11
|
+
date: 2023-04-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|