mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
e859edc2a4
* Initial implementation * tmp * Replace function calling with a FunctionInvokingChatClient * Cleanups * Remove custom thread * Fixing function calling server and client * Cleanup * Cleanup serialization * Run dotnet format * Pass logger factory * Populate message properties * Remove files * Cleanups * cleanup * Cleanups * More cleanup * Simplify things * Cleanup * Clean up json serialization * Additional tests * Add service collection extensions for serialization * Combine options in AGUIChatClient * Additional tests * Include tool calling in the sample, fix mixed server and client tool calls * Fix tests * More cleanups * Fix tests * Cleanups * Dojo project and fixes * Fix build * Remove dojo * Cleanup * Address feedback * address feedback * Additional feedback * Fix build * Fix build * Make packages packable
25 lines
732 B
C#
25 lines
732 B
C#
// Copyright (c) Microsoft. All rights reserved.
|
|
|
|
using System.Text.Json;
|
|
|
|
namespace Microsoft.Agents.AI.Hosting.AGUI.AspNetCore;
|
|
|
|
/// <summary>
|
|
/// Extension methods for JSON serialization.
|
|
/// </summary>
|
|
internal static class AGUIJsonSerializerOptions
|
|
{
|
|
/// <summary>
|
|
/// Gets the default JSON serializer options.
|
|
/// </summary>
|
|
public static JsonSerializerOptions Default { get; } = Create();
|
|
|
|
private static JsonSerializerOptions Create()
|
|
{
|
|
JsonSerializerOptions options = new(AGUIJsonSerializerContext.Default.Options);
|
|
options.TypeInfoResolverChain.Add(AgentAbstractionsJsonUtilities.DefaultOptions.TypeInfoResolver!);
|
|
options.MakeReadOnly();
|
|
return options;
|
|
}
|
|
}
|