Skip to content

Commit f8d5c6f

Browse files
cleaned up usings
1 parent 422fb5d commit f8d5c6f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

docs/guides/mcp/chat_with_mcp.cs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
#:package ModelContextProtocol.Core@*-*
55
#:property PublishAot=false
66

7-
using System.Text.Json;
87
using ModelContextProtocol;
98
using ModelContextProtocol.Client;
109
using OpenAI.Chat;
@@ -68,9 +67,9 @@ public static ChatMessage ToMessage(this ChatToolCall openaiCall, IEnumerable<Mi
6867
List<ChatMessageContentPart> parts = new();
6968
foreach (Microsoft.Extensions.AI.AIContent content in contents)
7069
{
71-
string serialized = JsonSerializer.Serialize(content.RawRepresentation);
72-
using JsonDocument json = JsonDocument.Parse(serialized);
73-
JsonElement text = json.RootElement.GetProperty("text");
70+
string serialized = System.Text.Json.JsonSerializer.Serialize(content.RawRepresentation);
71+
using System.Text.Json.JsonDocument json = System.Text.Json.JsonDocument.Parse(serialized);
72+
System.Text.Json.JsonElement text = json.RootElement.GetProperty("text");
7473
string textValue = text.GetString() ?? string.Empty;
7574
parts.Add(ChatMessageContentPart.CreateTextPart(textValue));
7675
}

0 commit comments

Comments
 (0)