mojitoai

1.0.4 • Public • Published

Mojito AI Client

A NodeJS wrapper for the Mojito AI API.

Installation

npm i mojitoai

Usage

First, set your API key and API url in your environment variables:

export MOJITOAI_API_KEY='your_api_key_here'
export MOJITOAI_API_URL=""

Then, you can use the library like this:

const { MojitoAI } = require('mojitoai');

const client = new MojitoAI();

async function main() {
    actionParams = {
        actionName: 'searchInfo',
        userId: 'user_id',
        userRequest: 'Which movie has Benedict Cumberbatch rocking some wild supernatural powers?',
        context: {},
        extraParams: null
    };
    let response = await client.performAction(actionParams)
    console.log(response.choices[0].message.content);
}

main();

Project structure:

mojito-ai-client-nodejs/
    LICENSE
    README.md
    .gitignore
    package-lock.json
    package.json
    .env
    tests/
        test_api.js
    src/
        index.js
        models.js
        api.js

Readme

Keywords

none

Package Sidebar

Install

npm i mojitoai

Weekly Downloads

16

Version

1.0.4

License

ISC

Unpacked Size

30.3 kB

Total Files

7

Last publish

Collaborators

  • ntohidi