weaviate-ruby 0.8.11 → 0.9.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: f1533db1f83e65e849863776ab0312149c0e5dcdcbb2c65ea922294ea9af6ee7
4
- data.tar.gz: ce9ca1a00db9c4b117a8c19216c9049663f481750b7773bd69a4637f26074282
3
+ metadata.gz: df0801c83bc409a791c5a2737f0574def072660fdac96b32261b02aaa6665f33
4
+ data.tar.gz: d720fc99beed7b91b844479116caa54f6805e8807c4375e67bdffdb9a52573fe
5
5
  SHA512:
6
- metadata.gz: 8af749e6537bdef2d2c87fdc0b0724e860368f00f37550c94a7b3e0139555c89d624fda050abda601b7c7d317ad9eccdfb01ee654586e6ce038e7048128d37cb
7
- data.tar.gz: 4afef756ad24eba7c8fb9314219dda512e49ae2cf0dc07ce9f8cc9ec1269d4b71c7ef738b4f36de780147e9b707f384bf0cb271d7ebf57d3333c2ce9e135ac07
6
+ metadata.gz: 807e7b52c259e8559c0b581c1d96a175e95bba8dff16091dd67746a41451b10b3f68c26bbc081c22c862eafeeac2c9d65a7aa12dcbbf69d5521cab8b98cc3275
7
+ data.tar.gz: 203f861b21b501deff8a787168920c3946cd28682112aa73ed3fc238a52feeb4dd6ee0a5d1eef7c28258210e88b3aca232fa63ee027fce976ab2c54ccba1e12c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.9.0] - 2024-07-08
4
+
5
+ - Add object.replace method which uses PUT which performs a complete object replacement
6
+
7
+ ### Breaking
8
+ - Change the object.update method to use PATCH which only performs a partial update(previously performed a replacement)
9
+
10
+ ## [0.8.11] - 2024-07-02
11
+ - Allow the user to specify any options they want for multi-tenancy when creating a schema using their own hash
12
+ - Allow Ollama vectorizer
13
+
14
+ ## [0.8.10] - 2024-01-25
15
+
16
+ ## [0.8.9] - 2023-10-10
17
+
18
+ ## [0.8.8] - 2023-10-10
19
+
20
+ ## [0.8.7] - 2023-09-11
21
+
22
+ ## [0.8.6] - 2023-08-10
23
+
3
24
  ## [0.8.5] - 2023-07-19
4
25
  - Add multi-tenancy support
5
26
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- weaviate-ruby (0.8.11)
4
+ weaviate-ruby (0.9.0)
5
5
  faraday (>= 2.0.1, < 3.0)
6
6
  graphlient (~> 0.7.0)
7
7
 
data/README.md CHANGED
@@ -168,14 +168,17 @@ client.objects.exists?(
168
168
  id: "uuid"
169
169
  )
170
170
 
171
- # Delete a single data object from Weaviate.
172
- client.objects.delete(
171
+ # Perform a partial update on an object based on its uuid.
172
+ client.objects.update(
173
173
  class_name: "Question",
174
- id: "uuid"
174
+ id: "uuid",
175
+ properties: {
176
+ category: "simple-math"
177
+ }
175
178
  )
176
179
 
177
- # Update a single data object based on its uuid.
178
- client.objects.update(
180
+ # Replace an object based on its uuid.
181
+ client.objects.replace(
179
182
  class_name: "Question",
180
183
  id: "uuid",
181
184
  properties: {
@@ -185,6 +188,12 @@ client.objects.update(
185
188
  }
186
189
  )
187
190
 
191
+ # Delete a single data object from Weaviate.
192
+ client.objects.delete(
193
+ class_name: "Question",
194
+ id: "uuid"
195
+ )
196
+
188
197
  # Batch create objects
189
198
  client.objects.batch_create(objects: [
190
199
  {
@@ -122,6 +122,31 @@ module Weaviate
122
122
  )
123
123
  validate_consistency_level!(consistency_level) unless consistency_level.nil?
124
124
 
125
+ response = client.connection.patch("#{PATH}/#{class_name}/#{id}") do |req|
126
+ req.params["consistency_level"] = consistency_level.to_s.upcase unless consistency_level.nil?
127
+
128
+ req.body = {}
129
+ req.body["id"] = id
130
+ req.body["class"] = class_name
131
+ req.body["properties"] = properties
132
+ req.body["vector"] = vector unless vector.nil?
133
+ req.body["tenant"] = tenant unless tenant.nil?
134
+ end
135
+
136
+ response.body
137
+ end
138
+
139
+ # Replace an individual data object based on its uuid.
140
+ def replace(
141
+ class_name:,
142
+ id:,
143
+ properties:,
144
+ vector: nil,
145
+ tenant: nil,
146
+ consistency_level: nil
147
+ )
148
+ validate_consistency_level!(consistency_level) unless consistency_level.nil?
149
+
125
150
  response = client.connection.put("#{PATH}/#{class_name}/#{id}") do |req|
126
151
  req.params["consistency_level"] = consistency_level.to_s.upcase unless consistency_level.nil?
127
152
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Weaviate
4
- VERSION = "0.8.11"
4
+ VERSION = "0.9.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.8.11
4
+ version: 0.9.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: 2024-07-02 00:00:00.000000000 Z
11
+ date: 2024-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday