Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
[![](https://img.shields.io/badge/📖_How_to_use_DevExpress_Examples-e9f6fc?style=flat-square)](https://docs.devexpress.com/GeneralInformation/403183)
[![](https://img.shields.io/badge/💬_Leave_Feedback-feecdd?style=flat-square)](#does-this-example-address-your-development-requirementsobjectives)
<!-- default badges end -->
# Blazor AI Chat - How to add the DevExpress Blazor AI Chat component to your next Blazor, MAUI, WPF, and WinForms application
# Blazor AI Chat - How to Add the DevExpress Blazor AI Chat Component to Your Next Blazor, MAUI, WPF, and WinForms Application

The DevExpress Blazor AI Chat component ([DxAIChat](https://docs.devexpress.com/Blazor/DevExpress.AIIntegration.Blazor.Chat.DxAIChat)) allows you to incorporate AI-powered interactions into any Blazor/MAUI/WPF/WinForms application. Our AI Chat component ships with a variety of high impact features, including:

Check warning on line 9 in README.md

View workflow job for this annotation

GitHub Actions / vale

[vale] README.md#L9

[Microsoft.We] Only use we/us when you refer to our organization.
Raw output
{"message": "[Microsoft.We] Only use we/us when you refer to our organization.", "location": {"path": "README.md", "range": {"start": {"line": 9, "column": 233}}}, "severity": "WARNING"}

* [Customizable message appearance and empty message area](#customize-message-appearance-and-empty-message-area)
* [Text or markdown response](#text-or-markdown-response)
Expand Down Expand Up @@ -61,15 +61,15 @@
> Refer to the following help topic for instructions on registering OpenAI, Azure OpenAI, Ollama, and Semantic Kernel: [Register AI Clients](https://docs.devexpress.com/CoreLibraries/405204/ai-powered-extensions#register-ai-clients).

> [!Note]
> We use the following versions of Microsoft AI packages in our `v26.1.3+` source code:

Check warning on line 64 in README.md

View workflow job for this annotation

GitHub Actions / vale

[vale] README.md#L64

[Microsoft.We] Only use we/us when you refer to our organization.
Raw output
{"message": "[Microsoft.We] Only use we/us when you refer to our organization.", "location": {"path": "README.md", "range": {"start": {"line": 64, "column": 61}}}, "severity": "WARNING"}
>
> * `Microsoft.Extensions.AI` | **10.6.0**
> * `Microsoft.Extensions.AI.OpenAI` | **10.6.0**
> * `Azure.AI.OpenAI` | **2.9.0-beta.1**
> * `Microsoft.Extensions.AI` | **v10.6.0**
> * `Microsoft.Extensions.AI.OpenAI` | **v10.6.0**
> * `Azure.AI.OpenAI` | **v2.9.0-beta.1**
>
> We do not guarantee compatibility or correct operation with higher versions. Refer to the following announcement for additional information: [DevExpress.AIIntegration references stable versions of Microsoft AI packages](https://supportcenter.devexpress.com/ticket/details/t1292705/devexpress-aiintegration-references-stable-versions-of-microsoft-ai-packages).

### Add DxAIChat component to a Blazor Application
### Add DxAIChat Component to a Blazor Application

Add `<DxAIChat>…</DxAIChat>` markup to a .razor file:

Expand All @@ -92,7 +92,7 @@

File to review: [Chat.razor](./CS/DevExpress.AI.Samples.Blazor/Components/Pages/Chat.razor)

### Customize message appearance and empty message area
### Customize Message Appearance and Empty Message Area

The [DxAIChat](https://docs.devexpress.com/Blazor/DevExpress.AIIntegration.Blazor.Chat.DxAIChat) component includes the following message customization properties:

Expand Down Expand Up @@ -123,7 +123,7 @@

File to review: [Chat-CustomMessage.razor](./CS/DevExpress.AI.Samples.Blazor/Components/Pages/Chat-CustomMessage.razor), [Chat-CustomEmptyState.razor](./CS/DevExpress.AI.Samples.Blazor/Components/Pages/Chat-CustomEmptyState.razor)

### Text or markdown response
### Text or Markdown Response

The AI service uses plain text as the default response format.

Expand All @@ -147,7 +147,7 @@
}
```

### Manual message processing
### Manual Message Processing

When a user sends a message to the chat, the [MessageSent](https://docs.devexpress.com/Blazor/DevExpress.AIIntegration.Blazor.Chat.DxAIChat.MessageSent) event fires. Handle the event to manually process this action.
You can use the [Content](https://docs.devexpress.com/Blazor/DevExpress.AIIntegration.Blazor.Chat.MessageSentEventArgs.Content) event argument to access user input and call the [SendMessage](https://docs.devexpress.com/Blazor/DevExpress.AIIntegration.Blazor.Chat.DxAIChat.SendMessage(System.String-Microsoft.Extensions.AI.ChatRole) method to send another message to the chat.
Expand All @@ -165,7 +165,7 @@
File to review: [Chat-MessageSent.razor](./CS/DevExpress.AI.Samples.Blazor/Components/Pages/Chat-MessageSent.razor)


### Streaming response
### Streaming Response

Check warning on line 168 in README.md

View workflow job for this annotation

GitHub Actions / vale

[vale] README.md#L168

[DX.HeadingGerund] Avoid gerunds in headings: 'Streaming Response'.
Raw output
{"message": "[DX.HeadingGerund] Avoid gerunds in headings: 'Streaming Response'.", "location": {"path": "README.md", "range": {"start": {"line": 168, "column": 5}}}, "severity": "WARNING"}

After a user sends a request, the AI client generates and sends the entire response back. This operation may be time consuming. To make the chat appear more responsive, set the [UseStreaming](https://docs.devexpress.com/Blazor/DevExpress.AIIntegration.Blazor.Chat.DxAIChat.UseStreaming) property to `true`. In this instance, the AI client transmits parts of the response as it becomes available and the chat component adds these parts to the display message.

Expand All @@ -175,7 +175,7 @@

File to review: [Chat-Streaming.razor](./CS/DevExpress.AI.Samples.Blazor/Components/Pages/Chat-Streaming.razor)

### Compatibility with OpenAI assistants
### Compatibility with OpenAI Assistants

The DevExpress AI Chat ([DxAIChat](https://docs.devexpress.com/Blazor/DevExpress.AIIntegration.Blazor.Chat.DxAIChat)) component supports [OpenAI Assistants](https://techcommunity.microsoft.com/t5/ai-azure-ai-services-blog/announcing-azure-openai-service-assistants-public-preview/ba-p/4143217). You can specify a model and supply supplementary documents (external knowledge). OpenAI parses these documents and searches through them to retrieve relevant content to answer user queries.

Expand Down
Loading