UNPKG

genaiscript

Version:

A CLI for GenAIScript, a generative AI scripting framework.

27 lines (25 loc) 787 B
system({ description: "Video transcription tool", }) export default function (ctx: ChatGenerationContext) { const { defTool } = ctx defTool( "transcribe", "Generate a transcript from a audio/video file using a speech-to-text model.", { filename: { type: "string", description: "Audio/video URL or workspace relative filepath", }, }, async (args) => { const { filename } = args if (!filename) return "No filename provided" const { text, srt, error } = await transcribe(filename, { cache: "transcribe", }) if (error) return error.message return srt || text || "no response" } ) }