0.1.0-dynamic • Published 9 months ago

nimblenet_react v0.1.0-dynamic

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

React-Native-Edge-Sdk

React package for NimbleNet

Installation

Before installing, make sure your github account has access to the edge-sdk-react-native npm package by following the instructions here to configure your project to authenticate to github and use the github npm registry.

Github npm registry authenticaton instructions

Install from the commandline

npm install @nimbleedge/nimblenet_react

Install via package.json

"@nimbleedge/nimblenet_react": "0.0.1"

Usage

Synchronous Init Call:

import { NativeModules } from 'react-native';
const { NimbleNet } = NativeModules;

NimbleNet.initialize(
                          "client-id",
                          "client-secret",
                          ["model_ids"],
                          "host",
                          "device_id",
                           ["featureStores"]
              )

Async Init

import { NativeModules } from 'react-native';
const { NimbleNet } = NativeModules;

NimbleNet.initializeAsync(
                          "client-id",
                          "client-secret",
                          ["model_ids"],
                          "host",
                          "device_id",
                           ["featureStores"],
                          (result)=>{
                                        if(result == Status.Success){
                                            console.log("initializeAsync Success")
                                        }else if(result == Status.Fallback){
                                            console.log("initializeAsync Fallback")
                                        }else {
                                            console.log("initializeAsync Failed")
                                        }
              )

Predict

Synchronous Call

import { NativeModules } from 'react-native';
const { NimbleNet } = NativeModules;

let data = NimbleNet.predict("modelId", ["inputs"])
console.log("outputs", data[outputs])

Async Call

import { NativeModules } from 'react-native';
const { NimbleNet } = NativeModules;

NimbleNet.predictAsync("modelId", ["inputs"],
                          (result, data)=>{
                                            if(result == Status.Success){
                                                console.log("predictAsync Success")
                                                console.log("outputs", data[outputs])
                                            }else if(result == Status.Fallback){
                                                console.log("predictAsync Fallback")
                                            }else {
                                                console.log("predictAsync Failed")
                                            }
                                }
              )

Contributing

See the contributing guide to learn how to contribute to the repository and the development workflow.

License

MIT


Made with create-react-native-library

edge-sdk-react-native