Given that Foundation Models focus on native Swift APIs, is there any supported bridge for a WebKit-based app to access the Language Model Protocol?
The Foundation Models framework doesn't provide any JavaScript interface, but it seems that you are asking how to run Swift code from web content in WKWebView. If that is the case, WebKit provides a mechanism (WKUserContentController) for a web app to run your app’s native code. You can check if that fit your use case. For further question about WebKit, please ask in the main forums.
Best,
——
Ziqiao Chen
Worldwide Developer Relations.