blazor-devexpress-dot-aiintegration-dot-blazor-dot-chat-dot-dxaichat-d260b5d3.md
Specifies the collection of prompt suggestions (hint bubbles).
Namespace : DevExpress.AIIntegration.Blazor.Chat
Assembly : DevExpress.AIIntegration.Blazor.Chat.v25.2.dll
NuGet Package : DevExpress.AIIntegration.Blazor.Chat
[Parameter]
public RenderFragment PromptSuggestions { get; set; }
| Type | Description |
|---|---|
| RenderFragment |
A collection of prompt suggestions (UI fragments).
|
DevExpress Blazor AI Chat supports prompt suggestions – hints that guide users to possible actions. The component displays prompt suggestions (hint bubbles) when the chat area is empty.
Follow the steps below to enable and configure prompt suggestions:
PromptSuggestions property with DxAIChatPromptSuggestion objects (hint bubbles).Run Demo: AI Chat – Prompt Suggestions
@using DevExpress.AIIntegration.Blazor.Chat
<DxAIChat Initialized="ChatInitialized">
<PromptSuggestions>
@foreach (var suggestion in PromptSuggestions) {
<DxAIChatPromptSuggestion Title="@suggestion.Title"
Text="@suggestion.Text"
PromptMessage="@suggestion.PromptMessage" />
}
</PromptSuggestions>
</DxAIChat>
@code {
List<PromptSuggestion> PromptSuggestions { get; set; }
void ChatInitialized() {
PromptSuggestions = GetData();
}
}
public List<PromptSuggestion> GetData() {
return new List<PromptSuggestion>() {
new PromptSuggestion("Tell me a joke", "Take a break and enjoy a quick laugh", "Tell me a joke."),
new PromptSuggestion("Summarize text", "Extract a quick summary (main ideas)", "Summarize the following text:"),
new PromptSuggestion("Write an email", "Make your text look and sound professional", "Format text as a formal email to a client:"),
new PromptSuggestion("Brainstorm ideas", "Get creative input for your tasks", "Help me brainstorm ideas for:"),
new PromptSuggestion("Fix my writing", "Avoid spelling, grammar, and style errors", "Proofread the following text:"),
};
}
public class PromptSuggestion {
public string Title { get; set; }
public string Text { get; set; }
public string PromptMessage { get; set; }
public PromptSuggestion (string title, string text, string promptMessage) {
Title = title;
Text = text;
PromptMessage = promptMessage;
}
}
See Also