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