Skip to content

Commit 160a6d6

Browse files
Merge pull request #4564 from Syncfusion-Content/hotfix/hotfix-v31.1.17
DOCINFRA-2341_merged_using_automation
2 parents 253074b + d05f095 commit 160a6d6

File tree

25 files changed

+1995
-4
lines changed

25 files changed

+1995
-4
lines changed
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
---
2+
layout: post
3+
title: Gemini AI in ##Platform_Name## Chat UI Control | Syncfusion
4+
description: Checkout and learn about Gemini AI in Syncfusion ##Platform_Name## Chat UI control of Syncfusion Essential JS 2 and more.
5+
platform: ej2-asp-core-mvc
6+
control: Gemini AI
7+
publishingplatform: ##Platform_Name##
8+
documentation: ug
9+
---
10+
11+
# Integration of Gemini AI With Chat UI component
12+
13+
The Syncfusion Chat UI supports integration with [Gemini](https://ai.google.dev/gemini-api/docs), enabling advanced conversational AI features in your MVC applications.
14+
15+
## Getting Started With the Chat UI Component
16+
17+
Before integrating Gemini AI, ensure that the Syncfusion Chat UI control is correctly rendered in your MVC application:
18+
19+
[ MVC Getting Started Guide](../getting-started)
20+
21+
## Prerequisites
22+
23+
* Google account to generate API key on accessing `Gemini AI`
24+
25+
* Syncfusion Chat UI for MVC `Syncfusion.EJ2.MVC5` Install ASP.NET MVC package in the application.
26+
27+
## Install Dependencies
28+
29+
Install the Syncfusion ASP.NET MVC package in the application using the Package Manager Console.
30+
31+
```bash
32+
33+
NuGet\Install-Package Syncfusion.EJ2.MVC5
34+
35+
```
36+
37+
Install the Open AI package in the application using the Package Manager Console.
38+
39+
```bash
40+
41+
NuGet\Install-Package Mscc.GenerativeAI
42+
43+
```
44+
45+
## Generate API Key
46+
47+
1. Go to [Google AI Studio](https://aistudio.google.com/app/apikey) and sign in with your Google account. If you don’t have one, create a new account.
48+
49+
2. Once logged in, click on `Get API Key` from the left-hand menu or the top-right corner of the dashboard.
50+
51+
3. Click the `Create API Key` button. You’ll be prompted to either select an existing Google Cloud project or create a new one. Choose the appropriate option and proceed.
52+
53+
4. After selecting or creating a project, your API key will be generated and displayed. Copy the key and store it securely, as it will only be shown once.
54+
55+
> `Security Note`: Never commit the API key to version control. Use environment variables or a secret manager for production.
56+
57+
## Integration Gemini AI with Chat UI
58+
59+
You can add the below respective files in your application:
60+
61+
* Add your generated `API Key` at the line
62+
63+
```bash
64+
65+
const geminiApiKey = 'Place your API key here';
66+
67+
```
68+
69+
{% tabs %}
70+
{% highlight razor tabtitle="CSHTML" %}
71+
{% include code-snippet/chat-ui/ai-integrations/Asp.net-MVC/gemini/razor %}
72+
{% endhighlight %}
73+
{% highlight c# tabtitle="gemini.cs" %}
74+
{% include code-snippet/chat-ui/ai-integrations/Asp.net-MVC/gemini/gemini.cs %}
75+
{% endhighlight %}
76+
{% endtabs %}
77+
78+
![gemini](../../images/gemini.png)
79+
80+
## Run and Test
81+
82+
Run the application in the browser using the following command.
83+
84+
Build and run the app (Ctrl + F5).
85+
86+
Open `https://localhost:44321` to interact with your Gemini AI for dynamic response.
Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
---
2+
layout: post
3+
title: Azure Open AI in ##Platform_Name## Chat UI Control | Syncfusion
4+
description: Checkout and learn about Integration of Azure Open AI in Syncfusion ##Platform_Name## Chat UI control of Syncfusion Essential JS 2 and more.
5+
platform: ej2-asp-core-mvc
6+
control: Azure Open AI
7+
publishingplatform: ##Platform_Name##
8+
documentation: ug
9+
---
10+
11+
# Integration of Azure Open AI With Chat UI component
12+
13+
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 MVC applications.
14+
15+
## Getting Started With the Chat UI Component
16+
17+
Before integrating Azure Open AI, ensure that the Syncfusion Chat UI control is correctly rendered in your MVC application:
18+
[ MVC Getting Started Guide](../getting-started)
19+
20+
## Prerequisites
21+
22+
* An Azure account with access to `Azure Open AI` services and a generated API key.
23+
24+
* Syncfusion Chat UI for MVC `Syncfusion.EJ2.MVC5` Install ASP.NET MVC package in the application.
25+
26+
## Install Dependencies
27+
28+
Install the Syncfusion ASP.NET MVC package in the application using the Package Manager Console.
29+
30+
```bash
31+
32+
NuGet\Install-Package Syncfusion.EJ2.MVC5
33+
34+
```
35+
36+
Install the Open AI and Azure Open AI package in the application using Package Manager Console.
37+
38+
```bash
39+
40+
NuGet\Install-Package OpenAI
41+
NuGet\Install-Package Azure.AI.OpenAI
42+
NuGet\Install-Package Azure.Core
43+
44+
```
45+
46+
47+
## Generate API Key
48+
49+
1. Log in to the [Azure Portal](https://portal.azure.com/#home) and navigate to your Azure Open AI resource.
50+
51+
2. Under Resource Management, select Keys and Endpoint to retrieve your API key and endpoint URL.
52+
53+
3. Copy the API key, endpoint, and deployment name (e.g., gpt-4o-mini). Ensure the API version (e.g., 2024-07-01-preview) matches your resource configuration.
54+
55+
4. Store these values securely, as they will be used in your application.
56+
57+
> `Security Note`: Never expose your API key in client-side code for production applications. Use a server-side proxy or environment variables to manage sensitive information securely
58+
59+
## Integration Azure Open AI with Chat UI
60+
61+
You can add the below respective files in your application:
62+
63+
* Update the following configuration values with your Azure Open AI details:
64+
65+
```bash
66+
67+
string endpoint = "Your_Azure_OpenAI_Endpoint";
68+
string apiKey = "Your_Azure_OpenAI_API_Key";
69+
string deploymentName = "Your_Deployment_Name";
70+
71+
```
72+
73+
{% tabs %}
74+
{% highlight razor tabtitle="CSHTML" %}
75+
{% include code-snippet/chat-ui/ai-integrations/Asp.net-MVC/openai/razor %}
76+
{% endhighlight %}
77+
{% highlight c# tabtitle="openai.cs" %}
78+
{% include code-snippet/chat-ui/ai-integrations/Asp.net-MVC/openai/openai.cs %}
79+
{% endhighlight %}
80+
{% endtabs %}
81+
82+
![Azure Open AI](../../images/openai.png)
83+
84+
## Run and Test
85+
86+
Run the application in the browser using the following command.
87+
88+
Build and run the app (Ctrl + F5).
89+
90+
Open `https://localhost:44321` to interact with your Azure Open AI for dynamic response.

0 commit comments

Comments
 (0)