// Copyright (c) Microsoft. All rights reserved.
using System;
using Microsoft.Agents.AI;
using Microsoft.Agents.AI.Hosting.AGUI.AspNetCore;
using Microsoft.AspNetCore.Http.Json;
namespace Microsoft.Extensions.DependencyInjection;
///
/// Extension methods for to configure AG-UI support.
///
public static class MicrosoftAgentAIHostingAGUIServiceCollectionExtensions
{
///
/// Adds support for exposing instances via AG-UI.
///
/// The to configure.
/// The for method chaining.
public static IServiceCollection AddAGUI(this IServiceCollection services)
{
ArgumentNullException.ThrowIfNull(services);
services.Configure(options => options.SerializerOptions.TypeInfoResolverChain.Add(AGUIJsonSerializerOptions.Default.TypeInfoResolver!));
return services;
}
}