LocalAIHandler

external interface LocalAIHandler(source)

Functions

Link copied to clipboard
abstract external fun setPromptAPIHandler(promptAPIHandler: (details: PromptAPIHandlerDetails) -> Any?)

Sets the handler for new Prompt API binding requests from the renderer process. This happens once per pair of webContentsId and securityOrigin. Returning null from the handler will reject the creation of a new Prompt API session in the renderer. If you want to invalidate existing Prompt API sessions, clear the local AI handler for the session using ses.registerLocalAIHandler(null).