MessageSendingEventArgs.Text Property
Returns the text of the user message.
Namespace: DevExpress.AIIntegration.Blazor.Chat
Assembly: DevExpress.AIIntegration.Blazor.Chat.v26.1.dll
Declaration
public string Text { get; set; }
Property Value
| Type | Description |
|---|---|
| String | Message text. |
Remarks
Use the Text property to access or modify the message text.
The following code snippet logs the original message and sends a modified prompt to the AI service:
<DxAIChat MessageSending="OnMessageSending" />
@code {
private async Task OnMessageSending(MessageSendingEventArgs args) {
args.Cancel = true;
Console.WriteLine($"Original message text: {args.Text}");
StringBuilder sb = new StringBuilder();
sb.AppendLine("Hello!");
sb.AppendLine(args.Text);
await args.Chat.SendMessageAsync(sb.ToString());
}
}
See Also