1.0.20220728 • Published 2 years ago

@maxim_mazurok/gapi.client.ml v1.0.20220728

Weekly downloads
109
License
MIT
Repository
github
Last release
2 years ago

TypeScript typings for AI Platform Training & Prediction API v1

An API to enable creating and using machine learning models. For detailed description please check documentation.

Installing

Install typings for AI Platform Training & Prediction API:

npm install @types/gapi.client.ml@v1 --save-dev

Usage

You need to initialize Google API client in your code:

gapi.load('client', () => {
  // now we can use gapi.client
  // ...
});

Then load api client wrapper:

gapi.client.load('ml', 'v1', () => {
  // now we can use gapi.client.ml
  // ...
});

Don't forget to authenticate your client before sending any request to resources:

// declare client_id registered in Google Developers Console
var client_id = '',
  scope = [ 
      // See, edit, configure, and delete your Google Cloud data and see the email address for your Google Account.
      'https://www.googleapis.com/auth/cloud-platform',

      // View your data across Google Cloud services and see the email address of your Google Account
      'https://www.googleapis.com/auth/cloud-platform.read-only',
    ],
    immediate = true;
// ...

gapi.auth.authorize(
  { client_id: client_id, scope: scope, immediate: immediate },
  authResult => {
    if (authResult && !authResult.error) {
        /* handle successful authorization */
    } else {
        /* handle authorization error */
    }
});

After that you can use AI Platform Training & Prediction API resources:

/*
Performs explanation on the data in the request. {% dynamic include "/ai-platform/includes/___explain-request" %} 
*/
await gapi.client.ml.projects.explain({ name: "name",  });

/*
Get the service account information associated with your project. You need this information in order to grant the service account permissions for the Google Cloud Storage location where you put your model training code for training the model with Google Cloud Machine Learning.
*/
await gapi.client.ml.projects.getConfig({ name: "name",  });

/*
Performs online prediction on the data in the request. {% dynamic include "/ai-platform/includes/___predict-request" %} 
*/
await gapi.client.ml.projects.predict({ name: "name",  });
1.0.20220617

2 years ago

1.0.20220701

2 years ago

1.0.20220624

2 years ago

1.0.20220708

2 years ago

1.0.20220728

2 years ago

1.0.20220722

2 years ago

1.0.20220610

2 years ago

1.0.20220506

2 years ago

1.0.20220430

2 years ago

1.0.20220513

2 years ago

1.0.20220520

2 years ago

1.0.20220415

2 years ago

1.0.20220422

2 years ago

1.0.20220318

2 years ago

1.0.20220401

2 years ago

1.0.20220409

2 years ago

1.0.20220328

2 years ago

1.0.20220226

2 years ago

1.0.20220309

2 years ago

1.0.20220125

2 years ago

1.0.20220107

2 years ago

1.0.20220115

2 years ago

1.0.20220212

2 years ago

1.0.20211112

2 years ago

1.0.20211203

2 years ago

1.0.20211022

3 years ago

1.0.20210918

3 years ago

1.0.20210826

3 years ago

1.0.20210822

3 years ago

1.0.20210816

3 years ago

1.0.20210806

3 years ago

1.0.20210803

3 years ago

1.0.20210729

3 years ago

1.0.20210720

3 years ago

1.0.20210709

3 years ago

1.0.20210611

3 years ago

1.0.20210601

3 years ago

1.0.20210520

3 years ago

1.0.20210507

3 years ago

1.0.20210429

3 years ago

1.0.20210422

3 years ago

1.0.20210412

3 years ago

1.0.20210409

3 years ago

1.0.20210326

3 years ago

1.0.20210317

3 years ago

1.0.20210312

3 years ago

1.0.20210303

3 years ago

1.0.20210226

3 years ago

1.0.20210220

3 years ago

1.0.20210212

3 years ago

1.0.20210209

3 years ago

1.0.20210208

3 years ago

1.0.20210128

3 years ago

1.0.20210122

3 years ago

1.0.20210114

3 years ago

1.0.20210109

3 years ago

1.0.20201231

3 years ago

1.0.20201207

3 years ago

1.0.20201124

3 years ago

1.0.20201112

3 years ago

1.0.20201110

3 years ago