microsoft/teams.net

Public

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

CodeCommitsIssuesPull requestsActionsInsightsSecurity
733a37f2b7310e6fd954187427f2af0e713dc286

Branches

Tags

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

Clone

HTTPS

Download ZIP

Libraries/Microsoft.Teams.AI/Message.cs

41lines · modepreview

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

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>))]
[Obsolete("Microsoft.Teams.AI is deprecated and will be removed by end of summer 2026.")]
public interface IMessage
{
    /// <summary>
    /// the role of the message, ie
    /// who sent the message
    /// </summary>
    public Role Role { get; }
}

[JsonConverter(typeof(JsonConverter<Role>))]
[Obsolete("Microsoft.Teams.AI is deprecated and will be removed by end of summer 2026.")]
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);
}