weaviate-ruby 0.3.0 → 0.4.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: 52fb7ba7147345178fa220aa2bbed2ce66a7903a4df42b8cf5a016ddd329ff3f
4
- data.tar.gz: c03e3a537651f2c9e5beb4febdf826f22eadbce6cc1c96ed983b8e0311140604
3
+ metadata.gz: e9f87a5670b340fe00f3634f0cf7d22b3c699b0737d3cb326d4ec7d55085cea2
4
+ data.tar.gz: 0b7fbe6084e04d5d1a006871deab4972aa965a65bd5bf8080a58f045787841fd
5
5
  SHA512:
6
- metadata.gz: f53cf142fa41ce9236e865c251c8e183669b0c3fea0b8b3fe0720a8e9b30dedfd0e37fea888a86b75e9e3d8c5a7118592e5d4b14b1dcfc36221c85a996e332c6
7
- data.tar.gz: a71fa15a01d2d75c51de572b2f87d231862ae442a5841a2022ef25c7b20400cc3469217c1ca6d5af42a4995d5b4393f4f33795e846361cdfb663cdf6431edeed
6
+ metadata.gz: dee8739ad9cd3bb53ae226bd4be6b041fc9af449d47ff6347088514b2db2bfc2adef35e9fc2ff2c6c431ee5f2d311e49c5f78569ff473e36b8da366a01dd9d48
7
+ data.tar.gz: 5dd898fd6c88899b119721369d0f606114cf1be480be31218adbe506954cba1b110f9eead1f135b5619e067d7328aeefd405762159912f93996f9f098b2ff62e
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- weaviate-ruby (0.3.0)
4
+ weaviate-ruby (0.4.0)
5
5
  faraday (~> 2.7)
6
6
  graphlient (~> 0.7.0)
7
7
 
data/README.md CHANGED
@@ -187,6 +187,17 @@ client.query.aggs(
187
187
  )
188
188
  ```
189
189
 
190
+ #### Nodes
191
+ ```ruby
192
+ client.nodes
193
+ ```
194
+
195
+ #### Health
196
+ ```ruby
197
+ client.live?
198
+ client.ready?
199
+ ```
200
+
190
201
  ## Development
191
202
 
192
203
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -44,6 +44,21 @@ module Weaviate
44
44
  @meta.get
45
45
  end
46
46
 
47
+ def nodes
48
+ @nodes ||= Weaviate::Nodes.new(client: self)
49
+ @nodes.list
50
+ end
51
+
52
+ def live?
53
+ @health ||= Weaviate::Health.new(client: self)
54
+ @health.live?
55
+ end
56
+
57
+ def ready?
58
+ @health ||= Weaviate::Health.new(client: self)
59
+ @health.ready?
60
+ end
61
+
47
62
  def objects
48
63
  @objects ||= Weaviate::Objects.new(client: self)
49
64
  end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Weaviate
4
+ class Health < Base
5
+ PATH = ".well-known"
6
+
7
+ def live?
8
+ response = client.connection.get("#{PATH}/live")
9
+ response.status == 200
10
+ end
11
+
12
+ def ready?
13
+ response = client.connection.get("#{PATH}/ready")
14
+ response.status == 200
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Weaviate
4
+ class Nodes < Base
5
+ PATH = "nodes"
6
+
7
+ def list
8
+ response = client.connection.get(PATH)
9
+ response.body
10
+ end
11
+ end
12
+ end
@@ -40,8 +40,11 @@ module Weaviate
40
40
  req.body["id"] = id unless id.nil?
41
41
  req.body["vector"] = vector unless vector.nil?
42
42
  end
43
+
43
44
  if response.success?
44
45
  Weaviate::Response::Object.new(response.body)
46
+ else
47
+ response.body
45
48
  end
46
49
  end
47
50
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Weaviate
4
- VERSION = "0.3.0"
4
+ VERSION = "0.4.0"
5
5
  end
data/lib/weaviate.rb CHANGED
@@ -11,6 +11,8 @@ module Weaviate
11
11
  autoload :Objects, "weaviate/objects"
12
12
  autoload :OIDC, "weaviate/oidc"
13
13
  autoload :Query, "weaviate/query"
14
+ autoload :Nodes, "weaviate/nodes"
15
+ autoload :Health, "weaviate/health"
14
16
 
15
17
  module Response
16
18
  autoload :Base, "weaviate/response/base"
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.3.0
4
+ version: 0.4.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-02 00:00:00.000000000 Z
11
+ date: 2023-04-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -71,7 +71,9 @@ files:
71
71
  - lib/weaviate/base.rb
72
72
  - lib/weaviate/client.rb
73
73
  - lib/weaviate/error.rb
74
+ - lib/weaviate/health.rb
74
75
  - lib/weaviate/meta.rb
76
+ - lib/weaviate/nodes.rb
75
77
  - lib/weaviate/objects.rb
76
78
  - lib/weaviate/oidc.rb
77
79
  - lib/weaviate/query.rb