react-native-local-gen-ai
Version:
Local generative ai capabilities using mediapipe in react native
32 lines (30 loc) • 1.13 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.chatWithLLM = chatWithLLM;
exports.setModelOptions = setModelOptions;
exports.setModelPath = setModelPath;
var _reactNative = require("react-native");
const LINKING_ERROR = `The package 'react-native-local-gen-ai' doesn't seem to be linked. Make sure: \n\n` + _reactNative.Platform.select({
ios: "- You have run 'pod install'\n",
default: ''
}) + '- You rebuilt the app after installing the package\n' + '- You are not using Expo Go\n';
// @ts-expect-error
const isTurboModuleEnabled = global.__turboModuleProxy != null;
const LocalGenaiModule = isTurboModuleEnabled ? require('./NativeLocalGenai').default : _reactNative.NativeModules.LocalGenai;
const LocalGenai = LocalGenaiModule ? LocalGenaiModule : new Proxy({}, {
get() {
throw new Error(LINKING_ERROR);
}
});
function chatWithLLM(prompt) {
return LocalGenai.chatWithLLM(prompt);
}
function setModelPath(path) {
return LocalGenai.setModelPath(path);
}
function setModelOptions(options) {
return LocalGenai.setModelOptions(options);
}
//# sourceMappingURL=index.js.map