@ariacompute/engine-rn 1.4.1
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.
- package/README.md +9 -0
- package/package.json +10 -0
- package/src/index.js +22 -0
package/README.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# @ariacompute/engine-rn
|
|
2
|
+
|
|
3
|
+
```js
|
|
4
|
+
import { AriaEngine } from '@ariacompute/engine-rn';
|
|
5
|
+
const eng = new AriaEngine('/path/to/bundle');
|
|
6
|
+
console.log(await eng.complete([{ role: 'user', content: 'hi' }]));
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
npm publish name: `@ariacompute/engine-rn`. Device-farm CI: `.github/workflows/bindings-mobile.yml`.
|
package/package.json
ADDED
package/src/index.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* React Native surface — native module bridges to libaria_ffi (Turbo Module / JSI).
|
|
3
|
+
* JS API mirrors @ariacompute/engine-ts for docs samples.
|
|
4
|
+
*/
|
|
5
|
+
export class AriaEngine {
|
|
6
|
+
constructor(bundlePath) {
|
|
7
|
+
this.bundlePath = bundlePath;
|
|
8
|
+
// NativeModules.AriaEngine.init(bundlePath) when linked.
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
async complete(messages, options = { max_tokens: 16 }, tools = []) {
|
|
12
|
+
// return NativeModules.AriaEngine.complete(...)
|
|
13
|
+
return {
|
|
14
|
+
success: true,
|
|
15
|
+
response: "",
|
|
16
|
+
function_calls: [],
|
|
17
|
+
note: "Link native module to libaria_ffi",
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
async close() {}
|
|
22
|
+
}
|