speaky 0.1.4 → 0.1.6

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: b6be1d021d8ebe259d6aa37fe46dc536e8be03b0e4b19309ad06733625bb91ff
4
- data.tar.gz: 5a5b658cd9ea7878362d436cee77b322be437e0a6bca88db844eb56cd06719af
3
+ metadata.gz: 3dea3c0900c9679d76d464ded63bc6c3d8cfad6d03da8661ad19b1013779b255
4
+ data.tar.gz: 62858d2b9e755c8c56a18b34d0a5651c8dcdb5687b15b1294d1a3c48986a4176
5
5
  SHA512:
6
- metadata.gz: 28e149649e103d758b87dbb73b3417f1fbdf8e0e73838b24f602fc17204fc2a972fee798eed57aa9c0b92d30ffbeae18047eaa845e248af1355dce1f72b006ed
7
- data.tar.gz: ca90c2c737d2f2e151c2f35a8b2b429f116aeb386c02951aa87e119635d0f06cf86fbd1ab9dc4764014d5c830998d6fd9299dee00d4877282fcaa567f4e961dd
6
+ metadata.gz: 304614f14107c1a2effe210d1d00f599fab93ce6f1a086d09f398b0f7b42b0b129b95d585f3a6fccb36b9d3a0cee797342365634392ee15430ade4e3ccbf2aca
7
+ data.tar.gz: '01229a40b984e5165e8ed669df1d94c8923ddc1f1b42a02ff3557215b6301531389c44e1a744092785fb1312842b498c7160c53888a7b5b640a587d677986e8c'
@@ -13,7 +13,7 @@ module Speaky
13
13
 
14
14
  def save_for_speaky
15
15
  begin
16
- Speaky.vectorstore.add(self.id, self.as_speaky)
16
+ Speaky.vectorstore.add("#{self.class.name}_#{self.id}", self.as_speaky)
17
17
  rescue StandardError => e
18
18
  Rails.logger.error(e)
19
19
  errors.add(:base, 'Failed to create for speaky')
@@ -23,7 +23,7 @@ module Speaky
23
23
 
24
24
  def destroy_for_speaky
25
25
  begin
26
- Speaky.vectorstore.remove(self.id)
26
+ Speaky.vectorstore.remove("#{self.class.name}_#{self.id}")
27
27
  rescue StandardError => e
28
28
  Rails.logger.error(e)
29
29
  errors.add(:base, 'Failed to destroy for speaky')
@@ -40,6 +40,7 @@ module Speaky
40
40
  )
41
41
 
42
42
  if !points_upsert || points_upsert.dig('status') != 'ok'
43
+ Rails.logger.error(points_upsert)
43
44
  raise 'Failed to add vector'
44
45
  end
45
46
 
@@ -53,6 +54,7 @@ module Speaky
53
54
  )
54
55
 
55
56
  if !points_delete || points_delete.dig('status') != 'ok'
57
+ Rails.logger.error(points_delete)
56
58
  raise 'Failed to remove vector'
57
59
  end
58
60
 
@@ -71,6 +73,7 @@ module Speaky
71
73
  )
72
74
 
73
75
  if !points_search || points_search.dig('status') != 'ok'
76
+ Rails.logger.error(points_search)
74
77
  raise 'Failed to search vectors'
75
78
  end
76
79
 
@@ -80,6 +83,7 @@ module Speaky
80
83
  def reset
81
84
  collections_delete = @client.collections.delete(collection_name: @config[:collection_name])
82
85
  if !collections_delete || collections_delete.dig('status') != 'ok'
86
+ Rails.logger.error(collections_delete)
83
87
  raise 'Failed to delete collection'
84
88
  end
85
89
 
@@ -99,6 +103,7 @@ module Speaky
99
103
  }
100
104
  )
101
105
  if !collections_create || collections_create.dig('status') != 'ok'
106
+ Rails.logger.error(collections_create)
102
107
  raise 'Failed to create collection'
103
108
  end
104
109
  end
@@ -106,6 +111,7 @@ module Speaky
106
111
  # create index for field "id" in collection
107
112
  collections_create_index = @client.collections.create_index(collection_name: @config[:collection_name], field_name: 'id', field_schema: 'keyword')
108
113
  if !collections_create_index || collections_create_index.dig('status') != 'ok'
114
+ Rails.logger.error(collections_create_index)
109
115
  raise 'Failed to create index for field "id" on collection'
110
116
  end
111
117
 
@@ -1,3 +1,3 @@
1
1
  module Speaky
2
- VERSION = '0.1.4'
2
+ VERSION = '0.1.6'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: speaky
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregorio Galante