DxAIChat.ResponseContentFormat Property
Specifies the format of response content.
Namespace: DevExpress.AIIntegration.Blazor.Chat
Assembly: DevExpress.AIIntegration.Blazor.Chat.v24.2.dll
NuGet Package: DevExpress.AIIntegration.Blazor.Chat
Declaration
[Parameter]
public ResponseContentFormat ResponseContentFormat { get; set; }
Property Value
Type | Description |
---|---|
ResponseContentFormat | Content format. |
Available values:
Name | Description |
---|---|
Markdown | An assistant sends the response as Markdown. |
PlainText | An assistant sends the response as plain text. |
Remarks
The AI service uses plain text as the default response format. To display rich formatted messages, set the ResponseContentFormat
property to Markdown
and use a markdown processor to convert the response content to HTML code.
@using Markdig;
<style>
.demo-chat {
width: 100%;
height: 400px;
}
</style>
<DxAIChat CssClass="demo-chat" ResponseContentFormat="ResponseContentFormat.Markdown">
<MessageContentTemplate>
@ToHtml(context.Content)
</MessageContentTemplate>
</DxAIChat>
@code {
MarkupString ToHtml(string text) {
return (MarkupString)Markdown.ToHtml(text);
}
}
See Also