notmebotz-tools
Version:
Sebuah Tools yang berfungsi untuk mendownload Video atau Foto dari media sosial, serta sebagai tools yang berguna untuk aplikasi kamu seperti untuk BOT
34 lines (29 loc) • 755 B
JavaScript
const fs = require("fs");
const Groq = require("groq-sdk");
const groq = new Groq({
apiKey: "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"
});
async function transcript(prompt, audpath, lang) {
try {
const response = await groq.audio.transcriptions.create({
file: fs.createReadStream(audpath),
model: "whisper-large-v3",
prompt: prompt,
response_format: "json",
language: lang,
temperature: 0.0,
});
return {
author: "Herza",
status: 200,
data: response,
};
} catch (error) {
return {
author: "Herza",
status: 500,
error: error.message,
};
}
}
module.exports = { transcript };