1.5.2 • Published 28 days ago
m7r.ai v1.5.2
m7r.ai is a package that provides an interface to interact with different AI models through the use of a custom API. This package allows users to submit questions and inquiries, and provides reasonable answers using the specified forms. Examples
Examples
Normal Usage
{ m7rai } = require('m7r.ai');
async function exampleNormalUsage() {
try {
const response = await m7rai("What is the capital of France?");
console.log(response); // Output: "The capital of France is Paris."
} catch (error) {
console.error("Error:", error.message);
}
}
exampleNormalUsage();
discord js
client.on('messageCreate', async message => {
if (message.content.startsWith('!question')) {
const question = message.content.slice('!question'.length).trim();
try {
const response = await m7rai(question, "gemini");
message.reply(response);
} catch (error) {
console.error("Error:", error.message);
message.reply("Sorry, I couldn't find an answer to your question.");
}
}
});