Skip to content

Commit b90c209

Browse files
authored
Revise Prompt API & Writing Assistance APIs (#3454)
* landing, whether * whether: 2 items * fix Detailed Contents for Prompt * intro hyphen * sync toc title: Prompt * bold list items * global normize emdashes * resize png * optionally change * demo page step sequence
1 parent 26ca533 commit b90c209

10 files changed

Lines changed: 78 additions & 60 deletions

File tree

microsoft-edge/developer/index.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ landingContent:
5858
- text: Use origin trials in Microsoft Edge
5959
url: ../origin-trials/index.md
6060

61+
- text: Prompt a built-in language model with the Prompt API
62+
url: ../web-platform/prompt-api.md
63+
64+
- text: Summarize, write, and rewrite text with the Writing Assistance APIs
65+
url: ../web-platform/writing-assistance-apis.md
66+
6167
# -----------------------------------------------------------------------------
6268
# Card for toc bucket 3 - r1c2
6369
- title: Microsoft Edge DevTools

microsoft-edge/extensions-chromium/publish/create-dev-account.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ To add and manage users in the Microsoft Edge program to manage extensions, you
2323
| Type of account | Description |
2424
|---|---|
2525
| _Microsoft account (MSA)_ | An Outlook.com, Live.com, or Hotmail.com account. |
26-
| _GitHub account_ | A user account at GitHub.com. You can use your personal GitHub account to sign in to Partner Centera Microsoft account (MSA) will be created for you. |
26+
| _GitHub account_ | A user account at GitHub.com. You can use your personal GitHub account to sign in to Partner Centera Microsoft account (MSA) will be created for you. |
2727
| _Partner Center account_, _Partner Center developer account_ | A _Partner Center account_ is an account on partner.microsoft.com. To submit Microsoft Edge extensions, you need a _Partner Center developer account_, which is a Partner Center account that has a Microsoft account (MSA) as the Primary Owner. |
2828
| _Microsoft Edge Program account_ | Enables multiple users to work with Microsoft Edge extensions at Partner Center. |
2929
| _Microsoft Entra ID_ | A Microsoft Entra ID account; see [What is Microsoft Entra ID?](/entra/fundamentals/whatis) |

microsoft-edge/index.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,14 @@ conceptualContent:
209209
url: ./origin-trials/index.md
210210
itemType: whats-new
211211

212+
- text: Prompt a built-in language model with the Prompt API
213+
url: ./web-platform/prompt-api.md
214+
itemType: whats-new
215+
216+
- text: Summarize, write, and rewrite text with the Writing Assistance APIs
217+
url: ./web-platform/writing-assistance-apis.md
218+
itemType: whats-new
219+
212220
# -----------------------------------------------------------------------------
213221
# Card for toc bucket 3 - r1c2
214222
- title: Microsoft Edge DevTools

microsoft-edge/progressive-web-apps-chromium/how-to/offline.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,18 @@ The following table describes the different options, and the rest of this articl
1818

1919
| Storage option | Description |
2020
|:--- |:--- |
21-
| Web Storage | Web Storage has two types: session and local. Web Storage is useful to store small amounts of data from your app's front-end code. The data is structured as key-value pairs and is only available to the current app origin. In the case of session storage, the data is cleared when the session ends, for example when the app is closed, or when the user browses to another origin in the same window or tab. Local storage persists until the app removes the data. |
22-
| IndexedDB | IndexedDB is an API for storing larger amounts of structured data. The API is asynchronous and can be used both from your app's front-end code and service worker code. Use the IndexedDB API to store a significant amount of structured data on the client, or binary data, such as encrypted media objects or files. |
23-
| Cache | The Cache API can be used to manage cached resources. The Cache API is Promise-based and allows developers to store and retrieve many web resourcesHTML, CSS, JavaScript, images, JSON, and so on. Usually, the Cache API is used within the context of a service worker, but it's also available to your app's front-end code. |
21+
| Web Storage | Web Storage has two types: session and local. Web Storage is useful to store small amounts of data from your app's front-end code. The data is structured as key-value pairs and is only available to the current app origin. In the case of session storage, the data is cleared when the session ends, for example when the app is closed, or when the user browses to another origin in the same window or tab. Local storage persists until the app removes the data. |
22+
| IndexedDB | IndexedDB is an API for storing larger amounts of structured data. The API is asynchronous and can be used both from your app's front-end code and service worker code. Use the IndexedDB API to store a significant amount of structured data on the client, or binary data, such as encrypted media objects or files. |
23+
| Cache | The Cache API can be used to manage cached resources. The Cache API is Promise-based and allows developers to store and retrieve many web resourcesHTML, CSS, JavaScript, images, JSON, and so on. Usually, the Cache API is used within the context of a service worker, but it's also available to your app's front-end code. |
2424
| File System Access | The File System Access API allows your PWA to read files and folders on the user's device and save changes back to them. |
2525

26-
**Note**: Do not use WebSQL or Application Cache. While these are two other browser storage mechanisms, they have both been deprecated. Instead of WebSQL, use IndexedDB. Instead of Application Cache, use the Cache API.
26+
**Note**: Do not use WebSQL or Application Cache. While these are two other browser storage mechanisms, they have both been deprecated. Instead of WebSQL, use IndexedDB. Instead of Application Cache, use the Cache API.
2727

2828

2929
<!-- ====================================================================== -->
3030
## Web Storage
3131

32-
Web Storage is useful for storing small amounts of string data on the user's device. The simplicity of the key-value pair system of Web Storage makes it easy to use.
32+
Web Storage is useful for storing small amounts of string data on the user's device. The simplicity of the key-value pair system of Web Storage makes it easy to use.
3333

3434
Web Storage works synchronously in your app's main thread only. This means that Web Storage isn't available for use within service workers, and that heavy usage of Web Storage may create performance issues for your application.
3535

microsoft-edge/progressive-web-apps-chromium/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ To find examples of what PWAs can do, see [Myth Busting PWAs](https://www.davrou
9494
<!-- ====================================================================== -->
9595
## The Microsoft Store
9696

97-
Because Progressive Web Apps (PWAs) are just like other apps in the [Microsoft Store](https://apps.microsoft.com), users can fully engage with themfrom discovery, to installation, to execution—without<!-- em dashes--> ever opening the browser.
97+
Because Progressive Web Apps (PWAs) are just like other apps in the [Microsoft Store](https://apps.microsoft.com), users can fully engage with themfrom discovery, to installation, to execution — without ever opening the browser.
9898

9999
The Microsoft Store provides a trustworthy and familiar experience for users to install your app. Additionally, you can view detailed usage statistics and charts that let you know how your apps in the Microsoft Store are doing.
100100

microsoft-edge/progressive-web-apps-chromium/whats-new/pwa.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ We expect the [protocol handlers origin trial](#protocol-handlers-origin-trial)
245245
<!-- ====================================================================== -->
246246
## What's New in Microsoft Edge 94
247247

248-
Microsoft Edge version 94 moved to Stable on September 23, 2021. This release cycle was short—just<!-- em dash --> 3 weeks from Microsoft Edge 93 Stable to Microsoft Edge 94 Stable, as we snapped to the new [4-week release cycle](https://blogs.windows.com/msedgedev/2021/03/12/new-release-cycles-microsoft-edge-extended-stable/). This new release cadence matches the new cadence of Chromium milestones, described in [Speeding up Chrome's release cycle](https://blog.chromium.org/2021/03/speeding-up-release-cycle.html).
248+
Microsoft Edge version 94 moved to Stable on September 23, 2021. This release cycle was short — just 3 weeks from Microsoft Edge 93 Stable to Microsoft Edge 94 Stable, as we snapped to the new [4-week release cycle](https://blogs.windows.com/msedgedev/2021/03/12/new-release-cycles-microsoft-edge-extended-stable/). This new release cadence matches the new cadence of Chromium milestones, described in [Speeding up Chrome's release cycle](https://blog.chromium.org/2021/03/speeding-up-release-cycle.html).
249249

250250
Due to the shortened release cycle of Microsoft Edge version 94, we focused on stabilizing the release cycle logistics, and we shifted feature development to Microsoft Edge version 95.
251251

@@ -259,7 +259,7 @@ We expect the [protocol handlers origin trial](#protocol-handlers-origin-trial)
259259
<!-- ====================================================================== -->
260260
## What's New in Microsoft Edge 93
261261

262-
Microsoft Edge version 93 became the Stable channel of Microsoft Edge on September 2, 2021. This article lists updates we made to Progressive Web Apps (PWAs) from both a developer and consumer point of view.
262+
Microsoft Edge version 93 became the Stable channel of Microsoft Edge on September 2, 2021. This article lists updates we made to Progressive Web Apps (PWAs) from both a developer and consumer point of view.
263263

264264

265265
<!-- ------------------------------ -->

microsoft-edge/toc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
- name: Sign up for the Ad Selection API
6767
href: ./web-platform/ad-selection-api.md
6868

69-
- name: Prompting a built-in language model with the Prompt API
69+
- name: Prompt a built-in language model with the Prompt API
7070
href: ./web-platform/prompt-api.md
7171

7272
- name: Summarize, write, and rewrite text with the Writing Assistance APIs
-54 KB
Loading

microsoft-edge/web-platform/prompt-api.md

Lines changed: 44 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -10,40 +10,39 @@ ms.date: 05/19/2025
1010
# Prompt a built-in language model with the Prompt API
1111
<!-- https://aka.ms/edge-prompt-api-docs -->
1212

13-
The [Prompt API](https://github.com/webmachinelearning/prompt-api) is an experimental web API that allows you to prompt a small language model (SLM) that is built into Microsoft Edge, from your website's or browser extension's JavaScript code. Use the Prompt API to generate and analyze text or create application logic based on user input and discover innovative ways to integrate prompt engineering capabilities into your web application.
13+
The [Prompt API](https://github.com/webmachinelearning/prompt-api) is an experimental web API that allows you to prompt a small language model (SLM) that is built into Microsoft Edge, from your website's or browser extension's JavaScript code. Use the Prompt API to generate and analyze text or create application logic based on user input, and discover innovative ways to integrate prompt engineering capabilities into your web application.
1414

1515

1616
**Detailed contents:**
1717

18-
* [Prompt a built-in language model with the Prompt API](#prompt-a-built-in-language-model-with-the-prompt-api)
19-
* [Availability of the Prompt API](#availability-of-the-prompt-api)
20-
* [Alternatives to and benefits of the Prompt API](#alternatives-to-and-benefits-of-the-prompt-api)
21-
* [The Phi-4-mini model](#the-phi-4-mini-model)
22-
* [Disclaimer](#disclaimer)
23-
* [Hardware requirements](#hardware-requirements)
24-
* [Model availability](#model-availability)
25-
* [Enable the Prompt API](#enable-the-prompt-api)
26-
* [See a working example](#see-a-working-example)
27-
* [Use the Prompt API](#use-the-prompt-api)
28-
* [Check if the API is enabled](#check-if-the-api-is-enabled)
29-
* [Check if the model can be used](#check-if-the-model-can-be-used)
30-
* [Create a new session](#create-a-new-session)
31-
* [Monitor the progress of the model download](#monitor-the-progress-of-the-model-download)
32-
* [Provide the model with a system prompt](#provide-the-model-with-a-system-prompt)
33-
* [N-shot prompting with initialPrompts](#n-shot-prompting-with-initialprompts)
34-
* [Set topK and temperature](#set-topk-and-temperature)
35-
* [Clone a session to start the conversation again with the same options](#clone-a-session-to-start-the-conversation-again-with-the-same-options)
36-
* [Prompt the model](#prompt-the-model)
37-
* [Wait for the final response](#wait-for-the-final-response)
38-
* [Display tokens as they are generated](#display-tokens-as-they-are-generated)
39-
* [Constrain the model output by using a JSON schema or regular expression](#constrain-the-model-output-by-using-a-json-schema-or-regular-expression)
40-
* [Send multiple messages per prompt](#send-multiple-messages-per-prompt)
41-
* [Stop generating text](#stop-generating-text)
42-
* [Destroy a session](#destroy-a-session)
43-
* [Destroy a session by using the destroy() method](#destroy-a-session-by-using-the-destroy-method)
44-
* [Destroy a session by using an AbortController](#destroy-a-session-by-using-an-abortcontroller)
45-
* [Send feedback](#send-feedback)
46-
* [See also](#see-also)
18+
* [Availability of the Prompt API](#availability-of-the-prompt-api)
19+
* [Alternatives to and benefits of the Prompt API](#alternatives-to-and-benefits-of-the-prompt-api)
20+
* [The Phi-4-mini model](#the-phi-4-mini-model)
21+
* [Disclaimer](#disclaimer)
22+
* [Hardware requirements](#hardware-requirements)
23+
* [Model availability](#model-availability)
24+
* [Enable the Prompt API](#enable-the-prompt-api)
25+
* [See a working example](#see-a-working-example)
26+
* [Use the Prompt API](#use-the-prompt-api)
27+
* [Check if the API is enabled](#check-if-the-api-is-enabled)
28+
* [Check if the model can be used](#check-if-the-model-can-be-used)
29+
* [Create a new session](#create-a-new-session)
30+
* [Monitor the progress of the model download](#monitor-the-progress-of-the-model-download)
31+
* [Provide the model with a system prompt](#provide-the-model-with-a-system-prompt)
32+
* [N-shot prompting with initialPrompts](#n-shot-prompting-with-initialprompts)
33+
* [Set topK and temperature](#set-topk-and-temperature)
34+
* [Clone a session to start the conversation again with the same options](#clone-a-session-to-start-the-conversation-again-with-the-same-options)
35+
* [Prompt the model](#prompt-the-model)
36+
* [Wait for the final response](#wait-for-the-final-response)
37+
* [Display tokens as they are generated](#display-tokens-as-they-are-generated)
38+
* [Constrain the model output by using a JSON schema or regular expression](#constrain-the-model-output-by-using-a-json-schema-or-regular-expression)
39+
* [Send multiple messages per prompt](#send-multiple-messages-per-prompt)
40+
* [Stop generating text](#stop-generating-text)
41+
* [Destroy a session](#destroy-a-session)
42+
* [Destroy a session by using the destroy() method](#destroy-a-session-by-using-the-destroy-method)
43+
* [Destroy a session by using an AbortController](#destroy-a-session-by-using-an-abortcontroller)
44+
* [Send feedback](#send-feedback)
45+
* [See also](#see-also)
4746

4847

4948
<!-- ====================================================================== -->
@@ -69,23 +68,23 @@ To leverage AI capabilities in websites and browser extensions, you can also use
6968

7069
The Prompt API uses an SLM that runs on the same device where the inputs to and outputs of the model are used (that is, locally). This has the following benefits compared to cloud-based solutions:
7170

72-
* Reduced cost: there's no cost associated with using a cloud AI service.
71+
* **Reduced cost:** There's no cost associated with using a cloud AI service.
7372

74-
* Network independence: beyond the initial model download, there's no network latency when prompting the model, and may also be used when the device is offline.
73+
* **Network independence:** Beyond the initial model download, there's no network latency when prompting the model, and may also be used when the device is offline.
7574

76-
* Improved privacy: the data input to the model never leaves the device and is not collected to train AI models.
75+
* **Improved privacy:** The data input to the model never leaves the device and is not collected to train AI models.
7776

7877
The Prompt API uses a model that's provided by Microsoft Edge and built into the browser, which comes with the additional benefits over custom local solutions such as those based on WebGPU, WebNN, or WebAssembly:
7978

80-
* Shared one-time cost: the browser-provided model is downloaded the very first time the API is called and shared across all websites that run in the browser, reducing network costs for the user and developer.
79+
* **Shared one-time cost:** The browser-provided model is downloaded the very first time the API is called and shared across all websites that run in the browser, reducing network costs for the user and developer.
8180

82-
* Simplified usage for web developers: the built-in model can be run by using straightforward web APIs and doesn't require AI/ML expertise or using third-party frameworks.
81+
* **Simplified usage for web developers:** The built-in model can be run by using straightforward web APIs and doesn't require AI/ML expertise or using third-party frameworks.
8382

8483

8584
<!-- ====================================================================== -->
8685
## The Phi-4-mini model
8786

88-
The Prompt API allows you to prompt Phi-4-mini -- a powerful small language model that excels at text-based tasks -- built into Microsoft Edge. To learn more about Phi-4-mini and its capabilities, see the model card at [microsoft/Phi-4-mini-instruct](https://huggingface.co/microsoft/Phi-4-mini-instruct).
87+
The Prompt API allows you to prompt Phi-4-mini a powerful small language model that excels at text-based tasks built into Microsoft Edge. To learn more about Phi-4-mini and its capabilities, see the model card at [microsoft/Phi-4-mini-instruct](https://huggingface.co/microsoft/Phi-4-mini-instruct).
8988

9089

9190
<!-- ------------------------------ -->
@@ -167,13 +166,19 @@ To see the Prompt API in action, and review existing code that uses the API:
167166

168167
The Prompt API is only supported on devices that meet certain hardware requirements. For more information, see [Hardware requirements](#hardware-requirements), above.
169168

170-
1. Either use the provided default prompt and setting values or modify them by changing values such as **User prompt**, **System prompt**, **Response constraint schema**, **N-shot prompt instructions**, **TopK**, or **Temperature**.
169+
1. Optionally change the prompt settings values, such as:
170+
* **User prompt**
171+
* **System prompt**
172+
* **Response constraint schema**
173+
* **More settings** > **N-shot prompt instructions**
174+
* **TopK**
175+
* **Temperature**
171176

172177
1. Click the **Prompt** button, at the bottom of the page.
173178

174179
The response is generated in the response section of the page:
175180

176-
![Prompting and the Stop button](./prompt-api-images/prompting.png)
181+
![The Prompt demo page with settings and a Prompt button](./prompt-api-images/prompting.png)
177182

178183
1. To stop generating the response, at any time, click the **Stop** button.
179184

@@ -570,7 +575,7 @@ controller.abort();
570575
<!-- ====================================================================== -->
571576
## Send feedback
572577

573-
The Prompt API developer preview is intended to help discover use-cases for browser-provided language models. We're very interested in learning about the range of scenarios for which you intend to use the Prompt API, any issues with the API or language models, and whether more specific task-specific APIs, such as APIs for Writing Assistance or Translation, would be useful.
578+
The Prompt API developer preview is intended to help discover use-cases for browser-provided language models. We're very interested in learning about the range of scenarios for which you intend to use the Prompt API, any issues with the API or language models, and whether new task-specific APIs, such as for proofreading or translation, would be useful.
574579

575580
To send feedback about your scenarios and the tasks you want to achieve, please add a comment to [the Prompt API feedback issue](https://github.com/MicrosoftEdge/MSEdgeExplainers/issues/1012).
576581

0 commit comments

Comments
 (0)