npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

aimpedapi-js

v1.0.1

Published

Aimped API Integration Library

Downloads

1

Readme

aimped

aimped is a Nodejs library used for Aimped Api integrations.

Installation

Use the package manager npm to install aimped.

npm install aimpedapi-js

Documentation

A folder named docs will be genereated. You can examine the documentation by selecting the index.html in this folder.

npm i -g jsdoc
yarn doc

Clone

Use the git to clone aimpedapijs.

git clone https://github.com/aimped-ai/aimpedapi-js.git

Configuration of the Library

// require aimped
const Aimped = require('aimpedapi-js');

// Create new class Aimped
const userKey = ''; // Userkey received from A3M.
const userSecret = ''; // userSecret received from A3M.
const BASE_URL = 'https://aimped.ai', // Aimped domain url

const Aimped = new Aimped(userKey, userSecret, {
  baseUrl: BASE_URL,
});

Preparation of the model input data

const modelId = "" ; // id of the model to run
const inputData = {...} ;// input information, can be checked from model description

Usage of API Function

const runModel = async () => {
  try {
    const result = await Aimped.runModel(modelId, inputData);
    console.log(JSON.stringify(result));
  } catch (error) {
    console.log(error);
  }
};

Usage of API Callback Function

// return callback function

const runModelCallback = async () => {
  Aimped.runModelCallback(modelId, inputData, (e) => {
    const { event, message, time, data } = e;
    switch (event) {
      case 'start':
        console.log(modelId, time, message);
        break;

      case 'proccess':
        console.log(modelId, time, message);
        break;

      case 'error':
        console.log(modelId, time, message);
        break;
      case 'end':
        console.log(modelId, time, message, JSON.stringify(data));
        break;

      default:
        break;
    }
  });
};

Usage of API File Upload

Some of the models supports file inputs. These inputs are accepted as URIs. Here is the usage of API for file uploads.

const runModelFileUpload = async () => {
  await Aimped.getAllData();
  const result = await AIMPED.fileUpload(
    modelId,
    '/Users/joe/Downloads/xyz.pdf' // sample file path to upload
  );
  console.log(await result);
};

Usage of API File Download

Some of the models supports file outputs as result. These outputs are created as URIs. Here is the usage of API for file downloads.

const runModelFileDownload = async () => {
  const result = await AIMPED.fileDownloadAndSave(
    'input/application/model_{{modelId}}/user_{{userId}}/file_name', // URI of the model input file or model run output file in the result
    `/Users/joe/Downloads/${new Date().getTime()}file_name` // sample local file path to save
  );
  console.log(await result);
};

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT