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: ej2-javascript/ai-assistview/ai-integrations/openai-integration.md
+18-15Lines changed: 18 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,28 +1,28 @@
1
1
---
2
2
layout: post
3
-
title: Open AI in ##Platform_Name## AI AssistView control | Syncfusion
4
-
description: Checkout and learn about Integration of ChatGPT Open AI with ##Platform_Name## AI AssistView control of Syncfusion Essential JS 2 and more.
3
+
title: Azure Open AI in ##Platform_Name## AI AssistView control | Syncfusion
4
+
description: Checkout and learn about Integration of Azure Open AI with ##Platform_Name## AI AssistView control of Syncfusion Essential JS 2 and more.
5
5
platform: ej2-javascript
6
6
control: AI AssistView
7
7
publishingplatform: ##Platform_Name##
8
8
documentation: ug
9
9
domainurl: ##DomainURL##
10
10
---
11
11
12
-
# Integration of Open AI With ##Platform_Name## AI AssistView control
12
+
# Integration of Azure Open AI With ##Platform_Name## AI AssistView control
13
13
14
-
The Syncfusion AI AssistView supports integration with [OpenAI](https://platform.openai.com/docs/overview), enabling advanced conversational AI features in your React applications.
14
+
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.
15
15
16
16
## Getting Started with the ##Platform_Name## AI AssistView control
17
17
18
-
Before integrating Open AI, ensure that the Syncfusion AI AssistView control is correctly rendered in your React app:
18
+
Before integrating Azure Open AI, ensure that the Syncfusion AI AssistView control is correctly rendered in your app:
19
19
20
20
[##Platform_Name## Getting Started Guide](../getting-started)
21
21
22
22
## Prerequisites
23
23
24
24
* Requires `Node.js` (v16 or higher) and `npm`.
25
-
*OpenAI account to generate an API key for accessing the `OpenAI`API
25
+
*An Azure account with access to `Azure Open AI` services and a generated API key.
26
26
* Syncfusion AI AssistView for ##Platform_Name## `@syncfusion/ej2-interactive-chat` installed in your project.
1.Go to [Open AI](https://platform.openai.com/docs/overview) and sign in with your Google account. If you don’t have one, create a new account.
40
+
1.Log in to the [Azure Portal](https://portal.azure.com/#home) and navigate to your Azure Open AI resource.
41
41
42
-
2.Once logged in, click on your profile icon in the top-right corner and select `API Keys` from the dropdown menu.
42
+
2.Under Resource Management, select Keys and Endpoint to retrieve your API key and endpoint URL.
43
43
44
-
3.Click the `+ Create new secret key` button. You’ll be prompted to name the key (optional). Confirm to generate the key.
44
+
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.
45
45
46
-
4.Your API key will be displayed once. Copy it and store it securely, as it won’t be shown again.
46
+
4.Store these values securely, as they will be used in your application.
47
47
48
-
> `Security Note`: Never commit the API key to version control. Use environment variables or a secret manager for production.
48
+
> `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.
49
49
50
50
## Integration Open AI with ##Platform_Name## AI AssistView control
51
51
52
-
Create ##Platform_Name## application to integrate the Open AI with AI AssistView component with the respective files
52
+
Create ##Platform_Name## application to integrate the Open AI with AI AssistView component with the respective files:
53
53
54
-
*Add your generated `API Key` at the line
54
+
*Update the following configuration values with your Azure Open AI details:
@@ -68,8 +75,8 @@ function onPromptRequest(args) {
68
75
streamResponse(responseText);
69
76
})
70
77
.catch(error=>{
71
-
aiAssistView.addPromptResponse('⚠️ Something went wrong while connecting to the AI service. Please check your API keyor try again later.');
72
-
stopStreaming=true;// Ensure streaming is stopped
78
+
aiAssistView.addPromptResponse('⚠️ Something went wrong while connecting to the AI service. Please check your API key, Deployment model, endpoint or try again later.',true);
@@ -67,9 +75,9 @@ function onPromptRequest(args:any) {
67
75
stopStreaming=false;
68
76
streamResponse(responseText);
69
77
})
70
-
.catch(error=>{
71
-
aiAssistView.addPromptResponse('⚠️ Something went wrong while connecting to the AI service. Please check your API keyor try again later.');
72
-
stopStreaming=true;// Ensure streaming is stopped
78
+
.catch((error: unknown)=>{
79
+
aiAssistView.addPromptResponse('⚠️ Something went wrong while connecting to the AI service. Please check your API key, Deployment model, endpoint or try again later.',true);
0 commit comments