microsoft/teams.net
Publicmirrored from https://github.com/microsoft/teams.netAvailable
Samples/Samples.Mcp/Prompts/MainPrompt.cs
25lines · modecode
| 1 | using Microsoft.Teams.AI.Annotations; |
| 2 | using Microsoft.Teams.Api.Activities; |
| 3 | using Microsoft.Teams.Apps; |
| 4 | using Microsoft.Teams.Apps.Extensions; |
| 5 | |
| 6 | namespace Samples.Mcp.Prompts; |
| 7 | |
| 8 | [Prompt] |
| 9 | public class MainPrompt |
| 10 | { |
| 11 | private IContext<IActivity> Context => _services.GetTeamsContext(); |
| 12 | private readonly IServiceProvider _services; |
| 13 | |
| 14 | public MainPrompt(IServiceProvider provider) |
| 15 | { |
| 16 | _services = provider; |
| 17 | } |
| 18 | |
| 19 | [Function("echo")] |
| 20 | [Function.Description("echos back whatever you said")] |
| 21 | public string Echo([Param] string text) |
| 22 | { |
| 23 | return text; |
| 24 | } |
| 25 | } |