0

Here is a quick link to the Clarifai api I am trying to use

https://clarifai.com/developer/quick-start/

I have uninstalled the npm module npm install clarifai --save

For some reason I am not able to import and use the api similar to the way it is in the documentation for the JS code example.

How to do the similar thing as below JS code in Ionic-Angular applicaiton :

// instantiate a new Clarifai app passing in your api key.
const app = new Clarifai.App({
 apiKey: 'YOUR_API_KEY'
});

// predict the contents of an image by passing in a url
app.models.predict(Clarifai.GENERAL_MODEL, 
'https://samples.clarifai.com/metro-north.jpg').then(
  function(response) {
    console.log(response);
  },
  function(err) {
    console.error(err);
  }
);
techbum
  • 61
  • 1
  • 7

0 Answers0