anndb_api 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/anndb_api/client.rb +2 -0
- data/lib/anndb_api/image_dataset.rb +3 -3
- data/lib/anndb_api/text_dataset.rb +1 -1
- data/lib/anndb_api/vector_dataset.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: 6a71f0644c3f5ac1a0a0832b3ddf2261656862829d77331697ab72468659cbff
|
4
|
+
data.tar.gz: ccd552eceec9d5c156057d496b543283cc2e83f760d44f67b85daa2dd23f608e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2b942bfe8d73f5d81efe16dbe8e92d2e96670569a5c74df0212d30688e97be7ee4dac1441e91a086e3e60642f58704b11276981f5744677f104af2407b8d258e
|
7
|
+
data.tar.gz: b4ad6e9c0c3671686864f8fbd9a7e9cdd4909eb4042a7bf7a61445ba3d69b84d39e9b057976ec7def36819dcbb8ec026cf96c6ae4be6349a91002bac9898712e
|
data/lib/anndb_api/client.rb
CHANGED
@@ -67,10 +67,10 @@ module AnndbApi
|
|
67
67
|
private
|
68
68
|
|
69
69
|
def image_proto(img)
|
70
|
-
if img.
|
71
|
-
return AnndbApiPb::Image.new(data: img)
|
72
|
-
elsif img.is_a? String
|
70
|
+
if !img.match(/^http/).nil?
|
73
71
|
return AnndbApiPb::Image.new(url: img)
|
72
|
+
else
|
73
|
+
return AnndbApiPb::Image.new(data: img)
|
74
74
|
end
|
75
75
|
|
76
76
|
raise TypeError.new('Image has to be either an array or a string')
|
@@ -42,7 +42,7 @@ module AnndbApi
|
|
42
42
|
|
43
43
|
def update_batch(items)
|
44
44
|
format_dataset_op_result @stub.update(AnndbApiPb::TextDatasetRequest.new(items: items.map { |item|
|
45
|
-
AnndbApiPb::
|
45
|
+
AnndbApiPb::TextItem.new(
|
46
46
|
id: AnndbApiPb::UUID.new(data: AnndbApi::Util.uuid_string_to_bytes(item[:id])),
|
47
47
|
text: item[:text],
|
48
48
|
metadata: format_req_metadata(item.fetch(:metadata, {}))
|
@@ -43,7 +43,7 @@ module AnndbApi
|
|
43
43
|
|
44
44
|
def update_batch(items)
|
45
45
|
format_dataset_op_result @stub.update(AnndbApiPb::VectorDatasetRequest.new(items: items.map { |item|
|
46
|
-
AnndbApiPb::
|
46
|
+
AnndbApiPb::VectorItem.new(
|
47
47
|
id: AnndbApiPb::UUID.new(data: AnndbApi::Util.uuid_string_to_bytes(item[:id])),
|
48
48
|
vector: AnndbApiPb::Vector.new(values: item[:vector]),
|
49
49
|
metadata: format_req_metadata(item.fetch(:metadata, {}))
|