File tree Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Original file line number Diff line number Diff line change 1
1
namespace inference {
2
2
[Throws=SemanticError]
3
3
Semantic init_semantic(sequence<u8> model, sequence<u8> tokenizer_data);
4
+ Similarity get_cosine_similarity();
4
5
};
5
6
6
7
[Custom]
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ pub mod embedding;
3
3
pub mod similarity;
4
4
pub mod store;
5
5
6
+ use std:: sync:: Arc ;
6
7
// make the following types available in the generated bindings
7
8
pub use document:: Document ;
8
9
pub use document:: Metadata ;
@@ -19,5 +20,8 @@ pub use similarity::RelevanceScore;
19
20
pub use store:: EmbeddingStore ;
20
21
pub use store:: InMemoryEmbeddingStore ;
21
22
23
+ pub fn get_cosine_similarity ( ) -> Arc < dyn Similarity > {
24
+ Arc :: new ( CosineSimilarity { } )
25
+ }
22
26
23
27
uniffi:: include_scaffolding!( "inference" ) ;
You can’t perform that action at this time.
0 commit comments