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