Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DRAFT: Add like/dislike button #5399

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

compulim
Copy link
Contributor

@compulim compulim commented Jan 3, 2025

Fixes #

Changelog Entry

Description

Design

Ideas

  • We could simply look at the originating activity, and it would tell which button is actually pressed
  • We need some infrastructure to "modify the originating activity when we are processing more activities."
    • Somehow, a client-side "edit activity" feature
  • We will use the entities field and the LikeAction and DislikeAction
  • We will use W3C Hydra and URL Template to create the content body
    • We could build a form, or allow bot/web devs to build an AC-in-Markdown that would fulfill the form based on PropertyValueSpecification or HTML Content Validation
    • I believe PropertyValueSpecification and HTML Content Validation can be converged rather easily
  • We will have a special protocol handler for ms-directline://postback
    • In this PR or future, we could enable <form action="ms-directline://postback"> in Markdown too

To-do

(This is draft.)

  • Supports <form action="ms-directline://postback"> in Markdown as the container of activities
    • In future, we may consider this for container of Adaptive Cards
    • (Optional) If the activity content is non-interactive, we may not add <form>
  • Improves usePerformCardAction et al. to handle <form> submissions
    • May also need upgrade suggested actions and other existing card action containers
  • Uses use-schema-org-action for implementing the actions
  • Implements UI in Fluent, already done in white-label
    • Need links to Figma
  • Implements a facility to edit previous activities
    • Goal: useActivities() should return edited result
    • For example, modify the bot activity with PotentialActionStatus -> CompletedActionStatus

Specific Changes

-

  • I have added tests and executed them locally
  • I have updated CHANGELOG.md
  • I have updated documentation

Review Checklist

This section is for contributors to review your work.

  • Accessibility reviewed (tab order, content readability, alt text, color contrast)
  • Browser and platform compatibilities reviewed
  • CSS styles reviewed (minimal rules, no z-index)
  • Documents reviewed (docs, samples, live demo)
  • Internationalization reviewed (strings, unit formatting)
  • package.json and package-lock.json reviewed
  • Security reviewed (no data URIs, check for nonce leak)
  • Tests reviewed (coverage, legitimacy)

@iMicknl
Copy link
Member

iMicknl commented Jan 6, 2025

@compulim are you aware of the feature that Teams includes? Where you can set 'feedbackLoopEnabled' in channelData?See https://github.com/microsoft/teams-ai/blob/main/getting-started/CONCEPTS/POWERED-BY-AI.md#feedback-loop. This will render a dialog in Teams, which will return a { name: "message/submitAction", type: "invoke" } with the feedback in the value property.

Would be great if these like/dislike buttons could be standardized across the channels supported by the Bot Service (or a way to map 'feedbackLoopEnabled' to way of working in BotFramework-Webchat).

@compulim
Copy link
Contributor Author

compulim commented Jan 6, 2025

@compulim are you aware of the feature that Teams includes? Where you can set 'feedbackLoopEnabled' in channelData?See https://github.com/microsoft/teams-ai/blob/main/getting-started/CONCEPTS/POWERED-BY-AI.md#feedback-loop. This will render a dialog in Teams, which will return a { name: "message/submitAction", type: "invoke" } with the feedback in the value property.

Would be great if these like/dislike buttons could be standardized across the channels supported by the Bot Service (or a way to map 'feedbackLoopEnabled' to way of working in BotFramework-Webchat).

AFAIK, it is a quick solution: a simple flag to enable the dialog, without ability to put a payload for more debugging information for prompt engineers.

Invoke activity activity isn't supported across the board. The URL handler design here should be able to send the response via postback or invoke, depending on what the bot choose in the original payload.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants