microsoft/teams.net

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
8e11e5e231765b6fbeae91b4033a354e2340d0af

Branches

Tags

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

Clone

HTTPS

Download ZIP

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

38lines · 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)]
9public class PromptAttribute : Attribute
10{
11 /// <summary>
12 /// the prompts name
13 /// </summary>
14 public string? Name { get; private set; }
15
16 /// <summary>
17 /// the prompts description
18 /// </summary>
19 public string? Description { get; private set; }
20
21 /// <summary>
22 /// the prompts instructions
23 /// </summary>
24 public ITemplate? Instructions { get; private set; }
25
26 public PromptAttribute(string? Name = null, string? Description = null)
27 {
28 this.Name = Name;
29 this.Description = Description;
30 }
31
32 public PromptAttribute(string? Name = null, string? Description = null, params string[] Instructions)
33 {
34 this.Name = Name;
35 this.Description = Description;
36 this.Instructions = new StringTemplate(string.Join("\n", Instructions));
37 }
38}