public async Task<MessageFetchTaskResponse> OnFetchFeedbackForm(ITurnContext turnContext, AppState turnState, object data, CancellationToken cancel)
{
var cardContent = await ReponseExtensions.GenerateFeedbackAdaptiveCardAsync(cancel);
return new MessageFetchTaskResponse
{
TaskInfo =
new TaskModuleTaskInfo()
{
Height = 500,
Width = 600,
Title = "Feedback",
Card = new Attachment
{
ContentType = AdaptiveCard.ContentType,
Content = AdaptiveCard.FromJson(cardContent).Card
}
}
};
}
Question
I'm observing two issues with custom feedback loops when using the library within my .NET project.
Setting
feedbackLoopTypeto"custom"on aStreamingChannelDataobject included as ChannelData in a message Activity response from the bot does not properly enable Teams to be able to fetch a custom feedback form when clicking the feedback buttons.This appears to be related to an issue with how the
feedbackLoopTypeis serialized to the channelData property within the JSON. Currently, feedbackLoopType is included as a property of channelData when serialized. However, according to some docs, the bot framework API seems to expect this to be set like the following within the channelData property:Please see the code snippet below, should this be expected?
I'm running into an error when responding to
message/fetchTaskinvoke requests. The network trace in Teams shows the following error in the HTTP response from the invoke:{"errorCode":1008,"message":"<BotError>Error when processing invoke response: Task or Task Type is missing in Task Module response","standardizedError":{"errorCode":1008,"errorSubCode":1,"errorDescription":"<BotError>Error when processing invoke response: Task or Task Type is missing in Task Module response"}}. No exception is raised within the Teams AI library when responding. Example of the the handler is below. Adaptive Card included in the attachment has been validated in the Adaptive Card designer, and I did try swapping out a 'known working' card from another task module - same result. Anything I'm missing?Code snippets
Working example using TeamsChannelData instead of StreamingChannelData:
Expected to work, but not working:
Example of the message handler for OnFetchFeedbackForm