@graphty/graphty-element / ai / getWebLlmProviderClass
Function: getWebLlmProviderClass() ​
getWebLlmProviderClass():
Promise<typeofWebLlmProvider>
Defined in: graphty-element/src/ai/providers/index.ts:47
Dynamically load the WebLlmProvider class. This is the recommended way to access WebLlmProvider to avoid Safari compatibility issues. The module is only loaded when this function is called, preventing issues on browsers where @mlc-ai/web-llm is not installed.
Returns ​
Promise<typeof WebLlmProvider>
Promise resolving to the WebLlmProvider class
Example ​
ts
const WebLlmProvider = await getWebLlmProviderClass();
const provider = new WebLlmProvider();