←back to thread

229 points modinfo | 1 comments | | HN request time: 0.408s | source
Show context
lolinder ◴[] No.40834980[source]
> 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): >>40835027 #>>40835359 #>>40835578 #
kinlan ◴[] No.40835578[source]
Fwiw, this is a very experimental API and we're not really promoting this as we know the API shape will have to change. It's only available by enabling a flag so we're working with a lot of developers via the preview program (link below)

Overview: https://developer.chrome.com/docs/ai/built-in

Sign-up: https://docs.google.com/forms/d/e/1FAIpQLSfZXeiwj9KO9jMctffH...

replies(1): >>40869695 #
1. niutech ◴[] No.40869695[source]
Finally there is the Prompt API explainer: https://github.com/explainers-by-googlers/prompt-api