Skip to content

Commit 3a3047f

Browse files
authored
Merge pull request #2 from DevExpress-Examples/final_readme
Final readme
2 parents 50f1588 + 8354575 commit 3a3047f

1 file changed

Lines changed: 12 additions & 13 deletions

File tree

README.md

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
<!-- default badges list -->
2-
![](https://img.shields.io/endpoint?url=https://codecentral.devexpress.com/api/v1/VersionRange/1072086084/25.2.3%2B)
32
[![](https://img.shields.io/badge/Open_in_DevExpress_Support_Center-FF7200?style=flat-square&logo=DevExpress&logoColor=white)](https://supportcenter.devexpress.com/ticket/details/T1309846)
43
[![](https://img.shields.io/badge/📖_How_to_use_DevExpress_Examples-e9f6fc?style=flat-square)](https://docs.devexpress.com/GeneralInformation/403183)
54
[![](https://img.shields.io/badge/💬_Leave_Feedback-feecdd?style=flat-square)](#does-this-example-address-your-development-requirementsobjectives)
@@ -11,16 +10,16 @@ The [DevExpress AI Chat](https://docs.devexpress.com/Blazor/DevExpress.AIIntegra
1110
- Use inference parameters to control AI model behavior and creativity.
1211
- Limit token usage for a single call to manage costs and performance.
1312
- Sanitize user prompts and model outputs to secure your app.
14-
- Define system prompts that give the AI clear instructions on what to do.
13+
- Define system prompts that give AI clear instructions on what to do.
1514
- Request AI answers in Markdown and display them as HTML.
16-
- Programmatically clear the chat and reset the context.
15+
- Programmatically clear the chat and reset context.
1716
- Programmatically send messages to the chat.
1817

1918
![DevExpress Blazor AI Chat — Grammar & Style Assistant](ai-chat-grammar-assistant.png)
2019

2120
## Setup and Configuration
2221

23-
To run this example, configure the project dependencies and set up secure authentication for an AI service.
22+
To run this example, configure project dependencies and set up secure authentication for the desired AI service.
2423

2524
### AI Packages
2625

@@ -29,7 +28,7 @@ We use the following versions of Microsoft AI packages in the project:
2928
- [Microsoft.Extensions.AI](https://www.nuget.org/packages/Microsoft.Extensions.AI) | **9.7.1**
3029
- [Microsoft.Extensions.AI.OpenAI](https://www.nuget.org/packages/Microsoft.Extensions.AI.OpenAI) | **9.7.1-preview.1.25365.4**
3130

32-
We do not guarantee compatibility or correct operation with higher versions. Refer to the following announcement for additional information: [DevExpress.AIIntegration moves to a stable version](https://supportcenter.devexpress.com/ticket/details/t1292705/devexpress-aiintegration-references-stable-versions-of-microsoft-ai-packages).
31+
We cannot guarantee compatibility or correct execution with newer versions. Refer to the following announcement for additional information: [DevExpress.AIIntegration moves to a stable version](https://supportcenter.devexpress.com/ticket/details/t1292705/devexpress-aiintegration-references-stable-versions-of-microsoft-ai-packages).
3332

3433
### Register AI Service
3534

@@ -49,11 +48,11 @@ string OpenAIKey = Environment.GetEnvironmentVariable("OPENAI_KEY");
4948
5049
## Implementation Details
5150

52-
This section introduces the key code blocks used in the example and how they work together to deliver a complete AI chat experience.
51+
This section introduces key code blocks used in the example and how they work together to deliver a complete AI chat experience.
5352

5453
### Inference Parameters
5554

56-
Inference parameters are runtime settings that control how a model generates an output. You can use them to change creativity, length, or randomness of a response without retraining the model.
55+
Inference parameters are runtime settings that control how a model generates output. You can use them to change creativity, length, or randomness of a response without retraining the model.
5756

5857
This example allows the user to control model [temperature](https://docs.devexpress.com/Blazor/DevExpress.AIIntegration.Blazor.Chat.DxAIChat.Temperature).
5958

@@ -84,7 +83,7 @@ This example allows the user to control model [temperature](https://docs.devexpr
8483

8584
A [token](https://platform.openai.com/tokenizer) is a basic unit of text that an AI model reads/writes. A token can be a whole word, part of a word, or a punctuation mark.
8685

87-
OpenAI [bills](https://openai.com/api/pricing/) you for the total token count. To save money, [set](https://docs.devexpress.com/Blazor/DevExpress.AIIntegration.Blazor.Chat.DxAIChat.MaxTokens) a maximum number of tokens. A token limit also helps you stay within the model's context window, which ensures the AI retains earlier parts of the conversation.
86+
OpenAI [bills](https://openai.com/api/pricing/) you for the total token count. To save money, [set](https://docs.devexpress.com/Blazor/DevExpress.AIIntegration.Blazor.Chat.DxAIChat.MaxTokens) a maximum number of tokens. A token limit also helps you stay within the model's context window, which ensures AI retains earlier parts of the conversation.
8887

8988
```razor
9089
<DxSpinEdit @bind-Value="@MaxTokens" MinValue="0" Increment="10" />
@@ -113,7 +112,7 @@ OpenAI [bills](https://openai.com/api/pricing/) you for the total token count. T
113112

114113
To maintain data privacy, remove Personally Identifiable Information (PII) from your prompts. This practice ensures that sensitive details, such as email addresses or credit card numbers, do not reach external servers.
115114

116-
Handle the [MessageSent](https://docs.devexpress.com/Blazor/DevExpress.AIIntegration.Blazor.Chat.DxAIChat.MessageSent) event to override the automatic message delivery and preprocess the messages before they are sent to OpenAI.
115+
Handle the [MessageSent](https://docs.devexpress.com/Blazor/DevExpress.AIIntegration.Blazor.Chat.DxAIChat.MessageSent) event to override the automatic message delivery and preprocess messages before they are sent to OpenAI.
117116

118117
```razor
119118
<DxAIChat MessageSent="@MessageSent">
@@ -141,9 +140,9 @@ After the message is processed, call [SendMessage](https://docs.devexpress.com/B
141140

142141
### AI Instructions
143142

144-
System prompts define instructions and boundaries for the AI, which restrict the model's focus to a specific role. This prevents the model from "chatting" with the user.
143+
System prompts define instructions and boundaries for AI, which restrict the model's focus to a specific role. This prevents the model from "chatting" with the user.
145144

146-
This example establishes the AI as a proofreader with expert English skills. This specific identity ensures that the model fixes all grammar and punctuation errors and enhance the clarity and flow of the sentences.
145+
This example establishes AI as the proofreader with expert English skills. This specific identity ensures that the model fixes all grammar and punctuation errors and enhances clarity/sentence flow.
147146

148147
```text
149148
You are a proofreader with excellent English skills. Your tasks:
@@ -213,7 +212,7 @@ Set the [ResponseContentFormat](https://docs.devexpress.com/Blazor/DevExpress.AI
213212
```
214213

215214
> [!IMPORTANT]
216-
> Always sanitize HTML generated from Markdown to prevent cross-site scripting (XSS). Use a trusted sanitizer (for example, the [HtmlSanitizer](https://www.nuget.org/packages/HtmlSanitizer/) package) to allow only safe tags and attributes before the browser renders content.
215+
> Always sanitize HTML generated from Markdown to prevent cross-site scripting (XSS) attacks. Use a trusted sanitizer (for example, the [HtmlSanitizer](https://www.nuget.org/packages/HtmlSanitizer/) package) to allow only safe tags and attributes before the browser renders content.
217216
218217
### Programmatically Handle Messages
219218

@@ -244,7 +243,7 @@ void SendSampleMessage() {
244243
- [MessageSent](https://docs.devexpress.com/Blazor/DevExpress.AIIntegration.Blazor.Chat.DxAIChat.MessageSent)
245244

246245
<!-- feedback -->
247-
## Does this example address your development requirements/objectives?
246+
## Does This Example Address Your Development Requirements/Objectives?
248247

249248
[<img src="https://www.devexpress.com/support/examples/i/yes-button.svg"/>](https://www.devexpress.com/support/examples/survey.xml?utm_source=github&utm_campaign=blazor-ai-chat-spell-checker&~~~was_helpful=yes) [<img src="https://www.devexpress.com/support/examples/i/no-button.svg"/>](https://www.devexpress.com/support/examples/survey.xml?utm_source=github&utm_campaign=blazor-ai-chat-spell-checker&~~~was_helpful=no)
250249

0 commit comments

Comments
 (0)