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 +4 -4
- data/CHANGELOG.md +21 -0
- data/Gemfile.lock +1 -1
- data/README.md +14 -5
- data/lib/weaviate/objects.rb +25 -0
- data/lib/weaviate/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: df0801c83bc409a791c5a2737f0574def072660fdac96b32261b02aaa6665f33
|
4
|
+
data.tar.gz: d720fc99beed7b91b844479116caa54f6805e8807c4375e67bdffdb9a52573fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
data/README.md
CHANGED
@@ -168,14 +168,17 @@ client.objects.exists?(
|
|
168
168
|
id: "uuid"
|
169
169
|
)
|
170
170
|
|
171
|
-
#
|
172
|
-
client.objects.
|
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
|
-
#
|
178
|
-
client.objects.
|
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
|
{
|
data/lib/weaviate/objects.rb
CHANGED
@@ -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
|
|
data/lib/weaviate/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2024-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|