microsoft/teams.net

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
affd7569cfa8bd4a83b86066b8636721ea186364

Branches

Tags

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

Clone

HTTPS

Download ZIP

Libraries/Microsoft.Teams.AI/Message.cs

39lines · modecode

1// Copyright (c) Microsoft Corporation. All rights reserved.
2// Licensed under the MIT License.
3
4using System.Text.Json.Serialization;
5
6using Microsoft.Teams.Common;
7using Microsoft.Teams.Common.Json;
8
9namespace 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>))]
16public 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>))]
26public 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}