IAIChat.SendMessage(String, ChatRole) Method
In This Article
Sends a message to the chat.
Namespace: DevExpress.AIIntegration.Blazor.Chat
Assembly: DevExpress.AIIntegration.Blazor.Chat.v24.2.dll
NuGet Package: DevExpress.AIIntegration.Blazor.Chat
#Declaration
C#
Task SendMessage(
string messageContent,
ChatRole role
)
#Parameters
Name | Type | Description |
---|---|---|
message |
String | The message text to be sent. |
role | Microsoft. |
The role of the message owner. |
#Returns
Type | Description |
---|---|
Task | A task that is completed when the message is sent. |
#Remarks
Call the SendMessage
method to send a message to the chat.
razor
<DxAIChat MessageSent="MessageSent" />
@code {
async Task MessageSent(MessageSentEventArgs args) {
await args.Chat.SendMessage($"Processed: {args.Content}", ChatRole.Assistant);
}
}
See Also