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: README.md
+11-8
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@
6
6
<!-- default badges end -->
7
7
# Reporting for ASP.NET Core - Integrate AI Assistant based on Azure OpenAI
8
8
9
-
This example is an ASP.NET Core application with integrated DevExpress Reports and an AI assistant. User requests and assistant responses are displayed on-screen using the DevExtreme `dxChat` component.
9
+
This example is an ASP.NET Core application with integrated DevExpress Reports and an AI assistant. User requests and assistant responses are displayed on-screen using the DevExtreme [`dxChat`](https://js.devexpress.com/jQuery/Documentation/24_2/ApiReference/UI_Components/dxChat/) component.
10
10
11
11
The AI assistant's role depends on the associated DevExpress Reports component:
12
12
@@ -26,7 +26,7 @@ The AI assistant's role depends on the associated DevExpress Reports component:
26
26
27
27
You need to create an Azure OpenAI resource in the Azure portal to use AI Assistants for DevExpress Reporting. Refer to the following help topic for details: [Microsoft - Create and deploy an Azure OpenAI Service resource](https://learn.microsoft.com/en-us/azure/ai-services/openai/how-to/create-resource?pivots=web-portal).
28
28
29
-
Once you obtain a private endpoint and an API key, register them as `OPENAI_ENDPOINT` and `OPENAI_APIKEY` environment variables. The [EnvSettings.cs](./CS/ReportingApp/EnvSettings.cs) reads these settings. `DeploymentName` in this file is a name of your Azure model, for example, `GPT4o`:
29
+
Once you obtain a private endpoint and an API key, register them as `AZURE_OPENAI_ENDPOINT` and `AZURE_OPENAI_APIKEY` environment variables. The [EnvSettings.cs](./CS/ReportingApp/EnvSettings.cs) reads these settings. `DeploymentName` in this file is a name of your Azure model, for example, `GPT4o`:
30
30
31
31
```cs
32
32
publicstaticclassEnvSettings {
@@ -134,16 +134,17 @@ async function DocumentReady(sender, args) {
134
134
}
135
135
```
136
136
137
-
The [PerformCustomDocumentOperation](https://docs.devexpress.com/XtraReports/js-ASPxClientWebDocumentViewer?p=netframework#js_aspxclientwebdocumentviewer_performcustomdocumentoperation) method exports the report to PDF and creates an assistant based on the exported document. See [AIDocumentOperationService.cs]() for implementation details.
137
+
The [`PerformCustomDocumentOperation`](https://docs.devexpress.com/XtraReports/js-ASPxClientWebDocumentViewer?p=netframework#js_aspxclientwebdocumentviewer_performcustomdocumentoperation) method exports the report to PDF and creates an assistant based on the exported document. See [AIDocumentOperationService.cs](./CS/ReportingApp/Services/AIDocumentOperationService.cs) for implementation details.
138
138
139
139
#### Communicate with the Assistant
140
140
141
-
Each time a user sends a message, the `onMessageSend` event handler passes the request to the assistant:
141
+
Each time a user sends a message, the [`onMessageEntered`](https://js.devexpress.com/jQuery/Documentation/24_2/ApiReference/UI_Components/dxChat/Configuration/#onMessageEntered) event handler passes the request to the assistant:
142
142
143
143
```js
144
144
//...
145
-
onMessageSend: (e) => {
145
+
onMessageEntered: (e) => {
146
146
constinstance=e.component;
147
+
instance.renderMessage(e.message);
147
148
constformData=newFormData();
148
149
formData.append('text', e.message.text);
149
150
formData.append('chatId', model.chatId);
@@ -237,12 +238,13 @@ public async Task<string> CreateAssistant(AssistantType assistantType, Stream da
237
238
```
238
239
#### Communicate with the Assistant
239
240
240
-
Each time a user sends a message, the `onMessageSend` event handler passes the request to the assistant:
241
+
Each time a user sends a message, the [`onMessageEntered`](https://js.devexpress.com/jQuery/Documentation/24_2/ApiReference/UI_Components/dxChat/Configuration/#onMessageEntered) event handler passes the request to the assistant:
-[Reporting for ASP.NET Core - Summarize and Translate DevExpress Reports Using Azure OpenAI](https://github.com/DevExpress-Examples/reporting-asp-net-core-ai-summarize-and-translate)
280
283
-[Reporting for Blazor - Integrate AI-powered Summarize and Translate Features based on Azure OpenAI](https://github.com/DevExpress-Examples/blazor-reporting-ai/)
281
-
-[Rich Text Editor and HTML Editor for Blazor - How to integrate AI-powered extensions](https://github.com/DevExpress-Examples/blazor-ai-integration-to-text-editors)
282
284
-[AI Chat for Blazor - How to add DxAIChat component in Blazor, MAUI, WPF, and WinForms applications](https://github.com/DevExpress-Examples/devexpress-ai-chat-samples)
285
+
-[Rich Text Editor and HTML Editor for Blazor - How to integrate AI-powered extensions](https://github.com/DevExpress-Examples/blazor-ai-integration-to-text-editors)
283
286
284
287
<!-- feedback -->
285
288
## Does this example address your development requirements/objectives?
0 commit comments