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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +1 -0
- data/lib/weaviate/client.rb +6 -1
- data/lib/weaviate/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ad58e91ebbe32128a41045dd5f04b82dcf7b97030af3609d21b8384fdd755cd9
|
4
|
+
data.tar.gz: e4da33cbb7a6a09b06ff65b19ee3addf83f7b4d2fe98311158586d1bd3147983
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d860ad3d6f33ab341181c6807d7c99b33bed83740ddeca9f297d856791498cfb6028f4bec710667d3d4d80a3d630ec0b95f90018ce23c9d530bd7bafb817d47
|
7
|
+
data.tar.gz: f54b9d91b2ecb8fdfc8db95d4c654d43fdd5ae28f3561545e19dc39e652bb9dbd838fe77479c909445eb40a905c747924aca715a9e45cef03467e7c358b60a53
|
data/Gemfile.lock
CHANGED
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
|
)
|
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 :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
|
data/lib/weaviate/version.rb
CHANGED