import { AutomaticSpeechRecognition } from "deepinfra";
import path from "path";
import { fileURLToPath } from "url";
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const DEEPINFRA_API_KEY = "$DEEPINFRA_TOKEN";
const MODEL = "openai/whisper-large-v3";
const client = new AutomaticSpeechRecognition(MODEL, DEEPINFRA_API_KEY);
const input = {
audio: path.join(__dirname, "audio.mp3"),
};
const response = await client.generate(input);
console.log(response.text);