Skip to content

Commit 63c6133

Browse files
Merge remote-tracking branch 'origin/development' into development
2 parents 3997524 + 1079d2e commit 63c6133

File tree

257 files changed

+5450
-4535
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

257 files changed

+5450
-4535
lines changed

blazor-toc.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@
496496
<li>AI Integrations
497497
<ul>
498498
<li><a href="/blazor/ai-assistview/ai-integrations/gemini-integration">Google Gemini</a></li>
499-
<li><a href="/blazor/ai-assistview/ai-integrations/openai-integration">Azure Open AI</a></li>
499+
<li><a href="/blazor/ai-assistview/ai-integrations/openai-integration">Azure OpenAI</a></li>
500500
</ul>
501501
</li>
502502
<li><a href="/blazor/ai-assistview/toolbar-items">Toolbar items</a></li>

blazor/ai-assistview/ai-integrations/gemini-integration.md

Lines changed: 29 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -7,55 +7,61 @@ control: AI AssistView
77
documentation: ug
88
---
99

10-
# Gemini AI With Blazor AI AssistView component
10+
# Integrate Gemini AI With Blazor AI AssistView component
1111

12-
The Syncfusion AI AssistView supports integration with [Gemini](https://ai.google.dev/gemini-api/docs/quickstart), enabling advanced conversational AI features in applications.
12+
The AI AssistView component integrates with Google’s [Gemini](https://ai.google.dev/gemini-api/docs/quickstart) API to deliver intelligent conversational interfaces. It leverages advanced natural language understanding to interpret user input, maintain context throughout interactions, and provide accurate, relevant responses. By configuring secure authentication and data handling, developers can unlock powerful AI-driven communication features that elevate user engagement and streamline support experiences.
1313

1414
## Prerequisites
1515

16-
* Google account to generate an API key for accessing [Gemini AI](https://ai.google.dev/gemini-api/docs/quickstart)
17-
* Syncfusion AI AssistView for Blazor package [Syncfusion.Blazor.InteractiveChat](https://www.nuget.org/packages/Syncfusion.Blazor.InteractiveChat) installed in the project.
18-
* [Markdig](https://www.nuget.org/packages/Markdig) package available in the project for Markdown-to-HTML conversion (required by the sample code).
16+
Before starting, ensure you have the following:
1917

20-
## Getting Started with the AI AssistView Component
18+
* **Google Account**: For generating a Gemini API key.
2119

22-
Before integrating Gemini AI, ensure that the Syncfusion AI AssistView renders correctly in the application and that prerequisites are met:
20+
* **Syncfusion AI AssistView**: Package [Syncfusion Blazor package](https://www.nuget.org/packages/Syncfusion.Blazor.InteractiveChat) installed.
2321

24-
[Blazor Getting Started Guide](../getting-started)
22+
* [Markdig](https://www.nuget.org/packages/Markdig) package: For parsing Markdown responses.
23+
24+
## Set Up the AI AssistView Component
25+
26+
Follow the Syncfusion AI AssistView [Getting Started](../getting-started) guide to configure and render the AI AssistView component in the application and that prerequisites are met.
2527

2628
## Install Dependencies
2729

28-
Install the Syncfusion Blazor package in the application.
30+
Install the required packages:
31+
32+
1. Install the `Gemini AI` nuget package in the application.
2933

3034
```bash
3135

32-
Nuget\Install-Package Syncfusion.Blazor.InteractiveChat
36+
Nuget\Install-Package Mscc.GenerativeAI
3337

3438
```
3539

36-
Install the Gemini AI package in the application.
40+
2. Install the `Markdig` nuget packages in the application.
3741

3842
```bash
3943

40-
Nuget\Install-Package Mscc.GenerativeAI
44+
Nuget\Install-Package Markdig
4145

4246
```
4347

4448
## Generate API Key
4549

46-
1. Go to [Google AI Studio](https://aistudio.google.com/app/api-keys) and sign in with a google account. Create a new account if needed.
50+
1. **Access Google AI Studio**: Instructs users to sign into [Google AI Studio](https://aistudio.google.com/app/apikey) with a Google account or create a new account if needed.
4751

48-
2. Select `Get API key` from the left menu or the top-right of the dashboard.
52+
2. **Navigate to API Key Creation**: Go to the `Get API Key` option in the left-hand menu or top-right corner of the dashboard. Click the `Create API Key` button.
4953

50-
3. Choose `Create API key`. Select an existing google cloud project or create a new one, then proceed.
54+
3. **Project Selection**: Choose an existing Google Cloud project or create a new one.
5155

52-
4. After creating or selecting a project, an API key is generated and displayed. Copy the key and store it securely, as it may be shown only once.
56+
4. **API Key Generation**: After project selection, the API key is generated. Users are instructed to copy and store the key securely, as it is shown only once.
5357

54-
> Security note: Do not commit API keys to version control. Use environment variables, a secret manager, or a server-side proxy in production.
58+
> Security note: Advises against committing the API key to version control and recommends using environment variables or a secret manager in production.
5559
5660
## Gemini AI with AI AssistView
5761

58-
* Add the generated API key in the following line.
62+
Modify the Razor file to integrate the Gemini AI with the AI AssistView component.
63+
64+
* update your Gemini API key securely in the configuration:
5965

6066
```bash
6167

@@ -72,6 +78,7 @@ const string GeminiApiKey = 'Place your API key here';
7278
@using Markdig
7379

7480
<div class="aiassist-container" style="height: 350px; width: 650px;">
81+
// Initializes the AI Assist component
7582
<SfAIAssistView @ref="sfAIAssistView" ID="aiAssistView" PromptSuggestions="@promptSuggestions" PromptRequested="@OnPromptRequest">
7683
<AssistViews>
7784
<AssistView>
@@ -98,13 +105,15 @@ const string GeminiApiKey = 'Place your API key here';
98105
"What are the best tools for organizing my tasks?",
99106
"How can I maintain work-life balance effectively?"
100107
};
108+
// Initialize Gemini API
101109
private readonly string geminiApiKey = "";
110+
// Handle user prompt: call Gemini model
102111
private async Task OnPromptRequest(AssistViewPromptRequestedEventArgs args)
103112
{
104113
try
105114
{
106-
var gemini = new GoogleAI(apiKey: geminiApiKey);
107-
var model = gemini.GenerativeModel(model: "gemini-1.5-flash");
115+
var gemini = new GoogleAI(apiKey: geminiApiKey); // Replace with your Gemini API key
116+
var model = gemini.GenerativeModel(model: "gemini-2.5-flash"); // Select the Gemini model (update model name as needed)
108117
var response = await model.GenerateContent(args.Prompt);
109118
var responseText = response.Text;
110119
var pipeline = new MarkdownPipelineBuilder()

blazor/ai-assistview/ai-integrations/openai-integration.md

Lines changed: 34 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,57 +1,65 @@
11
---
22
layout: post
3-
title: Azure Open AI with Blazor AI AssistView Component | Syncfusion
4-
description: Checkout and learn about Azure Open AI with Blazor AI AssistView component in Blazor WebAssembly Application.
3+
title: Azure OpenAI with Blazor AI AssistView Component | Syncfusion
4+
description: Checkout and learn about Azure OpenAI with Blazor AI AssistView component in Blazor WebAssembly Application.
55
platform: Blazor
66
control: AI AssistView
77
documentation: ug
88
---
99

10-
# Azure OpenAI With Blazor AI AssistView component
10+
# Integrate Azure OpenAI with Blazor AI AssistView component
1111

12-
The Syncfusion AI AssistView supports integration with [Azure Open AI](https://microsoft.github.io/PartnerResources/skilling/ai-ml-academy/resources/openai), enabling advanced conversational AI features in your applications.
12+
The AI AssistView component integrates with [Azure OpenAI](https://microsoft.github.io/PartnerResources/skilling/ai-ml-academy/resources/openai) to enable advanced conversational AI features in your applications. The component acts as a user interface, where user prompts are sent to the Azure OpenAI service via API calls, providing natural language understanding and context-aware responses.
1313

1414
## Prerequisites
1515

16-
- An Azure account with access to [Azure Open AI](https://microsoft.github.io/PartnerResources/skilling/ai-ml-academy/resources/openai) services and a generated API key.
17-
- Syncfusion AI AssistView for Blazor [Syncfusion.Blazor.InteractiveChat](https://www.nuget.org/packages/Syncfusion.Blazor.InteractiveChat) installed in the project
16+
Before starting, ensure you have the following:
1817

19-
## Getting Started with the AI AssistView Component
18+
* **An Azure account**: with access to [Azure OpenAI](https://microsoft.github.io/PartnerResources/skilling/ai-ml-academy/resources/openai) services and a generated API key.
2019

21-
Before integrating Azure OpenAI, ensure the Syncfusion AI AssistView component renders correctly in the application:
20+
* **Syncfusion AI AssistView**: Package [Syncfusion Blazor package](https://www.nuget.org/packages/Syncfusion.Blazor.InteractiveChat) installed.
2221

23-
[Blazor Getting Started Guide](../getting-started)
22+
* [Markdig](https://www.nuget.org/packages/Markdig) package available in the project for Markdown-to-HTML conversion (required by the sample code).
23+
24+
## Set Up the AI AssistView Component
25+
26+
Follow the Syncfusion AI AssistView [Getting Started](../getting-started) guide to configure and render the AI AssistView component in the application and that prerequisites are met.
2427

2528
## Install Dependencies
2629

27-
Install the Syncfusion Blazor package in the application.
30+
Install the required packages:
31+
32+
1. Install the `OpenAI` and `Azure` nuget packages in the application.
2833

2934
```bash
3035

31-
Nuget\Install-Package Syncfusion.Blazor.InteractiveChat
36+
NuGet\Install-Package OpenAI
37+
NuGet\Install-Package Azure.AI.OpenAI
38+
NuGet\Install-Package Azure.Core
3239

3340
```
3441

35-
Install the `Open AI` and `Markdig` nuget packages in the application.
42+
2. Install the `Markdig` nuget packages in the application.
3643

3744
```bash
3845

39-
NuGet\Install-Package OpenAI
40-
NuGet\Install-Package Azure.AI.OpenAI
41-
NuGet\Install-Package Azure.Core
4246
Nuget\Install-Package Markdig
4347

4448
```
4549

4650
Note: The sample below uses HttpClient directly and does not require the Azure/OpenAI SDKs.
4751

48-
## Configure Azure Open AI
52+
## Configure Azure OpenAI
4953

50-
1. Log in to the [Azure Portal](https://portal.azure.com/#home) and navigate to your Azure Open AI resource.
54+
1. Log in to the [Azure Portal](https://portal.azure.com/#home) and navigate to your Azure OpenAI resource.
5155

52-
2. Under Resource Management, select keys and endpoint to retrieve your API key and endpoint URL.
56+
2. Under resource Management, select keys and endpoint to retrieve your API key and endpoint URL.
5357

54-
3. Copy the API key, endpoint, and deployment name (e.g., gpt-4o-mini). Ensure the API version matches your resource configuration.
58+
3. Note the following values:
59+
- API key
60+
- Endpoint
61+
- API version (must be supported by your resource)
62+
- Deployment name (for example, gpt-4o-mini)
5563

5664
4. Store these values securely, as they will be used in your application.
5765

@@ -65,6 +73,8 @@ Note: The sample below uses HttpClient directly and does not require the Azure/O
6573

6674
- Inject and use the service in your Razor component.
6775

76+
Modify the razor file to integrate the Azure OpenAI with the AI AssistView component.
77+
6878
{% tabs %}
6979
{% highlight c# tabtitle="razor" %}
7080

@@ -73,6 +83,7 @@ Note: The sample below uses HttpClient directly and does not require the Azure/O
7383
@using Syncfusion.Blazor.Navigations
7484
@inject AzureOpenAIService OpenAIService
7585

86+
// Initialize AI AssistView component
7687
<div class="aiassist-container" style="height: 450px; width: 650px;">
7788
<SfAIAssistView @ref="assistView" ID="aiAssistView" PromptSuggestions="@promptSuggestions" PromptRequested="@PromptRequest">
7889
<AssistViews>
@@ -101,7 +112,8 @@ Note: The sample below uses HttpClient directly and does not require the Azure/O
101112
"What are the best tools for organizing my tasks?",
102113
"How can I maintain work-life balance effectively?"
103114
};
104-
115+
116+
// Handle user prompt: call Azure OpenAI Chat Completions
105117
private async Task PromptRequest(AssistViewPromptRequestedEventArgs args)
106118
{
107119
// Reset the response for this prompt
@@ -233,11 +245,12 @@ namespace AIAssistView_AzureAI.Components.Services
233245
{% endhighlight %}
234246
{% highlight c# tabtitle="Server(~/_Program.cs)" %}
235247

248+
// Initialize Azure OpenAI
236249
var endpoint = "https://azure-testresource.openai.azure.com";
237250
var apiKey = "<Your API Key>"; // Replace with your API key;
238251
var deploymentName = "gpt-4o-mini";
239252

240253
{% endhighlight %}
241254
{% endtabs %}
242255

243-
![Blazor AI AssistView Azure Open AI Integration](../images/openai-integration.png)
256+
![Blazor AI AssistView Azure OpenAI Integration](../images/openai-integration.png)

blazor/common/accessibility.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1004,7 +1004,7 @@ DocumentEditor
10041004
<img src="https://cdn.syncfusion.com/content/images/documentation/partial.png" alt="Intermediate">
10051005
</td>
10061006
<td>
1007-
<img src="https://cdn.syncfusion.com/content/images/landing-page/no.png" alt="No">
1007+
<img src="https://cdn.syncfusion.com/content/images/landing-page/yes.png" alt="Yes">
10081008
</td>
10091009
<td>
10101010
<img src="https://cdn.syncfusion.com/content/images/landing-page/yes.png" alt="Yes">

0 commit comments

Comments
 (0)