Skip to content

Commit 5cbba0f

Browse files
authored
Update README.md
1 parent 7dfb1db commit 5cbba0f

File tree

1 file changed

+21
-8
lines changed

1 file changed

+21
-8
lines changed

README.md

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<!-- default badges list -->
2+
![](https://img.shields.io/endpoint?url=https://codecentral.devexpress.com/api/v1/VersionRange/904202803/25.1.2%2B)
23
[![](https://img.shields.io/badge/Open_in_DevExpress_Support_Center-FF7200?style=flat-square&logo=DevExpress&logoColor=white)](https://supportcenter.devexpress.com/ticket/details/T1268742)
34
[![](https://img.shields.io/badge/📖_How_to_use_DevExpress_Examples-e9f6fc?style=flat-square)](https://docs.devexpress.com/GeneralInformation/403183)
45
[![](https://img.shields.io/badge/💬_Leave_Feedback-feecdd?style=flat-square)](#does-this-example-address-your-development-requirementsobjectives)
@@ -40,7 +41,9 @@ Open AI Assistant initialization may take time. `DxAIChat` is ready for use once
4041
> [!Note]
4142
> We use the following versions of the `Microsoft.Extensions.AI.*` libraries in our source code:
4243
>
43-
> v25.1.2+ | **9.4.3-preview.1.25230.7**
44+
> - Microsoft.Extensions.AI.Abstractions: **9.5.0**
45+
> - Microsoft.Extensions.AI: **9.5.0**
46+
> - Microsoft.Extensions.AI.OpenAI: **9.5.0-preview.1.25265.7**
4447
>
4548
> We do not guarantee compatibility or correct operation with higher versions.
4649
@@ -126,15 +129,16 @@ Use the [`MessageContentTemplate`](https://docs.devexpress.com/Blazor/DevExpress
126129

127130
#### Create an AI Assistant
128131

129-
In this example, the `AIAssistantCreator.CreateAssistantAsync` method creates an assistant with the specified [options](https://learn.microsoft.com/en-us/dotnet/api/azure.ai.openai.assistants.assistantcreationoptions?view=azure-dotnet-preview) and a thread. The
132+
In this example, the `AIAssistantCreator.CreateAssistantAsync` method uploads a file to OpenAI, configures tool resources, creates an assistant with specified instructions and tools, initializes a new thread, and returns the assistant and thread IDs.
130133

131134
You can review and tailor AI assistant instructions in the following file: [Instructions.cs](./CS/DevExpress.AI.Samples.Blazor/Instructions.cs).
132135

133136
For information on OpenAI Assistants, refer to the following documents:
134137
- [OpenAI Assistants API overview](https://platform.openai.com/docs/assistants/overview)
135138
- [Azure OpenAI: OpenAI Assistants client library for .NET](https://learn.microsoft.com/en-us/dotnet/api/overview/azure/ai.openai.assistants-readme?view=azure-dotnet-preview)
139+
- [OpenAI .NET API library](https://github.com/openai/openai-dotnet)
136140

137-
In the *Program.cs* file, add the `AIAssistantCreator` service to the applications's service collection:
141+
In the *Program.cs* file, add the `AIAssistantCreator` service to the application's service collection:
138142

139143
```cs
140144
// ...
@@ -152,10 +156,11 @@ builder.Services.AddSingleton(assistantCreator);
152156

153157
- [AIAssistantCreator.cs](./CS/DevExpress.AI.Samples.Blazor/Services/AIAssistantCreator.cs)
154158
- [Instructions.cs](./CS/DevExpress.AI.Samples.Blazor/Instructions.cs)
159+
- [Program.cs](./CS/DevExpress.AI.Samples.Blazor/Program.cs)
155160

156161
#### Set Up the AI Assistant
157162

158-
Handle the `OnAfterRenderAsync` event and call the [`SetupAssistantAsync`](https://docs.devexpress.com/Blazor/DevExpress.AIIntegration.Blazor.Chat.IAIChat.SetupAssistantAsync(System.String-System.String)?v=25.1) method to set up your AI assistant based on the Assistant's ID and thread's ID created in the previous step. This example calls our Blazor Grid's [`ExportToXlsxAsync`](https://docs.devexpress.com/Blazor/DevExpress.Blazor.DxGrid.ExportToXlsxAsync.overloads) method to generate data for the AI Assistant.
163+
Handle the `OnAfterRenderAsync` event and call the [`SetupAssistantAsync`](https://docs.devexpress.com/Blazor/DevExpress.AIIntegration.Blazor.Chat.IAIChat.SetupAssistantAsync(System.String-System.String)?v=25.1) method to set up your AI assistant based on the assistant and thread IDs created in the previous step. This example calls our Blazor Grid's [`ExportToXlsxAsync`](https://docs.devexpress.com/Blazor/DevExpress.Blazor.DxGrid.ExportToXlsxAsync.overloads) method to generate data for the AI Assistant.
159164

160165
```razor
161166
@using DevExpress.AIIntegration.OpenAI.Services
@@ -189,7 +194,6 @@ Handle the `OnAfterRenderAsync` event and call the [`SetupAssistantAsync`](https
189194

190195
You can review and tailor AI assistant instructions in the following file: [Instructions.cs](./CS/DevExpress.AI.Samples.Blazor/Instructions.cs).
191196

192-
193197
**Files to Review:**
194198

195199
- [Grid.razor](./CS/DevExpress.AI.Samples.Blazor/Components/Pages/Grid.razor)
@@ -274,15 +278,16 @@ Use the [`MessageContentTemplate`](https://docs.devexpress.com/Blazor/DevExpress
274278

275279
#### Create an AI Assistant
276280

277-
In this example, the `AIAssistantCreator.CreateAssistantAsync` method creates an assistant with the specified [options](https://learn.microsoft.com/en-us/dotnet/api/azure.ai.openai.assistants.assistantcreationoptions?view=azure-dotnet-preview) and a thread. The
281+
In this example, the `AIAssistantCreator.CreateAssistantAsync` method uploads a file to OpenAI, configures tool resources, creates an assistant with specified instructions and tools, initializes a new thread, and returns the assistant and thread IDs.
278282

279283
You can review and tailor AI assistant instructions in the following file: [Instructions.cs](./CS/DevExpress.AI.Samples.Blazor/Instructions.cs).
280284

281285
For information on OpenAI Assistants, refer to the following documents:
282286
- [OpenAI Assistants API overview](https://platform.openai.com/docs/assistants/overview)
283287
- [Azure OpenAI: OpenAI Assistants client library for .NET](https://learn.microsoft.com/en-us/dotnet/api/overview/azure/ai.openai.assistants-readme?view=azure-dotnet-preview)
288+
- [OpenAI .NET API library](https://github.com/openai/openai-dotnet)
284289

285-
In the *Program.cs* file, add the `AIAssistantCreator` service to the applications's service collection:
290+
In the *Program.cs* file, add the `AIAssistantCreator` service to the application's service collection:
286291

287292
```cs
288293
// ...
@@ -300,10 +305,18 @@ builder.Services.AddSingleton(assistantCreator);
300305

301306
- [AIAssistantCreator.cs](./CS/DevExpress.AI.Samples.Blazor/Services/AIAssistantCreator.cs)
302307
- [Instructions.cs](./CS/DevExpress.AI.Samples.Blazor/Instructions.cs)
308+
- [Program.cs](./CS/DevExpress.AI.Samples.Blazor/Program.cs)
309+
310+
311+
**Files to Review:**
312+
313+
- [AIAssistantCreator.cs](./CS/DevExpress.AI.Samples.Blazor/Services/AIAssistantCreator.cs)
314+
- [Instructions.cs](./CS/DevExpress.AI.Samples.Blazor/Instructions.cs)
315+
- [Program.cs](./CS/DevExpress.AI.Samples.Blazor/Program.cs)
303316

304317
#### Set Up the AI Assistant
305318

306-
Handle the [`Initialized`](https://docs.devexpress.com/Blazor/DevExpress.AIIntegration.Blazor.Chat.DxAIChat.Initialized) event and call the [`SetupAssistantAsync`](https://docs.devexpress.com/Blazor/DevExpress.AIIntegration.Blazor.Chat.IAIChat.SetupAssistantAsync(System.String-System.String)?v=25.1) method method to set up your AI assistant based on the Assistant's ID and thread's ID created in the previous step. This example calls the [`ExportToPdf`](https://docs.devexpress.com/CoreLibraries/DevExpress.XtraPrinting.PrintingSystemBase.ExportToPdf(System.IO.Stream)) method to generate data for the AI Assistant:
319+
Handle the [`Initialized`](https://docs.devexpress.com/Blazor/DevExpress.AIIntegration.Blazor.Chat.DxAIChat.Initialized) event and call the [`SetupAssistantAsync`](https://docs.devexpress.com/Blazor/DevExpress.AIIntegration.Blazor.Chat.IAIChat.SetupAssistantAsync(System.String-System.String)?v=25.1) method to set up your AI assistant based on the Assistant's ID and thread's ID created in the previous step. This example calls the [`ExportToPdf`](https://docs.devexpress.com/CoreLibraries/DevExpress.XtraPrinting.PrintingSystemBase.ExportToPdf(System.IO.Stream)) method to generate data for the AI Assistant:
307320

308321
```razor
309322
@using DevExpress.AIIntegration.Blazor.Chat

0 commit comments

Comments
 (0)