@sconedev/ai_toolkit
Version:
Simplify AI integration in web apps with local and offline model support
41 lines (40 loc) • 1.94 kB
TypeScript
import { configure } from './core/config';
import { chat, LocalChatMessage } from './core/chat';
import { generateImage } from './core/generateImage';
import { summarizePDF, summarizePDFBrowser, extractTextFromPDF, summarizeText } from './core/pdfSummarize';
import { runOnnxInference, OnnxModelConfig, OnnxModelError, OnnxRuntimeError, runModelFromPath, unloadOnnxModel, downloadModelForOfflineUse, isModelInCache, getAvailableExecutionProviders } from './core/onnxRuntime';
import { registerLocalModel, getLocalModel, listLocalModels, downloadAndRegisterModel } from './models/modelRegistry';
import * as pdfjs from 'pdfjs-dist';
export declare const aiToolkit: {
configure: typeof configure;
chat: typeof chat;
generateImage: typeof generateImage;
summarizePDF: typeof summarizePDF;
summarizePDFBrowser: typeof summarizePDFBrowser;
extractTextFromPDF: typeof extractTextFromPDF;
summarizeText: typeof summarizeText;
runModelFromPath: typeof runModelFromPath;
onnx: {
runModel: typeof runOnnxInference;
runLocalModel: typeof runModelFromPath;
unloadModel: typeof unloadOnnxModel;
getModels: () => string[];
getModelConfig: (name: string) => OnnxModelConfig;
downloadModel: typeof downloadModelForOfflineUse;
isModelCached: typeof isModelInCache;
getAvailableProviders: typeof getAvailableExecutionProviders;
registerLocalModel: typeof registerLocalModel;
getLocalModel: typeof getLocalModel;
listLocalModels: typeof listLocalModels;
downloadAndRegister: typeof downloadAndRegisterModel;
};
utils: {
extractTextFromPDF: typeof extractTextFromPDF;
};
errors: {
OnnxModelError: typeof OnnxModelError;
OnnxRuntimeError: typeof OnnxRuntimeError;
};
pdfjs: typeof pdfjs;
};
export { LocalChatMessage, pdfjs, OnnxModelConfig, OnnxModelError, OnnxRuntimeError };