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 · modepreview

using System.Text.Json.Serialization;

using Microsoft.Teams.Common;
using Microsoft.Teams.Common.Json;

namespace Microsoft.Teams.AI;

/// <summary>
/// some message sent to or from the LLM
/// via a Model
/// </summary>
[JsonConverter(typeof(TrueTypeJsonConverter<IMessage>))]
public interface IMessage
{
    /// <summary>
    /// the role of the message, ie
    /// who sent the message
    /// </summary>
    public Role Role { get; }
}

[JsonConverter(typeof(JsonConverter<Role>))]
public class Role(string value) : StringEnum(value)
{
    public static readonly Role User = new("user");
    public bool IsUser => User.Equals(Value);

    public static readonly Role Model = new("model");
    public bool IsModel => Model.Equals(Value);

    public static readonly Role Developer = new("developer");
    public bool IsDeveloper => Developer.Equals(Value);

    public static readonly Role Function = new("function");
    public bool IsFunction => Function.Equals(Value);
}