microsoft/teams.net
Publicmirrored fromhttps://github.com/microsoft/teams.netAvailable
Libraries/Microsoft.Teams.AI/Message.cs
36lines · modecode
| 1 | using System.Text.Json.Serialization; |
| 2 | |
| 3 | using Microsoft.Teams.Common; |
| 4 | using Microsoft.Teams.Common.Json; |
| 5 | |
| 6 | namespace Microsoft.Teams.AI; |
| 7 | |
| 8 | /// <summary> |
| 9 | /// some message sent to or from the LLM |
| 10 | /// via a Model |
| 11 | /// </summary> |
| 12 | [JsonConverter(typeof(TrueTypeJsonConverter<IMessage>))] |
| 13 | public interface IMessage |
| 14 | { |
| 15 | /// <summary> |
| 16 | /// the role of the message, ie |
| 17 | /// who sent the message |
| 18 | /// </summary> |
| 19 | public Role Role { get; } |
| 20 | } |
| 21 | |
| 22 | [JsonConverter(typeof(JsonConverter<Role>))] |
| 23 | public class Role(string value) : StringEnum(value) |
| 24 | { |
| 25 | public static readonly Role User = new("user"); |
| 26 | public bool IsUser => User.Equals(Value); |
| 27 | |
| 28 | public static readonly Role Model = new("model"); |
| 29 | public bool IsModel => Model.Equals(Value); |
| 30 | |
| 31 | public static readonly Role Developer = new("developer"); |
| 32 | public bool IsDeveloper => Developer.Equals(Value); |
| 33 | |
| 34 | public static readonly Role Function = new("function"); |
| 35 | public bool IsFunction => Function.Equals(Value); |
| 36 | } |