-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Chrome AI as a Provider for our text generation Features #819
base: develop
Are you sure you want to change the base?
Conversation
@@ -45,6 +46,7 @@ public function __construct() { | |||
ChatGPT::ID => __( 'OpenAI ChatGPT', 'classifai' ), | |||
GeminiAPI::ID => __( 'Google AI (Gemini API)', 'classifai' ), | |||
OpenAI::ID => __( 'Azure OpenAI', 'classifai' ), | |||
ChromeAI::ID => __( 'Chrome AI', 'classifai' ), // TODO: only add this Provider if the browser supports AI. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right now this Provider shows up even if your browser doesn't support Chrome AI. Would be great to remove it but doesn't cause any problems if you do select it. With the settings refactor in #502, I think will be much easier to remove this since all settings are registered in javascript at that point, so may leave this until it's integrated in there
Description of the Change
Chrome is experimenting with adding built-in AI to their browser. The model they include is fairly lightweight and doesn't give quite as good results as larger models, but since it's built-in, there's no cost and all data stays private (also allows easy testing of some AI features without having to sign up for something).
At the moment, this feature is still being worked on and is only available in Chrome Canary, so there's a chance this never releases publicly or it may change quite a bit before the public release.
This PR integrates this browser AI API into our Title Generation, Excerpt Generation and Content Resizing Features. Because this API is 100% javascript, the way we integrate is a little unique compared to our other Providers:
How to test the Change
chrome://flags/#optimization-guide-on-device-model
and select Enabled BypassPerfRequirementchrome://flags/#prompt-api-for-gemini-nano
and select Enabled(await ai.languageModel.capabilities()).available;
in the consoleawait ai.languageModel.create();
in the console. This will likely fail but it’s intendedchrome://components
Optimization Guide On Device Model
present with a version greater or equal to 2024.5.21.1031. If there is no version listed, click on Check for update to force the download(await ai.languageModel.capabilities()).available;
in the console. If this returns “readily”, then you are all setChangelog Entry
Credits
Props @dkotter, @jeffpaul, @iamdharmesh, @faisal-alvi
Checklist: