Skip to content

Commit 00b7cf9

Browse files
committed
Update Graph SDK tutorial to point to AI page
1 parent 427aef4 commit 00b7cf9

File tree

2 files changed

+26
-3
lines changed

2 files changed

+26
-3
lines changed

hub/apps/windows-dotnet-maui/tutorial-graph-api.md

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,19 @@ ms.localizationpriority: medium
1111

1212
Get hands-on with .NET MAUI by building a cross-platform app on Windows that leverages the [Microsoft Graph SDK](/graph/sdks/sdks-overview) to display user data.
1313

14-
## Introduction
14+
In this tutorial, you learn how to:
1515

16-
In this tutorial, you'll learn how to create a .NET MAUI app for Windows in Visual Studio 2022 (17.3 or later) that loads some user data from [Microsoft Graph](/graph/). We will [authenticate](/graph/authenticationmethods-get-started) a Microsoft account with [Azure Identity](/graph/azuread-identity-access-management-concept-overview). The identity information, in the form of an MSAL token, will be used to authorize the Graph SDK call and get the display name for the authenticated user.
16+
> [!div class="checklist"]
17+
> * Set up your environment for .NET MAUI development and create a .NET MAUI project
18+
> * Register your client app in Azure
19+
> * Integrate with [Azure Identity](/graph/azuread-identity-access-management-concept-overview) and the Microsoft Graph SDK
20+
> * Update the user interface to display user information from [Microsoft Graph](/graph/)
21+
22+
## Prerequisites
23+
24+
* An Azure account with an active subscription. [Create an account for free](https://azure.microsoft.com/free/).
25+
* The .NET MAUI [installation requirements](/dotnet/maui/get-started/installation).
26+
* If you are new to .NET MAUI on Windows, you should start with the [Build your first .NET MAUI app for Windows](/windows/apps/windows-dotnet-maui/walkthrough-first-app) tutorial.
1727

1828
## Setting up the environment
1929

@@ -325,7 +335,13 @@ Run the app again and click the **Load User Info** button. You should see your u
325335

326336
To learn how to install and get started with the Microsoft Graph SDK in your .NET MAUI apps, see [Install the Microsoft Graph .NET SDK](/graph/sdks/sdk-installation#install-the-microsoft-graph-net-sdk).
327337

328-
## Related topics
338+
## Next steps
339+
340+
Advance to the next article to learn how to...
341+
> [!div class="nextstepaction"]
342+
> [Create a recommendation app with .NET MAUI and ChatGPT](tutorial-maui-ai.md)
343+
344+
## See also
329345

330346
[Resources for learning .NET MAUI](/dotnet/maui/get-started/resources)
331347

hub/apps/windows-dotnet-maui/tutorial-maui-ai.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,13 @@ It's time to add the code to our code-behind file that will use the ChatGptNet l
199199

200200
This code first checks to make sure the user has entered a location in the `Entry` control. If not, it displays an alert and returns. If the user has entered a location, it calls the `AskAsync` method on the ChatGptNet library to make a call to the OpenAI ChatGPT API. The `AskAsync` method takes two parameters: a `Guid` that identifies the user's session and a string containing the question to ask the API. The `AskAsync` method returns a `ChatGptResponse` object that contains the response from the API. We'll use the `GetMessage` method on the `ChatGptResponse` object to get the response text and display it in the `Label` control at the bottom of the UI.
201201

202+
1. Add the following `using` statements to the top of the **MainPage.xaml.cs** file:
203+
204+
```csharp
205+
using ChatGptNet;
206+
using ChatGptNet.Models;
207+
```
208+
202209
1. Run the app, enter a location, and test the recommendation buttons. You should see a response from the API in the `Label` control at the bottom of the UI:
203210

204211
![Windows .NET MAUI app with the UI for providing recommendations.](images/maui-chatgpt-ui-with-results.png)

0 commit comments

Comments
 (0)