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