-
Notifications
You must be signed in to change notification settings - Fork 14
Adaptive card sample updates #121
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -200,17 +200,14 @@ private static VisualizationResource CreateAdaptiveCardResource(List<IResource> | |||||
| { | ||||||
| type = "TextBlock", | ||||||
| text = "🔍 Clinical Entities Extracted", | ||||||
| weight = "Bolder", | ||||||
| size = "Large", | ||||||
| color = "Accent" | ||||||
| weight = "bolder", | ||||||
| }, | ||||||
| new | ||||||
| { | ||||||
| type = "TextBlock", | ||||||
| text = $"Found {entities.Count} clinical {(entities.Count == 1 ? "entity" : "entities")} in the note", | ||||||
| wrap = true, | ||||||
| size = "Medium", | ||||||
| spacing = "Small" | ||||||
| spacing = "small" | ||||||
| } | ||||||
| }; | ||||||
|
|
||||||
|
|
@@ -227,7 +224,7 @@ private static VisualizationResource CreateAdaptiveCardResource(List<IResource> | |||||
| { | ||||||
| type = "Container", | ||||||
| style = "emphasis", | ||||||
| spacing = "Medium", | ||||||
| spacing = "medium", | ||||||
| items = new object[] | ||||||
| { | ||||||
| new | ||||||
|
|
@@ -245,8 +242,7 @@ private static VisualizationResource CreateAdaptiveCardResource(List<IResource> | |||||
| { | ||||||
| type = "TextBlock", | ||||||
| text = GetEntityIcon(entityType), | ||||||
| size = "Large", | ||||||
| spacing = "None" | ||||||
| spacing = "none" | ||||||
| } | ||||||
| } | ||||||
| }, | ||||||
|
|
@@ -260,25 +256,21 @@ private static VisualizationResource CreateAdaptiveCardResource(List<IResource> | |||||
| { | ||||||
| type = "TextBlock", | ||||||
| text = $"**{GetEntityTypeDisplayName(entityType)}**", | ||||||
| weight = "Bolder", | ||||||
| size = "Medium", | ||||||
| spacing = "None" | ||||||
| weight = "bolder", | ||||||
| spacing = "none" | ||||||
| }, | ||||||
| new | ||||||
| { | ||||||
| type = "TextBlock", | ||||||
| text = entityName, | ||||||
| color = "Accent", | ||||||
| spacing = "None" | ||||||
| spacing = "none" | ||||||
| }, | ||||||
| new | ||||||
| { | ||||||
| type = "TextBlock", | ||||||
| text = entityValue, | ||||||
| wrap = true, | ||||||
| size = "Small", | ||||||
| color = "Default", | ||||||
| spacing = "Small" | ||||||
| spacing = "small" | ||||||
| } | ||||||
| } | ||||||
| } | ||||||
|
|
@@ -314,46 +306,49 @@ private static VisualizationResource CreateAdaptiveCardResource(List<IResource> | |||||
| { | ||||||
| type = "TextBlock", | ||||||
| text = $"Processed at {DateTime.UtcNow:yyyy-MM-dd HH:mm:ss} UTC", | ||||||
| size = "Small", | ||||||
| horizontalAlignment = "Right", | ||||||
| spacing = "Medium" | ||||||
| spacing = "medium" | ||||||
| }); | ||||||
|
|
||||||
| return new VisualizationResource | ||||||
| { | ||||||
| Id = Guid.NewGuid().ToString(), | ||||||
| Type = "AdaptiveCard", | ||||||
| Subtype = VisualizationSubtype.Note, | ||||||
| Subtype = VisualizationSubtype.Timeline, | ||||||
| CardTitle = "Clinical Entities Extracted", | ||||||
| AdaptiveCardPayload = new | ||||||
| PartnerLogo = "https://example.com/assets/sample-extension-logo.png", | ||||||
| AdaptiveCardPayload = new AdaptiveCardPayload | ||||||
| { | ||||||
| type = "AdaptiveCard", | ||||||
| version = "1.3", | ||||||
| body = bodyElements.ToArray() | ||||||
| Type = "AdaptiveCard", | ||||||
| Version = "1.3", | ||||||
|
||||||
| Version = "1.3", |
Copilot
AI
Nov 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[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() |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,37 @@ | ||||||
| // Copyright (c) Microsoft Corporation. | ||||||
| // Licensed under the MIT License. | ||||||
|
|
||||||
| using System.Collections.Generic; | ||||||
| using System.Text.Json.Serialization; | ||||||
|
|
||||||
| namespace Dragon.Copilot.Models; | ||||||
|
|
||||||
| /// <summary> | ||||||
| /// Adaptive card payload structure | ||||||
| /// </summary> | ||||||
| public class AdaptiveCardPayload | ||||||
| { | ||||||
| /// <summary> | ||||||
| /// Adaptive card schema URL | ||||||
| /// </summary> | ||||||
| [JsonPropertyName("$schema")] | ||||||
| public string Schema {get; } = "http://adaptivecards.io/schemas/adaptive-card.json"; | ||||||
|
||||||
| public string Schema {get; } = "http://adaptivecards.io/schemas/adaptive-card.json"; | |
| public string Schema { get; } = "http://adaptivecards.io/schemas/adaptive-card.json"; |
Copilot
AI
Nov 17, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
Typeproperty assignment is redundant sinceAdaptiveCardPayload.Typealready has a default value of "AdaptiveCard". This line can be removed.