You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/apis/phi-silica-tutorial.md
+25-21Lines changed: 25 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,14 @@
1
1
---
2
-
title: Get Started with a Phi Silica Walkthrough
3
-
description: Learn about the new Artificial Intelligence (AI) Phi Silica features and walk through tutorials
4
-
ms.topic: get-started
5
-
ms.date: 11/17/2025
2
+
title: "Tutorial: Build a chat app with Phi Silica and .NET MAUI"
3
+
description: Step-by-step guide to building a .NET MAUI app that uses the Phi Silica on-device language model for text generation and summarization.
4
+
ms.topic: tutorial
5
+
ms.date: 03/17/2026
6
6
dev_langs:
7
7
- csharp
8
8
- cpp
9
9
---
10
10
11
-
# Phi Silica walkthrough
11
+
# Tutorial: Build a chat app with Phi Silica and .NET MAUI
12
12
13
13
> [!IMPORTANT]
14
14
> The Phi Silica APIs are part of a Limited Access Feature (see [LimitedAccessFeatures class](/uwp/api/windows.applicationmodel.limitedaccessfeatures)). For more information or to request an unlock token, please use the [LAF Access Token Request Form](https://go.microsoft.com/fwlink/?linkid=2271232&c1cid=04x409).
@@ -20,7 +20,13 @@ This short tutorial walks through the [Windows AI API sample for .NET MAUI](http
20
20
21
21
## Prerequisites
22
22
23
-
Complete the steps for .NET MAUI described in the [Get started building an app with Windows AI APIs](get-started.md).
23
+
-**Copilot+ PC** with NPU — required for Phi Silica. See the [Copilot+ PCs developer guide](../npu-devices/index.md).
24
+
-**Windows 11 build 26100 or later** (25H2) — check with `winver`.
25
+
-**Developer Mode** enabled — Windows Settings → System → For developers → Developer Mode.
26
+
-**Visual Studio 2022** with the **Windows application development** workload.
27
+
-**Windows App SDK 2.0.0-preview1** — install via NuGet (`Microsoft.WindowsAppSDK` version `2.0.0-preview1`).
28
+
29
+
Complete the platform-specific steps for .NET MAUI described in the [Get started building an app with Windows AI APIs](get-started.md).
24
30
25
31
## Introduction
26
32
@@ -41,40 +47,38 @@ In the second file listed above, you'll find the following function, which demon
std::wstring inputText = L"This is a large amount of text I want to have summarized.";
68
+
std::wstring prompt = L"Summarize the following text concisely:\n\n" + inputText;
67
69
68
-
auto result = languageModel.GenerateResponseAsync(options, prompt).get();
70
+
auto result = languageModel.GenerateResponseAsync(prompt).get();
69
71
70
-
std::cout << result.Text() << std::endl;
72
+
std::wcout << result.Text() << std::endl;
71
73
```
72
74
75
+
> [!NOTE]
76
+
> The `LanguageModelSkill` enum (`Summarize`, `Rewrite`) is not available in Windows App SDK 2.0 preview. The examples above use prompt engineering — prepending an instruction to the input text — to achieve the same result. When the Skill API is released, you can replace the prompt construction with `new LanguageModelOptions { Skill = LanguageModelSkill.Summarize }`.
77
+
73
78
## Build and run the sample
74
79
75
80
1. Clone the [WindowsAppSDK-Samples](https://github.com/microsoft/WindowsAppSDK-Samples) repo.
76
-
1. Switch to the "release/experimental" branch.
77
-
1. Navigate to the [Samples/WindowsAIFoundry/cs-maui](https://github.com/microsoft/WindowsAppSDK-Samples/tree/release/experimental/Samples/WindowsAIFoundry/cs-maui) folder.
81
+
1. Navigate to the [Samples/WindowsAIFoundry/cs-maui](https://github.com/microsoft/WindowsAppSDK-Samples/tree/main/Samples/WindowsAIFoundry/cs-maui) folder.
78
82
1. Open MauiWindowsAISample.sln in Visual Studio 2022.
79
83
1. Ensure the debug toolbar has "Windows Machine" set as the target device.
80
84
1. Press F5 or select "Start Debugging" from the Debug menu to run the sample (the sample can also be run without debugging by selecting "Start Without Debugging" from the Debug menu or Ctrl+F5).
0 commit comments