Skip to content

Commit a508cb7

Browse files
986172: updated concerns in Md file
1 parent 82866cd commit a508cb7

File tree

2 files changed

+30
-40
lines changed

2 files changed

+30
-40
lines changed

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

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,31 +9,21 @@ documentation: ug
99

1010
# 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 Syncfusion AI AssistView integrates with [Gemini](https://ai.google.dev/gemini-api/docs/quickstart), to enable advanced conversational AI features in applications.
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+
* The Syncfusion AI AssistView component is setup in the application:
1917

20-
## Getting Started with the AI AssistView Component
18+
* [Blazor Getting Started Guide](../getting-started)
2119

22-
Before integrating Gemini AI, ensure that the Syncfusion AI AssistView renders correctly in the application and that prerequisites are met:
20+
* Google account to generate an API key for accessing [Gemini AI](https://ai.google.dev/gemini-api/docs/quickstart)
2321

24-
[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).
2523

2624
## Install Dependencies
2725

28-
Install the Syncfusion Blazor package in the application.
29-
30-
```bash
31-
32-
Nuget\Install-Package Syncfusion.Blazor.InteractiveChat
33-
34-
```
35-
36-
Install the Gemini AI package in the application.
26+
* Install the Gemini AI package in the application.
3727

3828
```bash
3929

@@ -43,13 +33,13 @@ Nuget\Install-Package Mscc.GenerativeAI
4333

4434
## Generate API Key
4535

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.
36+
1. Go to [Google AI Studio](https://aistudio.google.com/app/apikey) and sign in with your google account. Create one if you do not have it.
4737

4838
2. Select `Get API key` from the left menu or the top-right of the dashboard.
4939

50-
3. Choose `Create API key`. Select an existing google cloud project or create a new one, then proceed.
40+
3. Choose an existing Google Cloud project or create a new one, then click `Create API key`.
5141

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.
42+
4. Copy the generated API key and store it securely. It may be shown only once.
5343

5444
> Security note: Do not commit API keys to version control. Use environment variables, a secret manager, or a server-side proxy in production.
5545
@@ -72,6 +62,7 @@ const string GeminiApiKey = 'Place your API key here';
7262
@using Markdig
7363

7464
<div class="aiassist-container" style="height: 350px; width: 650px;">
65+
// Initializes the AI Assist component
7566
<SfAIAssistView @ref="sfAIAssistView" ID="aiAssistView" PromptSuggestions="@promptSuggestions" PromptRequested="@OnPromptRequest">
7667
<AssistViews>
7768
<AssistView>
@@ -98,13 +89,15 @@ const string GeminiApiKey = 'Place your API key here';
9889
"What are the best tools for organizing my tasks?",
9990
"How can I maintain work-life balance effectively?"
10091
};
92+
// Initialize Gemini API
10193
private readonly string geminiApiKey = "";
94+
// Handle user prompt: call Gemini model
10295
private async Task OnPromptRequest(AssistViewPromptRequestedEventArgs args)
10396
{
10497
try
10598
{
106-
var gemini = new GoogleAI(apiKey: geminiApiKey);
107-
var model = gemini.GenerativeModel(model: "gemini-1.5-flash");
99+
var gemini = new GoogleAI(apiKey: geminiApiKey); // Replace with your Gemini API key
100+
var model = gemini.GenerativeModel(model: "gemini-2.5-flash"); // Select the Gemini model (update model name as needed)
108101
var response = await model.GenerateContent(args.Prompt);
109102
var responseText = response.Text;
110103
var pipeline = new MarkdownPipelineBuilder()

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

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,20 @@ documentation: ug
99

1010
# 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 Syncfusion AI AssistView integrates with [Azure Open AI](https://microsoft.github.io/PartnerResources/skilling/ai-ml-academy/resources/openai), to enable advanced conversational AI features in applications.
1313

1414
## Prerequisites
15+
* The Syncfusion AI AssistView component is setup in the application:
1516

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
17+
* [Blazor Getting Started Guide](../getting-started)
1818

19-
## Getting Started with the AI AssistView Component
19+
* 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.
2020

21-
Before integrating Azure OpenAI, ensure the Syncfusion AI AssistView component renders correctly in the application:
22-
23-
[Blazor Getting Started Guide](../getting-started)
21+
* [Markdig](https://www.nuget.org/packages/Markdig) package available in the project for Markdown-to-HTML conversion (required by the sample code).
2422

2523
## Install Dependencies
2624

27-
Install the Syncfusion Blazor package in the application.
28-
29-
```bash
30-
31-
Nuget\Install-Package Syncfusion.Blazor.InteractiveChat
32-
33-
```
34-
35-
Install the `Open AI` and `Markdig` nuget packages in the application.
25+
* Install the `Open AI` and `Markdig` nuget packages in the application.
3626

3727
```bash
3828

@@ -49,9 +39,13 @@ Note: The sample below uses HttpClient directly and does not require the Azure/O
4939

5040
1. Log in to the [Azure Portal](https://portal.azure.com/#home) and navigate to your Azure Open AI resource.
5141

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

54-
3. Copy the API key, endpoint, and deployment name (e.g., gpt-4o-mini). Ensure the API version matches your resource configuration.
44+
3. Note the following values:
45+
- API key
46+
- Endpoint (for example, https://<resource-name>.openai.azure.com/)
47+
- API version (must be supported by your resource)
48+
- Deployment name (for example, gpt-4o-mini)
5549

5650
4. Store these values securely, as they will be used in your application.
5751

@@ -73,6 +67,7 @@ Note: The sample below uses HttpClient directly and does not require the Azure/O
7367
@using Syncfusion.Blazor.Navigations
7468
@inject AzureOpenAIService OpenAIService
7569

70+
// Initialize AI AssistView component
7671
<div class="aiassist-container" style="height: 450px; width: 650px;">
7772
<SfAIAssistView @ref="assistView" ID="aiAssistView" PromptSuggestions="@promptSuggestions" PromptRequested="@PromptRequest">
7873
<AssistViews>
@@ -101,7 +96,8 @@ Note: The sample below uses HttpClient directly and does not require the Azure/O
10196
"What are the best tools for organizing my tasks?",
10297
"How can I maintain work-life balance effectively?"
10398
};
104-
99+
100+
// Handle user prompt: call Azure OpenAI Chat Completions
105101
private async Task PromptRequest(AssistViewPromptRequestedEventArgs args)
106102
{
107103
// Reset the response for this prompt
@@ -233,6 +229,7 @@ namespace AIAssistView_AzureAI.Components.Services
233229
{% endhighlight %}
234230
{% highlight c# tabtitle="Server(~/_Program.cs)" %}
235231

232+
// Initialize Azure OpenAI
236233
var endpoint = "https://azure-testresource.openai.azure.com";
237234
var apiKey = "<Your API Key>"; // Replace with your API key;
238235
var deploymentName = "gpt-4o-mini";

0 commit comments

Comments
 (0)