This project is a Node.js client for the ShenMind AI API, aiming to provide users with a convenient way to access the ShenMind API, explore and utilize AI models, and develop their own applications.
You can install the package directly via npm:
npm install shenmind
You can retrieve your personal API token from the User Dashboard and configure it as follows:
export SHENMIND_API_TOKEN=xxxxxxxxxxxxxxxxxxxx
const shenmind = require('shenmind');
async function main() {
const modelId = 'yP1jM07UrYuQ6xHZ-lqYSQ==';
const files = {
'image_path': 'test.png'
};
const params = {
'prompt': 'the product is for sale'
};
const prediction = await shenmind.run(modelId, files, params, waitResult = true);
console.log(prediction);
}
main();
const shenmind = require('shenmind');
async function main() {
const predictionId = 'HkzotuoaEy3rcsCLK8WRyQ==';
const predictionOutput = await shenmind.getPredictionOutput(predictionId);
console.log(predictionOutput);
}
main();
const shenmind = require('shenmind');
async function main() {
const predictionId = 'HkzotuoaEy3rcsCLK8WRyQ==';
const predictionOutput = await shenmind.cancelPrediction(predictionId);
console.log(predictionOutput);
}
main();