File size: 526 Bytes
afb64c7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package cactus:needle@3.0.0;

interface engine {
  record failure {
    code: s32,
    message: string,
  }

  load: func(model: list<u8>) -> result<_, failure>;
  init: func(
    system-prompt: option<string>,
    tools-json: option<string>,
    tool-index-path: option<string>,
  ) -> result<u32, failure>;
  complete: func(
    input: string,
    max-new-tokens: u32,
  ) -> result<string, failure>;
  embed: func(
    input: string,
  ) -> result<list<f32>, failure>;
  reset: func();
}

world needle {
  export engine;
}