Merge pull request #202 from hchen2020/master
Fix rich content text in InstructExecutor.
This commit is contained in:
commit
cbd76c4e8a
|
|
@ -101,6 +101,14 @@ public partial class ConversationService
|
|||
_logger.LogInformation(text);
|
||||
#endif
|
||||
|
||||
// Process rich content
|
||||
if (response.RichContent != null &&
|
||||
response.RichContent is RichContent<IMessageTemplate> template &&
|
||||
string.IsNullOrEmpty(template.Message.Text))
|
||||
{
|
||||
template.Message.Text = response.Content;
|
||||
}
|
||||
|
||||
// Only read content from RichContent for UI rendering. When richContent is null, create a basic text message for richContent.
|
||||
var state = _services.GetRequiredService<IConversationStateService>();
|
||||
response.RichContent = response.RichContent ?? new RichContent<IMessageTemplate>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,4 @@
|
|||
using BotSharp.Abstraction.Functions.Models;
|
||||
using BotSharp.Abstraction.Messaging.Models;
|
||||
using BotSharp.Abstraction.Messaging.Models.RichContent;
|
||||
using BotSharp.Abstraction.Planning;
|
||||
using BotSharp.Abstraction.Routing;
|
||||
|
||||
|
|
@ -35,14 +33,6 @@ public class InstructExecutor : IExecutor
|
|||
response.MessageId = message.MessageId;
|
||||
response.Instruction = inst;
|
||||
|
||||
// Process rich content
|
||||
if (response.RichContent != null &&
|
||||
response.RichContent is RichContent<IMessageTemplate> template &&
|
||||
string.IsNullOrEmpty(template.Message.Text))
|
||||
{
|
||||
template.Message.Text = response.Content;
|
||||
}
|
||||
|
||||
return response;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue