import createRvencClient from "@premai/pcci-sdk-ts"; import fs from "fs"; const client = await createRvencClient({ apiKey: "your-api-key", }); const audioFile = fs.createReadStream("./audio-spanish.mp3"); const translation = await client.audio.translations.create({ file: audioFile, model: "openai/whisper-large-v3", }); console.log(translation.text);
const translation = await client.audio.translations.create({ file: audioFile, model: "openai/whisper-large-v3", prompt: "This is a business meeting discussing quarterly results and future plans.", }); console.log(translation.text);
const translation = await client.audio.translations.create({ file: audioFile, model: "openai/whisper-large-v3", response_format: "verbose_json", }); console.log({ text: translation.text, language: translation.language, duration: translation.duration, });