microsoft/teams.net

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
a520ba785be4e788a9153949bfbc866a3ee0ae81

Branches

Tags

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

Clone

HTTPS

Download ZIP

Libraries/Microsoft.Teams.AI/Message.cs

36lines · modecode

1using System.Text.Json.Serialization;
2
3using Microsoft.Teams.Common;
4using Microsoft.Teams.Common.Json;
5
6namespace 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>))]
13public 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>))]
23public 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}