A NodeJS wrapper for the Mojito AI API.
npm i mojitoai
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();
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