@lobehub/chat
Version:
Lobe Chat - an open-source, high-performance chatbot framework that supports speech synthesis, multimodal, and extensible Function Call plugin system. Supports one-click free deployment of your private ChatGPT/LLM web application.
14 lines (11 loc) • 349 B
text/typescript
import * as Comlink from 'comlink';
import type { PythonWorkerType } from './worker';
export const PythonInterpreter = (() => {
if (typeof Worker !== 'undefined') {
let worker = new Worker(new URL('worker.ts', import.meta.url), {
type: 'module',
});
return Comlink.wrap<PythonWorkerType>(worker);
}
return undefined;
})();