// Copyright (c) Microsoft. All rights reserved.
using System;
using Microsoft.SemanticKernel.ChatCompletion;
using ModelContextProtocol.Protocol;
namespace MCPClient;
///
/// Extension methods for the enum.
///
internal static class RoleExtensions
{
///
/// Converts a to a .
///
/// The MCP role to convert.
/// The corresponding .
public static AuthorRole ToAuthorRole(this Role role)
{
return role switch
{
Role.User => AuthorRole.User,
Role.Assistant => AuthorRole.Assistant,
_ => throw new InvalidOperationException($"Unexpected role '{role}'")
};
}
}