Skip to content
This repository was archived by the owner on Jan 5, 2026. It is now read-only.

Add support for Teams Adaptive cards in QnA Dialog#6625

Merged
tracyboehrer merged 7 commits into
mainfrom
anishprasad01/cqa-adaptive-card-update
May 16, 2023
Merged

Add support for Teams Adaptive cards in QnA Dialog#6625
tracyboehrer merged 7 commits into
mainfrom
anishprasad01/cqa-adaptive-card-update

Conversation

@anishprasad01
Copy link
Copy Markdown
Contributor

@anishprasad01 anishprasad01 commented Apr 27, 2023

Fixes Internal IcM Issue #373550043
Port of changes from microsoft/botbuilder-js#4467
Fixes #6630

Description

This PR allows for choosing Adaptive Cards formatted for use in Microsoft Teams instead of the default Hero Cards. This is done to support markdown formatting in QnA and CQA responses since Teams only supports markdown in Adaptive Cards. Changes are made in QnACardBuilder.cs and QnAMakerDialog.cs.

Using the new cards simple requires adding code in the bot to take in a new environment variable: UseTeamsAdaptiveCard = "true" and pass it to the QnA dialog constructor. If no changes are made, the bot will default to a Hero card.

Specific Changes

  • Create new methods to generate adaptive and hero cards
  • Modify the card builder class to take in a new bool field to allow for choosing whether or not to use an adaptive card
  • Modify the dialog class to accept the aforementioned bool field and pass it to the card builder.

Testing

Tests tun successfully.
Screenshot 2023-04-27 114013

@anishprasad01 anishprasad01 added customer-reported Issue is created by anyone that is not a collaborator in the repository. Bot Services Required for internal Azure reporting. Do not delete. Do not change color. feature-request A request for new functionality or an enhancement to an existing one. Area: AI-QnAMaker The issue is related to QnA Maker labels Apr 27, 2023
@anishprasad01 anishprasad01 self-assigned this Apr 27, 2023
@coveralls
Copy link
Copy Markdown
Collaborator

coveralls commented Apr 27, 2023

@anishprasad01 anishprasad01 marked this pull request as ready for review May 11, 2023 20:48
@anishprasad01 anishprasad01 requested a review from a team as a code owner May 11, 2023 20:48
@anishprasad01 anishprasad01 added the Automation: No parity PR does not need to be applied to other languages. label May 11, 2023
@tracyboehrer tracyboehrer requested a review from ceciliaavila May 12, 2023 13:22
Copy link
Copy Markdown
Collaborator

@ceciliaavila ceciliaavila left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just some small details. Also, we could add unit tests to cover the new methods.

Comment thread libraries/Microsoft.Bot.Builder.AI.QnA/Utils/QnACardBuilder.cs Outdated
Comment thread libraries/Microsoft.Bot.Builder.AI.QnA/Utils/QnACardBuilder.cs Outdated
Comment thread libraries/Microsoft.Bot.Builder.AI.QnA/Utils/QnACardBuilder.cs Outdated
Comment thread libraries/Microsoft.Bot.Builder.AI.QnA/Utils/QnACardBuilder.cs Outdated
@anishprasad01
Copy link
Copy Markdown
Contributor Author

@ceciliaavila,

Could you please provide feedback on the new tests?

@BruceHaley
Copy link
Copy Markdown
Contributor

✔️ No Binary Compatibility issues for Microsoft.Bot.Builder.AI.QnA.dll

This was referenced May 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Area: AI-QnAMaker The issue is related to QnA Maker Automation: No parity PR does not need to be applied to other languages. Bot Services Required for internal Azure reporting. Do not delete. Do not change color. customer-reported Issue is created by anyone that is not a collaborator in the repository. feature-request A request for new functionality or an enhancement to an existing one.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

QnAMakerDialog cannot render rich text in Teams channel

5 participants