Styling: remove a few redundant parens from object initializer expressions. (#548)
* Styling: remove a few redundant parens from object initializer expressions. * Fix build error.
This commit is contained in:
parent
802424ee08
commit
55bda787ae
2 changed files with 108 additions and 108 deletions
|
|
@ -421,14 +421,14 @@ internal sealed class AIFunctionMcpServerResource : McpServerResource
|
|||
Contents = aiContents.Select<AIContent, ResourceContents>(
|
||||
ac => ac switch
|
||||
{
|
||||
TextContent tc => new TextResourceContents()
|
||||
TextContent tc => new TextResourceContents
|
||||
{
|
||||
Uri = request.Params!.Uri,
|
||||
MimeType = ProtocolResourceTemplate.MimeType,
|
||||
Text = tc.Text
|
||||
},
|
||||
|
||||
DataContent dc => new BlobResourceContents()
|
||||
DataContent dc => new BlobResourceContents
|
||||
{
|
||||
Uri = request.Params!.Uri,
|
||||
MimeType = dc.MediaType,
|
||||
|
|
@ -441,7 +441,7 @@ internal sealed class AIFunctionMcpServerResource : McpServerResource
|
|||
|
||||
IEnumerable<string> strings => new()
|
||||
{
|
||||
Contents = strings.Select<string, ResourceContents>(text => new TextResourceContents()
|
||||
Contents = strings.Select<string, ResourceContents>(text => new TextResourceContents
|
||||
{
|
||||
Uri = request.Params!.Uri,
|
||||
MimeType = ProtocolResourceTemplate.MimeType,
|
||||
|
|
|
|||
|
|
@ -103,12 +103,12 @@ public static class McpServerExtensions
|
|||
{
|
||||
Role = role,
|
||||
Content = dataContent.HasTopLevelMediaType("image") ?
|
||||
new ImageContentBlock()
|
||||
new ImageContentBlock
|
||||
{
|
||||
MimeType = dataContent.MediaType,
|
||||
Data = dataContent.Base64Data.ToString(),
|
||||
} :
|
||||
new AudioContentBlock()
|
||||
new AudioContentBlock
|
||||
{
|
||||
MimeType = dataContent.MediaType,
|
||||
Data = dataContent.Base64Data.ToString(),
|
||||
|
|
@ -344,7 +344,7 @@ public static class McpServerExtensions
|
|||
|
||||
void Log(LogLevel logLevel, string message)
|
||||
{
|
||||
_ = server.SendNotificationAsync(NotificationMethods.LoggingMessageNotification, new LoggingMessageNotificationParams()
|
||||
_ = server.SendNotificationAsync(NotificationMethods.LoggingMessageNotification, new LoggingMessageNotificationParams
|
||||
{
|
||||
Level = McpServer.ToLoggingLevel(logLevel),
|
||||
Data = JsonSerializer.SerializeToElement(message, McpJsonUtilities.JsonContext.Default.String),
|
||||
|
|
|
|||
Loading…
Reference in a new issue