React Native Bindings
Native bridge modules over the cactus C API for iOS and Android.
Integration
cactus build --apple
cactus build --android
- Add the bridge files from this folder to your React Native app
- Add the raw bindings they depend on:
bindings/kotlin/ (Android), bindings/swift/ (Apple)
- Register the Android package in
MainApplication.kt:
override fun getPackages() = PackageList(this).packages.apply {
add(com.cactus.reactnative.CactusPackage())
}
Usage
import Cactus from './index';
const handle = await Cactus.init('/path/to/model', null, false);
const result = await Cactus.complete(handle, messagesJson, null, null, null, false);
await Cactus.destroy(handle);