Skip to content

Commit 89d9616

Browse files
990970: AI-Samples documentation
1 parent 16956b7 commit 89d9616

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

blazor/smart-ai-solutions/ai-samples/rich-text-editor/writting-assistance.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ await builder.Build().RunAsync();
232232

233233
This guide explains how to integrate a full-featured AI writing assistant into the Blazor Rich Text Editor using Azure OpenAI (via Semantic Kernel). The implementation supports **Rephrase**, **Correct Grammar**, **Summarize**, **Elaborate**, and **Translate** with live preview, dynamic tone/language controls, skeleton loading, and safe, undoable content replacement.
234234

235-
## How the Custom Toolbar is Rendered
235+
### How the Custom Toolbar is Rendered
236236

237237
The toolbar uses [RichTextEditorCustomToolbarItems](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.RichTextEditor.RichTextEditorCustomToolbarItems.html) to inject a custom item named AI.
238238

@@ -278,11 +278,11 @@ An additional `SfButton` for **Rephrase** is provided for quick access.
278278
{% endhighlight %}
279279
{% endtabs %}
280280

281-
## AI Assistant Dialog – Layout and Dynamic Controls
281+
### AI Assistant Dialog – Layout and Dynamic Controls
282282

283283
The AI Assistant dialog provides a responsive, user-friendly interface for interacting with AI-generated content. It is designed as a modal dialog that overlays the editor and ensures proper z-index stacking for seamless integration.
284284

285-
### Dialog Structure
285+
#### Dialog Structure
286286

287287
The dialog is divided into two main rows:
288288

@@ -436,7 +436,7 @@ The dialog is divided into two main rows:
436436
{% endhighlight %}
437437
{% endtabs %}
438438

439-
## Opening the AI Dialog and Preserving Selection
439+
### Opening the AI Dialog and Preserving Selection
440440

441441
The `DialogueOpen()` method opens the AI dialog when an action is selected and prepares the editor for processing. It first uses `GetSelectedHtmlAsync()` to capture the highlighted content with its formatting. If no text is selected, a toast message alerts the user to select content before proceeding.
442442

@@ -489,7 +489,7 @@ private async Task DialogueOpen(string selectedQuery)
489489

490490
```
491491

492-
## Building and Sending the AI
492+
### Building and Sending the AI
493493

494494
The AI prompt is built in two parts: **user intent** and **system instruction**.
495495

@@ -564,7 +564,7 @@ private async Task UpdateAISuggestionsData()
564564

565565
```
566566

567-
## Replacing AI Result Back into the Editor (with Undo Support)
567+
### Replacing AI Result Back into the Editor (with Undo Support)
568568

569569
Once the AI-generated content is ready, it needs to be inserted exactly where the user originally selected text, without disturbing the rest of the document. This is achieved using the [ExecuteCommandAsync](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.RichTextEditor.SfRichTextEditor.html#Syncfusion_Blazor_RichTextEditor_SfRichTextEditor_ExecuteCommandAsync_Syncfusion_Blazor_RichTextEditor_CommandName_System_String_Syncfusion_Blazor_RichTextEditor_ExecuteCommandOption_) method with the `InsertHTML` command. The `Undo` option is enabled to allow users to revert changes if needed.
570570

0 commit comments

Comments
 (0)