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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8565b08277a636e7d6ff9897060d1dafd4cb97292077f1b8f0ade8cc87ac019f
4
- data.tar.gz: 960edbba086f83764c23d81b430931d9a4b3597f2fdd09a90d4f70552262d276
3
+ metadata.gz: e3fbf2a33be8c215b77162ae797f54be34962fa8f26b9c47880b6e80028997da
4
+ data.tar.gz: 6e3cd21e2c087e180afa031366d4284b9c5a65cd98a4162e6cbf23049164fb0a
5
5
  SHA512:
6
- metadata.gz: f379f83adba19db042892faf35132c7a1f500653007e3627eedb07697916bb9720b136b8e72137fb22e738a974ec6d6e5249aee6620954e268ebc5a3fb151289
7
- data.tar.gz: ea3bff55f289ac6fbf41a183248538c64b9d5534258507bf392c330248f618417ff897efb9b5724a294285d797cdec30444009aa2296d6da346ef70d4e48092a
6
+ metadata.gz: 182607f0a3efbdfbd473289c005218ef2987100f2eac33b22c1d01cdc38a39183ce589943232e61a504b17831722875546c56780caa96b33086adb1d031edf86
7
+ data.tar.gz: 9b3b1b947bc19268e11f53a3df2988bec3c3f124a3c8144b1ecb5b69c5220f2eb3c2158cde198fbeab43f3f73ff2f5f19feb9241b12c43d55d77980ec8bd84b2
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.8.0] - 2023-04-18
4
+
5
+ ### Breaking
6
+ - Initializing the weaviate client requires the single `url:` key instead of separate `host:` and `schema:`
7
+
3
8
  ## [0.1.0] - 2023-03-24
4
9
 
5
10
  - Initial release
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- weaviate-ruby (0.7.3)
4
+ weaviate-ruby (0.8.0)
5
5
  faraday (~> 2.7)
6
6
  graphlient (~> 0.7.0)
7
7
 
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
- scheme: 'https',
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
- where_obj: where_obj,
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'
@@ -5,7 +5,7 @@ require "graphlient"
5
5
 
6
6
  module Weaviate
7
7
  class Client
8
- attr_reader :scheme, :host, :api_key, :model_service, :model_service_api_key, :adapter
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
- scheme:,
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
- @scheme = scheme
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
- "#{scheme}://#{host}/#{API_VERSION}/graphql",
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: "#{scheme}://#{host}/#{API_VERSION}/") do |faraday|
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Weaviate
4
- VERSION = "0.7.3"
4
+ VERSION = "0.8.0"
5
5
  end
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.7.3
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-13 00:00:00.000000000 Z
11
+ date: 2023-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday