Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR refactors the adaptive card implementation by introducing a strongly-typed AdaptiveCardPayload model and updating the ActionButtonType enum to use semantic button names. The changes improve type safety and align the codebase with adaptive card schema conventions.
- Introduced
AdaptiveCardPayloadclass to replace the genericobjecttype for better type safety - Refactored
ActionButtonTypeenum from generic styles (Primary/Secondary/Tertiary) to semantic action names (Accept/Copy/Reject/UpdateNote) - Updated sample extension to use lowercase property values for adaptive card elements (e.g., "bolder", "small", "medium") per the adaptive card schema specification
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| src/Dragon.Copilot.Models/VisualizationResource.cs | Changed AdaptiveCardPayload property from object to strongly-typed AdaptiveCardPayload class |
| src/Dragon.Copilot.Models/AdaptiveCardPayload.cs | New model class representing adaptive card structure with schema, type, version, and body properties |
| src/Dragon.Copilot.Models/ActionButtonType.cs | Refactored enum from generic button styles to semantic action types that better describe button purpose |
| samples/DragonCopilot/Workflow/SampleExtension.Web/Services/ProcessingService.cs | Updated sample to use new typed model, corrected adaptive card property casing, added missing properties (PartnerLogo, Code, References), and updated to use semantic ActionButtonType values |
| body = bodyElements.ToArray() | ||
| Type = "AdaptiveCard", | ||
| Version = "1.3", | ||
| Body = bodyElements.ToArray(), |
There was a problem hiding this comment.
[nitpick] The trailing comma after Body = bodyElements.ToArray() is unnecessary since it's the last property in the object initializer. While not incorrect, removing it would be more consistent with typical C# style.
| Body = bodyElements.ToArray(), | |
| Body = bodyElements.ToArray() |
| /// Adaptive card schema URL | ||
| /// </summary> | ||
| [JsonPropertyName("$schema")] | ||
| public string Schema {get; } = "http://adaptivecards.io/schemas/adaptive-card.json"; |
There was a problem hiding this comment.
Missing space between get and } in the property accessor. Should be { get; } for consistency with C# formatting conventions.
| public string Schema {get; } = "http://adaptivecards.io/schemas/adaptive-card.json"; | |
| public string Schema { get; } = "http://adaptivecards.io/schemas/adaptive-card.json"; |
| /// Type of the card (always "AdaptiveCard") | ||
| /// </summary> | ||
| [JsonPropertyName("type")] | ||
| public string Type { get; set; } = "AdaptiveCard"; |
There was a problem hiding this comment.
The Type property has inconsistent accessor pattern. It uses { get; set; } while the similar Schema property (line 18) uses { get; } (getter-only). Since the Type should always be "AdaptiveCard" according to the comment, consider making this getter-only like Schema: public string Type { get; } = "AdaptiveCard";
| public string Type { get; set; } = "AdaptiveCard"; | |
| public string Type { get; } = "AdaptiveCard"; |
| type = "AdaptiveCard", | ||
| version = "1.3", | ||
| body = bodyElements.ToArray() | ||
| Type = "AdaptiveCard", |
There was a problem hiding this comment.
The Type property assignment is redundant since AdaptiveCardPayload.Type already has a default value of "AdaptiveCard". This line can be removed.
| Type = "AdaptiveCard", |
| version = "1.3", | ||
| body = bodyElements.ToArray() | ||
| Type = "AdaptiveCard", | ||
| Version = "1.3", |
There was a problem hiding this comment.
The Version property assignment is redundant since AdaptiveCardPayload.Version already has a default value of "1.3". This line can be removed.
| Version = "1.3", |
* added a python sample * deps(deps): bump @inquirer/prompts in /tools/dragon-extension-cli (#117) Bumps [@inquirer/prompts](https://github.com/SBoudrias/Inquirer.js) from 7.9.0 to 7.10.0. - [Release notes](https://github.com/SBoudrias/Inquirer.js/releases) - [Commits](https://github.com/SBoudrias/Inquirer.js/compare/@inquirer/prompts@7.9.0...@inquirer/prompts@7.10.0) --- updated-dependencies: - dependency-name: "@inquirer/prompts" dependency-version: 7.10.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * updated copilot review * Adaptive card sample updates (#121) * Updates to the adaptive card that's generated. * Update AdaptiveCardPayload.cs * added audio recordings to samples (#88) * added audio recordings to samples * added reference to sample audio-recordings * added reference to sample audio-recordings * deps(deps-dev): bump @types/archiver in /tools/dragon-extension-cli (#113) Bumps [@types/archiver](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/archiver) from 6.0.3 to 7.0.0. - [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases) - [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/archiver) --- updated-dependencies: - dependency-name: "@types/archiver" dependency-version: 7.0.0 dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * deps(deps): bump glob in /tools/dragon-extension-cli (#122) Bumps and [glob](https://github.com/isaacs/node-glob). These dependencies needed to be updated together. Updates `glob` from 10.4.5 to 10.5.0 - [Changelog](https://github.com/isaacs/node-glob/blob/main/changelog.md) - [Commits](isaacs/node-glob@v10.4.5...v10.5.0) Updates `glob` from 11.0.3 to 11.1.0 - [Changelog](https://github.com/isaacs/node-glob/blob/main/changelog.md) - [Commits](isaacs/node-glob@v10.4.5...v10.5.0) --- updated-dependencies: - dependency-name: glob dependency-version: 10.5.0 dependency-type: indirect - dependency-name: glob dependency-version: 11.1.0 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * 2473160 document update to QuickStart.md (#134) * 2473160 - Refreshed documentation based on creating an initial extension. * Fix link to QUICKSTART.md in README * Refine QUICKSTART.md for improved clarity Updated instructions for clarity and corrected numbering. * Adding missing images for Quickstart.md * Adding a link and description to the quickstart guide. * Update README.md Updated based on copilot suggestion. Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Moved quickstart link to Quickstart section. Added a link to the QUICKSTART guide in the README. * Added images that were missing. * Revise Quick Start Guide for Dragon Extension Developer Updated the Quick Start Guide to improve structure and clarity, including a new Table of Contents and revised sections for running locally and testing the extension. * Reorganize Quick Start Guide for clarity * Enhance Table of Contents with section descriptions Updated the Table of Contents with additional descriptions for sections. * Revise Quick Start Guide for Dragon Extension Developer Updated the title and added links to Microsoft Learn documentation for better guidance. * Revise sample script and add audio recordings reference Updated sample script and added reference to audio recordings. * Clarify Process API and packaging instructions Updated links and clarified instructions for Process API and packaging. * Moved quickstart link to Quickstart section. Moved quick start guide reference in README. * registering service principal images Add files for registering service principal section to better display how to register the Microsoft.HealthPlatform SP. * Add subscription image Adding subscription image to use in service principal section. * Update QUICKSTART.md with Azure registration steps Added instructions for registering the Microsoft.HealthPlatform resource provider and creating an application in Azure. * Clarify Service Principal registration process Clarify the registration of the Microsoft.HealthPlatform resource provider and note that it only needs to be done once. * Update QUICKSTART.md to utilize a block quote Using a block quote for better emphasis for the reader to notice the comments. Co-authored-by: Brandon Pollett <brandon.pollett@gmail.com> --------- Co-authored-by: Timothy Lee <timothy_lee@nuance.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Brandon Pollett <brandon.pollett@gmail.com> * deps(deps): bump actions/checkout from 5 to 6 (#124) Bumps [actions/checkout](https://github.com/actions/checkout) from 5 to 6. - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](actions/checkout@v5...v6) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '6' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * deps: Bump Microsoft.AspNetCore.Authentication.JwtBearer from 9.0.10 to 9.0.11 (#125) --- updated-dependencies: - dependency-name: Microsoft.AspNetCore.Authentication.JwtBearer dependency-version: 9.0.11 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * deps: Bump Microsoft.AspNetCore.OpenApi from 9.0.10 to 9.0.11 (#126) --- updated-dependencies: - dependency-name: Microsoft.AspNetCore.OpenApi dependency-version: 9.0.11 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * deps(deps-dev): bump rimraf in /tools/dragon-extension-cli (#130) Bumps [rimraf](https://github.com/isaacs/rimraf) from 6.1.0 to 6.1.2. - [Changelog](https://github.com/isaacs/rimraf/blob/main/CHANGELOG.md) - [Commits](isaacs/rimraf@v6.1.0...v6.1.2) --- updated-dependencies: - dependency-name: rimraf dependency-version: 6.1.2 dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * deps: Bump Microsoft.Identity.Web from 4.0.1 to 4.3.0 (#138) --- updated-dependencies: - dependency-name: Microsoft.Identity.Web dependency-version: 4.3.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * deps(deps): bump js-yaml in /tools/dragon-extension-cli (#139) Bumps [js-yaml](https://github.com/nodeca/js-yaml) to 4.1.1 and updates ancestor dependency . These dependencies need to be updated together. Updates `js-yaml` from 4.1.0 to 4.1.1 - [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md) - [Commits](nodeca/js-yaml@4.1.0...4.1.1) Updates `js-yaml` from 3.14.1 to 3.14.2 - [Changelog](https://github.com/nodeca/js-yaml/blob/master/CHANGELOG.md) - [Commits](nodeca/js-yaml@4.1.0...4.1.1) --- updated-dependencies: - dependency-name: js-yaml dependency-version: 4.1.1 dependency-type: direct:production - dependency-name: js-yaml dependency-version: 3.14.2 dependency-type: indirect ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * rewrite the README.md for the python workflow extension * clean up md files * updated README.md with cmds to create .venv and start python samlple server * clean up files * Added content table to README.md, updated output structure to accommondate the new adaptive card output version 1.6 * update the adaptive card output * update the reason for choose python 3.12 to avoid integration issues with AIML libs * make format consistent * Updated code based on code review comments. --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: yingding <yingdingwang@yahoo.de> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Brandon Pollett <brpoll@microsoft.com> Co-authored-by: Jim McDole <2876054+mcdolejt@users.noreply.github.com> Co-authored-by: leetimj <250227887+leetimj@users.noreply.github.com> Co-authored-by: Timothy Lee <timothy_lee@nuance.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Brandon Pollett <brandon.pollett@gmail.com>
No description provided.