microsoft/teams.net

Public

mirrored from https://github.com/microsoft/teams.netAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
v2.1.0-preview-0007

Branches

Tags

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

Clone

HTTPS

Download ZIP

Libraries/Microsoft.Teams.AI/Prompts/ChatPrompt/ChatPrompt.Options.cs

78lines · modecode

1// Copyright (c) Microsoft Corporation. All rights reserved.
2// Licensed under the MIT License.
3
4using Microsoft.Teams.AI.Templates;
5using Microsoft.Teams.Common.Logging;
6
7namespace Microsoft.Teams.AI.Prompts;
8
9/// <summary>
10/// ChatPrompt Options
11/// </summary>
12[Obsolete("Microsoft.Teams.AI is deprecated and will be removed by end of summer 2026.")]
13public class ChatPromptOptions
14{
15 /// <summary>
16 /// the name of the prompt
17 /// </summary>
18 public string? Name { get; set; }
19
20 /// <summary>
21 /// the description of the prompt
22 /// </summary>
23 public string? Description { get; set; }
24
25 /// <summary>
26 /// the defining characteristics/objective
27 /// of the prompt. This is commonly used to provide a system prompt.
28 /// If you supply the system prompt as part of the messages,
29 /// you do not need to supply this option.
30 /// </summary>
31 public ITemplate? Instructions { get; set; }
32
33 /// <summary>
34 /// the conversation history
35 /// </summary>
36 public IList<IMessage>? Messages { get; set; }
37
38 /// <summary>
39 /// the logger instance
40 /// </summary>
41 public ILogger? Logger { get; set; }
42
43 public ChatPromptOptions WithName(string value)
44 {
45 Name = value;
46 return this;
47 }
48
49 public ChatPromptOptions WithDescription(string value)
50 {
51 Description = value;
52 return this;
53 }
54
55 public ChatPromptOptions WithInstructions(string value)
56 {
57 Instructions = new StringTemplate(value);
58 return this;
59 }
60
61 public ChatPromptOptions WithInstructions(params string[] value)
62 {
63 Instructions = new StringTemplate(string.Join("\n", value));
64 return this;
65 }
66
67 public ChatPromptOptions WithInstructions(ITemplate value)
68 {
69 Instructions = value;
70 return this;
71 }
72
73 public ChatPromptOptions WithLogger(ILogger value)
74 {
75 Logger = value;
76 return this;
77 }
78}