UNPKG

web-ai-toolkit

Version:

AI powered features on the web made easy

74 lines (73 loc) 1.89 kB
async function s(e, n = "Xenova/whisper-tiny", r = !1, o = "en-US") { try { const { loadTranscriber: t, doLocalWhisper: a } = await import("./recognition-CBp2dMdi.js"); return await t(n, r, o), a(e, n); } catch (t) { return console.error(t), t; } } async function u(e) { try { const { runSynthesizer: n } = await import("./tts-OEr_Z1PZ.js"); return n(e); } catch (n) { return console.error(n), n; } } async function m(e, n = {}) { try { if ("Summarizer" in self && !n.model) { const { runNativeSummarizer: r } = await import("./native-summarization-BqqQYKNF.js"), { maxChunkLength: o = 1e3, overlap: t = 100, minChunkLength: a = 200, onProgress: c, ...i } = n; return r(e, i, o, t, a, c); } else { const { runSummarizer: r } = await import("./summarization-D8x26CkK.js"), { model: o = "Xenova/distilbart-cnn-6-6", maxChunkLength: t = 1e3, overlap: a = 100, minChunkLength: c = 200, onProgress: i } = n; return r(e, o, t, a, c, i); } } catch (r) { return console.error(r), r; } } async function l(e, n = "Xenova/trocr-small-printed") { try { const { runOCR: r } = await import("./ocr-BlO-UxbO.js"); return r(e, n); } catch (r) { return console.error(r), r; } } async function h(e, n = "Xenova/resnet-50") { try { const { runClassifier: r } = await import("./image-classification-DiFO8FIm.js"); return r(e, n); } catch (r) { return console.error(r), r; } } async function y(e, n) { try { const { simpleRAG: r } = await import("./rag-CjoKU-AY.js").then((o) => o.a); return r(e, n); } catch (r) { return console.error(r), r; } } export { h as classifyImage, y as doRAGSearch, l as ocr, m as summarize, u as textToSpeech, s as transcribeAudioFile };