Learn how to process audio files with the VLM Run Node.js SDK
audio
import { VlmRun } from "vlmrun"; const client = new VlmRun({ apiKey: "your-api-key", }); // Upload and process an audio file const file = await client.files.upload({ filePath: "path/to/audio.mp3", }); // Process audio using file ID const response = await client.audio.generate({ fileId: file.id, domain: "audio.transcription", });
interface FilePredictionParams extends PredictionGenerateParams { batch?: boolean; fileId?: string; url?: string; }
try { const response = await client.audio.generate({ url: "invalid-url", model: "vlm-1", }); } catch (error) { if (error instanceof ApiError) { console.error("API Error:", error.message); // Handle API-specific errors } else { console.error("File system error:", error); // Handle local file system errors } }