Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions dotnet/src/Client.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,13 @@
using Microsoft.Extensions.AI;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Logging.Abstractions;
using Newtonsoft.Json.Linq;
using StreamJsonRpc;
using System.Collections.Concurrent;
using System.Data;
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;
using System.Net.Sockets;
using System.Text.Json;
using System.Text.Json.Nodes;
using System.Text.Json.Serialization;
using System.Text.RegularExpressions;

Expand Down Expand Up @@ -43,8 +41,8 @@ namespace GitHub.Copilot.SDK;
/// // Handle events
/// using var subscription = session.On(evt =>
/// {
/// if (evt.Type == "assistant.message")
/// Console.WriteLine(evt.Data?.Content);
/// if (evt is AssistantMessageEvent assistantMessage)
/// Console.WriteLine(assistantMessage.Data?.Content);
/// });
///
/// // Send a message
Expand Down Expand Up @@ -724,12 +722,10 @@ static IJsonRpcMessageFormatter CreateFormatter()
{
var options = new JsonSerializerOptions(JsonSerializerDefaults.Web)
{
AllowOutOfOrderMetadataProperties = true,
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull
};
foreach (var converter in SerializerOptions.Default.Converters)
{
options.Converters.Add(converter);
}

return new SystemTextJsonFormatter() { JsonSerializerOptions = options };
}

Expand Down
Loading
Loading