
Bug: 375959783 Change-Id: I33222b331a96b6b305005fb93b452ef198426f36 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5981554 Reviewed-by: Fergal Daly <fergal@chromium.org> Commit-Queue: Fergal Daly <fergal@chromium.org> Cr-Commit-Position: refs/heads/main@{#1376775}
1.8 KiB
Prompt API for extension
- Contact: builtin-ai@chromium.org
This document describes the status of the current implementation of the Prompt API for Chrome extension, and how to verify.
Note that this API is not available by default. Chrome plans to do an extension origin trial starting from M131 to evaluate its effectiveness and to allow extension authors to give feedback.
What’s supported
The API is implemented according to the
explainer, but the
API namespace will be under chrome.aiOriginTrial.languageModel
for the
extension origin trial.
Activation
The API can be enabled by participating in the
extension origin trial
named AIPromptAPIForExtension
. After obtaining the trial token, the
extension authors need to configure it in the manifest.json
together with
the aiLanguageModelOriginTrial
permission.
{
"permissions": ["aiLanguageModelOriginTrial"],
"trial_tokens": [<GENERATED_TOKEN>],
}
Verifying the API is working
The extension authors can verify if the API is available by checking the
chrome.aiOriginTrial.languageModel
from the service worker script.
If the AILanguageModel
object is defined, the authors can follow the
explainer to test
the APIs usage.