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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 40231828a91cb8e7abaf19f7f59106653fd1a2f1879ef296af3b16ff254d0aa9
4
- data.tar.gz: f5a4247b51dcbb1c0a0cd847057d3128e80b8230c18262085b1e158a6eb2a8d6
3
+ metadata.gz: 6a71f0644c3f5ac1a0a0832b3ddf2261656862829d77331697ab72468659cbff
4
+ data.tar.gz: ccd552eceec9d5c156057d496b543283cc2e83f760d44f67b85daa2dd23f608e
5
5
  SHA512:
6
- metadata.gz: ae3175f1cb7b5f85d6aba9839f1df6850017ea77aba31ff692ee72cd4244f705bc07ac0e335d6b4c6f3a56ae91eae43059ac56d7b3a831714f1e67ff1530cb10
7
- data.tar.gz: 2ce06b8904d9a2e87bfff59e009883c740a0e9ffa4f7a66cadd7a586a71e8147ea2d740f4d55595a7580cb9d289d60a030c4a6f6e83fe7a8710bc7a473353ab7
6
+ metadata.gz: 2b942bfe8d73f5d81efe16dbe8e92d2e96670569a5c74df0212d30688e97be7ee4dac1441e91a086e3e60642f58704b11276981f5744677f104af2407b8d258e
7
+ data.tar.gz: b4ad6e9c0c3671686864f8fbd9a7e9cdd4909eb4042a7bf7a61445ba3d69b84d39e9b057976ec7def36819dcbb8ec026cf96c6ae4be6349a91002bac9898712e
@@ -1,4 +1,6 @@
1
1
  require 'anndb_api/image_dataset'
2
+ require 'anndb_api/text_dataset'
3
+ require 'anndb_api/vector_dataset'
2
4
 
3
5
  module AnndbApi
4
6
  SERVER_ADDR = 'grpc-api.anndb.com:1433'
@@ -67,10 +67,10 @@ module AnndbApi
67
67
  private
68
68
 
69
69
  def image_proto(img)
70
- if img.is_a? Array
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::ImageItem.new(
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::ImageItem.new(
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, {}))
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: anndb_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marek Galovic