Default RichContent
This commit is contained in:
parent
e43b3e6fa1
commit
89c62bf496
|
|
@ -1,4 +1,5 @@
|
|||
using BotSharp.Abstraction.Agents.Models;
|
||||
using BotSharp.Abstraction.Messaging.Models.RichContent;
|
||||
using BotSharp.Abstraction.Routing;
|
||||
using BotSharp.Abstraction.Routing.Settings;
|
||||
using System.Drawing;
|
||||
|
|
@ -100,6 +101,15 @@ public partial class ConversationService
|
|||
_logger.LogInformation(text);
|
||||
#endif
|
||||
|
||||
// Only read content from RichContent for UI rendering. When richContent is null, create a basic text message for richContent.
|
||||
var state = _services.GetRequiredService<IConversationStateService>();
|
||||
message.RichContent = message.RichContent ?? new RichContent<TextMessage>
|
||||
{
|
||||
Recipient = new Recipient { Id = state.GetConversationId() },
|
||||
MessageingType = "RESPONSE",
|
||||
Message = new TextMessage { Text = message.Content }
|
||||
};
|
||||
|
||||
var hooks = _services.GetServices<IConversationHook>().ToList();
|
||||
foreach (var hook in hooks)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in a new issue