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
The interface FeedbackLoopData states the data coming back is in the actionValue property, but looks like it should be actionType (or the data returned is incorrect).
Not sure if the response contains the incorrect property name, or if the interface is incorrect... suspect the latter...
import {
Application,
ActionPlanner,
DefaultConversationState,
++ FeedbackLoopData,
Memory,
OpenAIModel,
PromptManager,
TurnState
} from "@microsoft/teams-ai";
// ... omitted for brevity
const app = new Application({
storage,
ai: {
planner,
++ enable_feedback_loop: true,
},
});
// ... omitted for brevity
++// PATCH to fix interface bug:++// > FeedbackLoopData expects `actionValue` but data returned is in `actionType`++export interface FeedbackLoopDataPatch extends FeedbackLoopData {++ actionType: {++ reaction: string;++ feedback: string;++ };++}++app.feedbackLoop(async (context: TurnContext, state: TurnState, feedbackLoopData: FeedbackLoopData) => {++ // what do you get back normally... rut-ro... you get `actionType`, not `actionValue`++ console.log('Feedback loop data:', feedbackLoopData);++++ // patch the bug with custom interface from above++ const fbData = feedbackLoopData as FeedbackLoopDataPatch;++ if (fbData.actionType?.reaction === 'like') {++ console.log(`👍 ${fbData.actionType?.feedback}`);++ } else {++ console.log(`👎 ${fbData.actionType?.feedback}`);++ }++});
Console output from above test:
Feedback loop data: {
actionName: 'feedback',
actionType: { reaction: 'like', feedback: 'rut ro' },
replyToId: undefined
}
👍 rut to
Reproduction Steps
Create simple chat bot (VSC TTK > New App > Custom Engine Agent > Basic AI Chat Bot
Implement feedback using the steps above.
Add necessary Azure AI deployment details to ./env/.env.testtool.user
Run in Teams Test Test
Send message to get bot to respond
Add reaction
Look at console that validates what's in the description above
The text was updated successfully, but these errors were encountered:
Thanks for filing this bug- it should be under actionValue but there have been some recent updates with the feedback loop API that may have changed this- investigating & will follow up with you soon
Language
Javascript/Typescript
Version
1.6.0
Description
The interface FeedbackLoopData states the data coming back is in the
actionValue
property, but looks like it should beactionType
(or the data returned is incorrect).Not sure if the response contains the incorrect property name, or if the interface is incorrect... suspect the latter...
Console output from above test:
Reproduction Steps
The text was updated successfully, but these errors were encountered: