microsoft/teams.net
Publicmirrored fromhttps://github.com/microsoft/teams.netAvailable
core/samples/A2ABot/A2A/AgentCardFactory.cs
38lines · modecode
| 1 | // Copyright (c) Microsoft Corporation. |
| 2 | // Licensed under the MIT License. |
| 3 | |
| 4 | using A2A; |
| 5 | |
| 6 | namespace A2ABot.A2A; |
| 7 | |
| 8 | internal static class AgentCardFactory |
| 9 | { |
| 10 | public static AgentCard Build(Config config) => new() |
| 11 | { |
| 12 | Name = config.Name, |
| 13 | Description = config.Description, |
| 14 | Version = "1.0.0", |
| 15 | SupportedInterfaces = |
| 16 | [ |
| 17 | new AgentInterface |
| 18 | { |
| 19 | Url = $"{config.SelfUrl}/a2a", |
| 20 | ProtocolBinding = "JSONRPC", |
| 21 | ProtocolVersion = "1.0", |
| 22 | } |
| 23 | ], |
| 24 | DefaultInputModes = ["application/json"], |
| 25 | DefaultOutputModes = ["text/plain"], |
| 26 | Capabilities = new AgentCapabilities { Streaming = false }, |
| 27 | Skills = |
| 28 | [ |
| 29 | new AgentSkill |
| 30 | { |
| 31 | Id = "handoff", |
| 32 | Name = "Handoff", |
| 33 | Description = $"Accepts handoffs of users from peer bots. Specialty: {config.Description}", |
| 34 | Tags = ["a2a", "teams", "handoff"], |
| 35 | } |
| 36 | ], |
| 37 | }; |
| 38 | } |
| 39 | |