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: common/microsoft-extensions-ai-integration/AIPromptIntegration/readme.md
+5-12Lines changed: 5 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -2,7 +2,7 @@
2
2
3
3
## Overview
4
4
5
-
This project demonstrates the [integration of the `Microsoft.Extensions.AI` package with the `AIPrompt` component](https://www.telerik.com/blazor-ui/documentation/common-features/microsoft-extensions-ai-integration). The integration enables AI-powered interactions leveraging the built-in [`IChatClient` service](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.ai.ichatclient?view=net-9.0-pp). The example uses **Azure OpenAI**, but you can use any service supported by `Microsoft.Extensions.AI`.
5
+
This project demonstrates the [integration of the `Microsoft.Extensions.AI` package with the `AIPrompt` component](https://www.telerik.com/blazor-ui/documentation/common-features/microsoft-extensions-ai-integration). The integration enables AI-powered interactions leveraging the built-in [`IChatClient` service](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.ai.ichatclient?view=net-9.0-pp). The example shows how to use the [various models supported by `Microsoft.Extensions.AI`](https://devblogs.microsoft.com/dotnet/introducing-microsoft-extensions-ai-preview/#chat).
6
6
7
7
## About `Microsoft.Extensions.AI`
8
8
@@ -11,25 +11,18 @@ The [`Microsoft.Extensions.AI` package](https://learn.microsoft.com/en-us/dotnet
11
11
## Integration with `AIPrompt` Component
12
12
13
13
- The [`AIPrompt` component](https://www.telerik.com/blazor-ui/documentation/components/aiprompt/overview) is configured to use `Microsoft.Extensions.AI` for AI-driven prompts.
14
-
- The project registers an[`IChatClient`service](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.ai.ichatclient?view=net-9.0-pp) in the `Program.cs` file.
14
+
- The project registers several[`IChatClient`services](https://learn.microsoft.com/en-us/dotnet/api/microsoft.extensions.ai.ichatclient?view=net-9.0-pp) in the `Program.cs` file - one for each model supported by `Microsoft.Extensions.AI`.
15
15
- The [`OnPromptRequest` event](https://www.telerik.com/blazor-ui/documentation/components/aiprompt/events#onpromptrequest) of the `AIPrompt` is not handled, so the component will automatically use the registered `IChatClient` service to generate a response.
16
-
-**Azure OpenAI** is used as the AI provider for generating responses.
17
16
18
17
## Setup & Configuration
19
18
20
-
To run the project successfully, you need to provide your **Azure OpenAI URI**and **API key**. The steps apply to using **Azure Open AI** and the configuration may be different if you are using a different model. Refer to the official Microsoft documentation to see how to configure other models.
19
+
To run the project successfully, you need to provide your endpoint and credentials for the model you want to use.
21
20
22
21
### Steps:
23
22
24
23
1. Open the `Program.cs` file.
25
-
2. Locate the `IChatClient` service registration.
24
+
2. Locate the `IChatClient` service registration that uses your preferred model.
26
25
3. Uncomment the service registration.
27
-
3. Replace the placeholder values with your actual Azure OpenAI endpoint and API key:
0 commit comments