> The code below is all you need to stream text with Chrome AI and the Vercel AI SDK. ... `chromeai` implements a Provider that uses `window.ai` under the hood
Leave it to Vercel to announce `window.ai` on Google's behalf by showing off their own abstraction but not the actual Chrome API.
Here's a blog post from a few days ago that shows how the actual `window.ai` API works [0]. The code is extremely simple and really shouldn't need a wrapper:
const model = await window.ai.createTextSession();
const result = await model.prompt("What do you think is the meaning of life?");
[0] https://afficone.com/blog/window-ai-new-chrome-feature-api/ replies(3):