You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: MAUI/AIAssistView/items.md
+55Lines changed: 55 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -427,3 +427,58 @@ The `SfAIAssistView` control includes a built-in event called [CardTapped](https
427
427
428
428
{% endhighlight %}
429
429
{% endtabs %}
430
+
431
+
## Show error response
432
+
433
+
The `SfAIAssistView` allows to display error responses by setting the error text to the `AssistItem.ErrorMessage` property, ensuring clear notification when an error occurs during AI interactions.
Text = "Active Listening – Fully focusing and responding to the speaker with attention and empathy. Passive Listening – Hearing without reacting or engaging with the speaker. Empathetic Listening – Understanding the speaker’s emotions and feelings deeply.",
465
+
IsRequested = false,
466
+
};
467
+
this.AssistItems.Add(responseItem);
468
+
}
469
+
catch (Exception ex)
470
+
{
471
+
AssistItem errorItem = new AssistItem()
472
+
{
473
+
ErrorMessage = "An error occurred. Either the engine you requested does not exist or there was another issue processing your request.",
474
+
IsRequested = false,
475
+
};
476
+
this.AssistItems.Add(errorItem);
477
+
}
478
+
}
479
+
}
480
+
481
+
{% endhighlight %}
482
+
{% endtabs %}
483
+
484
+

Copy file name to clipboardExpand all lines: MAUI/Chat/messages.md
+217Lines changed: 217 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1314,8 +1314,223 @@ We have loaded a custom template if the message's text contains a particular tex
1314
1314
1315
1315

1316
1316
1317
+
### Using ChatMessageTemplateSelector for custom templates
1318
+
1319
+
Create a custom class that extends `ChatMessageTemplateSelector` and override the `OnSelectTemplate` method to return either a custom template or default templates based on the message item.
`SfChat` allows to change the vertical spacing between the messages in view using [MessageSpacing](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Chat.SfChat.html#Syncfusion_Maui_Chat_SfChat_MessageSpacing) property. The default value is `8`.
@@ -1601,6 +1816,8 @@ By default, the author’s name and avatar are displayed for the incoming messag
1601
1816
1602
1817

1603
1818
1819
+
N> In SfChat, when no avatar image is set, the author's initials are shown automatically based on their name.
1820
+
1604
1821
## MessageTimestampFormat for incoming and outgoing messages
1605
1822
1606
1823
The `SfChat` allows you specify the format in which timestamps are shown for outgoing and incoming messages. The date and time representation can be customized using the [IncomingMessageTimestampFormat](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Chat.SfChat.html#Syncfusion_Maui_Chat_SfChat_IncomingMessageTimestampFormat) and [OutgoingMessageTimestampFormat](https://help.syncfusion.com/cr/maui/Syncfusion.Maui.Chat.SfChat.html#Syncfusion_Maui_Chat_SfChat_OutgoingMessageTimestampFormat) properties.
0 commit comments