weaviate-ruby 0.5.0 → 0.6.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: 7188f7ab1cb378b6ffecf86e173bcfd2d6f513cd004559d18cfa011d8c2f9407
4
- data.tar.gz: fd07382e798c763a27adbce3543d224bfed059a2035625569a5247e83d11f598
3
+ metadata.gz: ad58e91ebbe32128a41045dd5f04b82dcf7b97030af3609d21b8384fdd755cd9
4
+ data.tar.gz: e4da33cbb7a6a09b06ff65b19ee3addf83f7b4d2fe98311158586d1bd3147983
5
5
  SHA512:
6
- metadata.gz: 5cb63f9f341edb1acdc580f3fab0e27190221400183c9191590d4ed7e2d08f3d48ce01167381885e3cbdda894cd0cb32c1c418a2827e2625a2a16d26306395ee
7
- data.tar.gz: 17aa43b9a7f42b063a3e5f148a697481ea3b73bfc6dc62c7b6ab101cc24d30d8d78e4e501b3e414e6bf6ef6f73d94914df211f0025aac0f1c8d5b0fe599a1a6e
6
+ metadata.gz: 5d860ad3d6f33ab341181c6807d7c99b33bed83740ddeca9f297d856791498cfb6028f4bec710667d3d4d80a3d630ec0b95f90018ce23c9d530bd7bafb817d47
7
+ data.tar.gz: f54b9d91b2ecb8fdfc8db95d4c654d43fdd5ae28f3561545e19dc39e652bb9dbd838fe77479c909445eb40a905c747924aca715a9e45cef03467e7c358b60a53
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- weaviate-ruby (0.5.0)
4
+ weaviate-ruby (0.6.0)
5
5
  faraday (~> 2.7)
6
6
  graphlient (~> 0.7.0)
7
7
 
data/README.md CHANGED
@@ -22,6 +22,7 @@ require 'weaviate'
22
22
  client = Weaviate::Client.new(
23
23
  scheme: 'https',
24
24
  host: 'some-endpoint.weaviate.network', # Replace with your endpoint
25
+ api_key: '', # Weaviate API key
25
26
  model_service: :openai, # Service that will be used to generate vectors. Possible values: :openai, :cohere, :huggingface
26
27
  model_service_api_key: 'xxxxxxx' # Either OpenAI, Cohere or Hugging Face API key
27
28
  )
@@ -5,7 +5,7 @@ require "graphlient"
5
5
 
6
6
  module Weaviate
7
7
  class Client
8
- attr_reader :scheme, :host, :model_service, :model_service_api_key, :adapter
8
+ attr_reader :scheme, :host, :api_key, :model_service, :model_service_api_key, :adapter
9
9
 
10
10
  API_VERSION = "v1"
11
11
 
@@ -18,6 +18,7 @@ module Weaviate
18
18
  def initialize(
19
19
  scheme:,
20
20
  host:,
21
+ api_key: nil,
21
22
  model_service: nil,
22
23
  model_service_api_key: nil,
23
24
  adapter: Faraday.default_adapter
@@ -26,6 +27,7 @@ module Weaviate
26
27
 
27
28
  @scheme = scheme
28
29
  @host = host
30
+ @api_key = api_key
29
31
  @model_service = model_service
30
32
  @model_service_api_key = model_service_api_key
31
33
  @adapter = adapter
@@ -93,6 +95,9 @@ module Weaviate
93
95
 
94
96
  def connection
95
97
  @connection ||= Faraday.new(url: "#{scheme}://#{host}/#{API_VERSION}/") do |faraday|
98
+ if api_key
99
+ faraday.request :authorization, :Bearer, api_key
100
+ end
96
101
  faraday.request :json
97
102
  faraday.response :json, content_type: /\bjson$/
98
103
  faraday.adapter adapter
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Weaviate
4
- VERSION = "0.5.0"
4
+ VERSION = "0.6.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: weaviate-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrei Bondarev