speaky 0.1.8 → 0.1.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d65d925dd1dc599e493c9ebb83f4e7eff915aa5ffffbc2daf4248bb83d1801fd
4
- data.tar.gz: 6714917b885cc8c34992b75ff3688a60076568a341d6ccee577f8b5959946da8
3
+ metadata.gz: 564d48d19c0f2c99ef2266064911bc1010523dd52d127c7aca4262c8b329700f
4
+ data.tar.gz: 38c4365d3a09e26523c79da531211e276f53aa4a2ebff0a7337af8ff6e47a307
5
5
  SHA512:
6
- metadata.gz: 6a9c1ca13995cf513c4600725fb9a5f3ed6a2749a9d020ecd204dacf07e528356dd9164cb64d9ff70b744fae5938efe274825186ea374cec9599aa51bed07187
7
- data.tar.gz: 3ffc25af7d5884ab66720ef78fc03b6afe10892b0a3296be83a53e150654ebf09410bdae9eb33e164cc2ec485add2771aa84f72623c605892f4761c32ec8a0cc
6
+ metadata.gz: 565cba4dfa83cd596d3fafbf45db271ffc99225726a7af0ad7a899f859c8157cca0da0308f79957f0d7307ad15e9c34ef31e009e960dc4cadd35b77cd171dbed
7
+ data.tar.gz: 81edbf263c317fe847fe6befbaf6d8bef329114ab8e1f87fefc440b6499d9218ec0090e39e0cad414f61e421f98a97a74c0b499247834a4d9ab3fd8c28bae9b6
@@ -1,51 +1,51 @@
1
- # frozen_string_literal: true
1
+ # # frozen_string_literal: true
2
2
 
3
- require 'faiss'
3
+ # require 'faiss'
4
4
 
5
- module Speaky
6
- class VectorstoreFaiss < VectorstoreBase
7
- def initialize(config)
8
- @config = config
5
+ # module Speaky
6
+ # class VectorstoreFaiss < VectorstoreBase
7
+ # def initialize(config)
8
+ # @config = config
9
9
 
10
- # check if the index path is set
11
- raise ArgumentError, 'index_path is required' unless @config[:index_path]
10
+ # # check if the index path is set
11
+ # raise ArgumentError, 'index_path is required' unless @config[:index_path]
12
12
 
13
- # load index from index_path if exists
14
- if File.exist?(@config[:index_path])
15
- @index = Faiss::Index.load(@config[:index_path])
16
- else
17
- # create a new index
18
- index = Faiss::IndexFlatL2.new(1536)
19
- @index = Faiss::IndexIDMap.new(index)
20
- @index.save(@config[:index_path])
21
- end
22
- end
13
+ # # load index from index_path if exists
14
+ # if File.exist?(@config[:index_path])
15
+ # @index = Faiss::Index.load(@config[:index_path])
16
+ # else
17
+ # # create a new index
18
+ # index = Faiss::IndexFlatL2.new(1536)
19
+ # @index = Faiss::IndexIDMap.new(index)
20
+ # @index.save(@config[:index_path])
21
+ # end
22
+ # end
23
23
 
24
- def add(id, data)
25
- embeddings = Speaky.llm.embed(data)
24
+ # def add(id, data)
25
+ # embeddings = Speaky.llm.embed(data)
26
26
 
27
- @index.add_with_ids([embeddings], [string_id_to_unique_int_id(id)])
27
+ # @index.add_with_ids([embeddings], [string_id_to_unique_int_id(id)])
28
28
 
29
- true
30
- end
29
+ # true
30
+ # end
31
31
 
32
- def remove(id)
33
- # remove is not supported by Faiss
34
- true
35
- end
32
+ # def remove(id)
33
+ # # remove is not supported by Faiss
34
+ # true
35
+ # end
36
36
 
37
- def query(question)
38
- # TODO: implement query
37
+ # def query(question)
38
+ # # TODO: implement query
39
39
 
40
- []
41
- end
40
+ # []
41
+ # end
42
42
 
43
- private
43
+ # private
44
44
 
45
- # This method is used to convert a string ID to a unique integer ID
46
- # that can be used by the Qdrant API.
47
- def string_id_to_unique_int_id(string_id)
48
- string_id.to_s.hash.abs
49
- end
50
- end
51
- end
45
+ # # This method is used to convert a string ID to a unique integer ID
46
+ # # that can be used by the Qdrant API.
47
+ # def string_id_to_unique_int_id(string_id)
48
+ # string_id.to_s.hash.abs
49
+ # end
50
+ # end
51
+ # end
@@ -1,3 +1,3 @@
1
1
  module Speaky
2
- VERSION = '0.1.8'
2
+ VERSION = '0.1.9'
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.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregorio Galante