Skip to content

Cards sample using AgentApplication #167

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

Open
wants to merge 31 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
c9958b7
Beginnings of a AgentApplication Cards sample
Mar 31, 2025
2494973
HandlingCards: more card handling
Mar 31, 2025
26fbf3c
HandlingCards: Added remaining cards
Mar 31, 2025
e4967ac
Corrected appsettings
Mar 31, 2025
12b939d
Moving HandlingCards to Samples (from test-bots)
Apr 9, 2025
be1a13e
Merge branch 'users/tracyboehrer/revert-anonymous-error' into users/t…
Apr 9, 2025
ab8322d
Updated Cards README
Apr 9, 2025
74608c0
Handling Teams lack of support for Video and Audio cards
Apr 9, 2025
d204501
Handling differing card support across channels
Apr 9, 2025
04dcf7e
Merge branch 'main' into users/tracyboehrer/cards-sample
tracyboehrer Apr 9, 2025
b74150f
Merge branch 'main' into users/tracyboehrer/cards-sample
tracyboehrer Apr 9, 2025
e7b5127
HandlingCards: Dropped support for AnimationCard on Teams channel
Apr 21, 2025
b14dba9
Merge branch 'main' into users/tracyboehrer/cards-sample
Apr 21, 2025
b1d264c
Fixed SLN for HandlingCards
Apr 21, 2025
85c7f93
HandlingCards: Matching latest Program.cs pattern
Apr 21, 2025
6a9ff60
Merge branch 'main' into users/tracyboehrer/cards-sample
MattB-msft Apr 22, 2025
640ce30
Merge branch 'main' into users/tracyboehrer/cards-sample
MattB-msft Apr 23, 2025
7bfef31
Merge branch 'main' into users/tracyboehrer/cards-sample
Apr 30, 2025
b948e14
Action.Execute debugging (not ready for sample yet)
May 1, 2025
bf04387
Merge branch 'main' into users/tracyboehrer/cards-sample
May 15, 2025
5296840
Added cards sample back
May 15, 2025
f0ffeff
Merge branch 'main' into users/tracyboehrer/cards-sample
May 16, 2025
7d4e6fd
Handling lack of ReceiptCard support in Teams
May 16, 2025
2bec8d6
HandleCards: More reasonable Action.Execute demo
May 16, 2025
ed5cd23
HandleCards README update
May 16, 2025
7e6781c
Merge branch 'main' into users/tracyboehrer/cards-sample
May 16, 2025
0633f17
Merge branch 'main' into users/tracyboehrer/cards-sample
Jun 8, 2025
bb4a720
Merge branch 'main' into users/tracyboehrer/cards-sample
Jun 11, 2025
5651563
Applied consistency changes coming to other samples to HandlingCards
Jun 12, 2025
ef74a8c
Merge branch 'main' into users/tracyboehrer/cards-sample
tracyboehrer Jun 12, 2025
59f681b
Merge branch 'main' into users/tracyboehrer/cards-sample
Jun 13, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions src/Microsoft.Agents.SDK.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 18
VisualStudioVersion = 18.0.10615.163
# Visual Studio Version 17
VisualStudioVersion = 17.14.36203.30 d17.14
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Libraries", "Libraries", "{4269F3C3-6B42-419B-B64A-3E6DC0F1574A}"
EndProject
@@ -131,6 +131,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Agents.Extensions
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TeamsAgent", "samples\Teams\TeamsAgent\TeamsAgent.csproj", "{D6410977-B795-C315-CC94-C2482E84BB4A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HandlingCards", "samples\HandlingCards\HandlingCards.csproj", "{8087E501-AFF3-3A69-BACA-FC83101DF3F9}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -717,6 +719,18 @@ Global
{D6410977-B795-C315-CC94-C2482E84BB4A}.Release|x64.Build.0 = Release|Any CPU
{D6410977-B795-C315-CC94-C2482E84BB4A}.Release|x86.ActiveCfg = Release|Any CPU
{D6410977-B795-C315-CC94-C2482E84BB4A}.Release|x86.Build.0 = Release|Any CPU
{8087E501-AFF3-3A69-BACA-FC83101DF3F9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8087E501-AFF3-3A69-BACA-FC83101DF3F9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8087E501-AFF3-3A69-BACA-FC83101DF3F9}.Debug|x64.ActiveCfg = Debug|Any CPU
{8087E501-AFF3-3A69-BACA-FC83101DF3F9}.Debug|x64.Build.0 = Debug|Any CPU
{8087E501-AFF3-3A69-BACA-FC83101DF3F9}.Debug|x86.ActiveCfg = Debug|Any CPU
{8087E501-AFF3-3A69-BACA-FC83101DF3F9}.Debug|x86.Build.0 = Debug|Any CPU
{8087E501-AFF3-3A69-BACA-FC83101DF3F9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8087E501-AFF3-3A69-BACA-FC83101DF3F9}.Release|Any CPU.Build.0 = Release|Any CPU
{8087E501-AFF3-3A69-BACA-FC83101DF3F9}.Release|x64.ActiveCfg = Release|Any CPU
{8087E501-AFF3-3A69-BACA-FC83101DF3F9}.Release|x64.Build.0 = Release|Any CPU
{8087E501-AFF3-3A69-BACA-FC83101DF3F9}.Release|x86.ActiveCfg = Release|Any CPU
{8087E501-AFF3-3A69-BACA-FC83101DF3F9}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -783,6 +797,7 @@ Global
{A44FB40F-1383-4AAB-A7F0-261CCFF172D8} = {927E4F54-6FBC-4390-BF64-BF3C1874C1AB}
{3D6B6E6F-483B-45F3-B53C-93A5A72EE0BF} = {AD743B78-D61F-4FBF-B620-FA83CE599A50}
{D6410977-B795-C315-CC94-C2482E84BB4A} = {674A812C-7287-4883-97F9-697D83750648}
{8087E501-AFF3-3A69-BACA-FC83101DF3F9} = {674A812C-7287-4883-97F9-697D83750648}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {F1E8E538-309A-46F8-9CE7-AEC6589FAE60}
95 changes: 95 additions & 0 deletions src/libraries/Core/Microsoft.Agents.Core/Models/Channels.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System.Text.RegularExpressions;

namespace Microsoft.Agents.Core.Models
{
/// <summary>
/// Channel definitions.
/// The various "support" methods come from: https://learn.microsoft.com/en-us/azure/bot-service/bot-service-channels-reference?view=azure-bot-service-4.0
/// </summary>
public static class Channels
{
/// <summary>
@@ -215,6 +221,95 @@ public static bool SupportsCardActions(string channelId, int buttonCnt = 100)
}
}

public static bool SupportsVideoCard(string channelId)
{
switch (channelId)
{
case Alexa:
case Msteams:
case Twilio:
return false;

default:
return true;
}
}

public static bool SupportsReceiptCard(string channelId)
{
switch (channelId)
{
case Alexa:
case Groupme:
case Msteams:
case Twilio:
return false;

default:
return true;
}
}

public static bool SupportsThumbnailCard(string channelId)
{
switch (channelId)
{
case Alexa:
return false;

// Text only
case Groupme:
case Line:
case Slack:
case Twilio:
return false;

default:
return true;
}
}

public static bool SupportsAudioCard(string channelId)
{
switch (channelId)
{
case Alexa:
case Msteams:
case Twilio:
return false;

// Text only
case Email:
case Groupme:
case Line:
case Slack:
case Telegram:
return false;

default:
return true;
}
}

public static bool SupportsAnimationCard(string channelId)
{
switch (channelId)
{
case Alexa:
case Msteams:
return false;

// Text only
case Email:
case Groupme:
case Twilio:
return false;

default:
return true;
}
}

/// <summary>
/// Determine if a Channel has a Message Feed.
/// </summary>
Loading
Oops, something went wrong.
Loading
Oops, something went wrong.