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
*[Visual Studio 2022](https://visualstudio.microsoft.com/)
14
+
*[Visual Studio Code](https://code.visualstudio.com) with [C# Dev Kit](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csdevkit)
15
15
16
16
## Install the .NET AI app template
17
17
@@ -31,10 +31,10 @@ After you install the AI app templates, you can use them to create starter apps
31
31
1. On the **Create a new project** screen, search for **AI Chat Web App**. Select the matching result and then choose **Next**.
32
32
1. On the **Configure your new project** screen, enter the desired name and location for your project and then choose **Next**.
33
33
1. On the **Additional information** screen:
34
-
- For the **Framework** option, select **.NET 9.0**.
35
-
- For the **AI service provider** option, select **Azure OpenAI**.
36
-
- Make sure the **Use keyless authentication for Azure services** checkbox is checked.
37
-
- For the **Vector store** option, select **Local on-disc (for prototyping)**.
34
+
* For the **Framework** option, select **.NET 9.0**.
35
+
* For the **AI service provider** option, select **Azure OpenAI**.
36
+
* Make sure the **Use keyless authentication for Azure services** checkbox is checked.
37
+
* For the **Vector store** option, select **Local on-disc (for prototyping)**.
38
38
1. Select **Create** to complete the process.
39
39
40
40
# [Visual Studio Code](#tab/visual-studio-code)
@@ -86,9 +86,9 @@ The AI template uses Microsoft Entra ID for seamless, keyless authentication. It
86
86
87
87
1. Assign a role to your developer account to access the Azure OpenAI resource:
88
88
89
-
- In the Azure Portal, navigate to the overview page of your Azure OpenAI resource.
90
-
- Select **Access control (IAM)** from the left navigation.
91
-
- [Add a role assignment](../../../azure/sdk/authentication/local-development-dev-accounts.md#assign-roles-to-the-group) for the `Azure AI Developer` role to your Azure account.
89
+
* In the Azure Portal, navigate to the overview page of your Azure OpenAI resource.
90
+
* Select **Access control (IAM)** from the left navigation.
91
+
* [Add a role assignment](../../../azure/sdk/authentication/local-development-dev-accounts.md#assign-roles-to-the-group) for the `Azure AI Developer` role to your Azure account.
92
92
93
93
1. [Sign-in to a local development tool](../../../azure/sdk/authentication/local-development-dev-accounts.md#sign-in-to-azure-using-developer-tooling) such as Visual Studio or the Azure CLI using the Azure account you assigned the `Azure AI Developer` role to.
The sample app you created is a Blazor Interactive Server web app preconfigured with common AI and data services. The app handles the following concerns for you:
1
+
The sample app you created is a Blazor Interactive Server web app preconfigured with common AI and data services. The app template handles the following concerns for you:
2
2
3
-
- Includes essential `Microsoft.Extensions.AI` packages and other dependencies in the `csproj` file to help you get started working with AI.
3
+
- Includes essential `Microsoft.Extensions.AI` packages and other dependencies in the `.csproj` file to help you get started working with AI.
4
4
- Creates various AI services and registers them for dependency injection in the `Program.cs` file:
5
-
- An `IChatClient` service to chat back and forth with the generative AI model
6
-
- An `IEmbeddingGenerator` service that's used to generate embeddings, which are essential for vector search functionality
7
-
- A `JsonVectorStore` to act as an in-memory vector store
8
-
- Registers a SQLite database context service to handle ingesting documents. The app is preconfigured to ingest whatever documents you add to the `Data` folder of the project, including the provided example files.
5
+
- An `IChatClient` service to chat back and forth with the generative AI model.
6
+
- An `IEmbeddingGenerator` service that's used to generate embeddings, which are essential for vector search functionality.
7
+
- A `JsonVectorStore` to act as an in-memory vector store.
8
+
- Registers a SQLite database context service to handle ingesting documents. The app is preconfigured to ingest whatever documents you add to the `wwwroot/Data` folder of the project, including the provided example files.
9
9
- Provides a complete chat UI using Blazor components. The UI handles rich formatting for the AI responses and provides features such as citations for response data.
*[Visual Studio 2022](https://visualstudio.microsoft.com/)
14
+
*[Visual Studio Code](https://code.visualstudio.com) with [C# Dev Kit](https://marketplace.visualstudio.com/items?itemName=ms-dotnettools.csdevkit)
15
15
16
16
## Install the .NET AI app template
17
17
@@ -79,20 +79,21 @@ The sample app you created is a Blazor Interactive Server web app preconfigured
79
79
80
80
## Configure access to GitHub Models
81
81
82
-
To authenticate to GitHub models from your code, you'll need to create a GitHub personal access token:
82
+
To authenticate to GitHub models from your code, you'll need to [create a GitHub personal access token](https://docs.github.com/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-fine-grained-personal-access-token):
83
83
84
-
1. Navigate to the **Personal access tokens** page of your GitHub account settings.
84
+
1. Navigate to the **Personal access tokens** page of your GitHub account settings under **Developer Settings**.
85
85
1. Select **Generate new token**.
86
-
1. Enter a **Token name** and then select **Generate token** at the bottom of the page.
86
+
1. Enter a name for the token, and under **Permissions**, set **Models** to **Access: Read-only**.
87
+
1. Select **Generate token** at the bottom of the page.
87
88
1. Copy the token for use in the steps ahead.
88
89
89
90
## Configure the app
90
91
91
-
The **AI Chat Web App** app is almost ready to go as soon as it's created. However, you'll need to configure the app to use the personal access token you setup for GitHub Modelsfor. By default, the app template searches for this value in the project's local .NET user secrets. You can manage user secrets using either the Visual Studio UI or the .NET CLI.
92
+
The **AI Chat Web App** app is almost ready to go as soon as it's created. However, you need to configure the app to use the personal access token you set up for GitHub Models. By default, the app template searches for this value in the project's local .NET user secrets. You can manage user secrets using either the Visual Studio UI or the .NET CLI.
92
93
93
94
# [Visual Studio](#tab/configure-visual-studio)
94
95
95
-
1. In Visual Studio, right-click on your project in the Solution Explorer and select "Manage User Secrets". This opens a `secrets.json` file where you can store your API keys without them being tracked in source control.
96
+
1. In Visual Studio, right-click on your project in the Solution Explorer and select **Manage User Secrets**. This opens a `secrets.json` file where you can store your API keys without them being tracked in source control.
0 commit comments