alexanderatallah / window.ai

Use your own AI models on the web
https://windowai.io
MIT License
769 stars 68 forks source link

Conflict with Google Chrome window.ai API #79

Open niutech opened 1 week ago

niutech commented 1 week ago

Google Chrome has recently added the built-in ´window.ai´ API which conflicts with this API. Do you have any ideas how to solve it?

MiguelsPizza commented 4 days ago

seems like it would make the most sense to overwrite and match the native API

niutech commented 4 days ago

Here you can find the Prompt API explainer: https://github.com/explainers-by-googlers/prompt-api

MiguelsPizza commented 2 days ago

I threw together a quick Polyfill for the current spec. You can interact with by running the dev server on this branch

[chrome spec polyfill fork](https://github.com/alexanderatallah/window.ai/pull/81

I changed up the streaming api a bit. Chrome's current implementation appends all the previous chunks on each new chunk which seems like a mistake