microsoft/teams.net

Public

mirrored fromhttps://github.com/microsoft/teams.netAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
fix/msal-cache

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

Libraries/Microsoft.Teams.AI/Annotations/PromptAttribute.cs

39lines · modecode

1// Copyright (c) Microsoft Corporation. All rights reserved.
2// Licensed under the MIT License.
3
4using Microsoft.Teams.AI.Templates;
5
6namespace Microsoft.Teams.AI.Annotations;
7
8[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, Inherited = true)]
9[Obsolete("Microsoft.Teams.AI is deprecated and will be removed by end of summer 2026.")]
10public class PromptAttribute : Attribute
11{
12 /// <summary>
13 /// the prompts name
14 /// </summary>
15 public string? Name { get; private set; }
16
17 /// <summary>
18 /// the prompts description
19 /// </summary>
20 public string? Description { get; private set; }
21
22 /// <summary>
23 /// the prompts instructions
24 /// </summary>
25 public ITemplate? Instructions { get; private set; }
26
27 public PromptAttribute(string? Name = null, string? Description = null)
28 {
29 this.Name = Name;
30 this.Description = Description;
31 }
32
33 public PromptAttribute(string? Name = null, string? Description = null, params string[] Instructions)
34 {
35 this.Name = Name;
36 this.Description = Description;
37 this.Instructions = new StringTemplate(string.Join("\n", Instructions));
38 }
39}