// Copyright (c) Microsoft. All rights reserved. using System; using System.Diagnostics.CodeAnalysis; using Microsoft.Agents.AI; using Microsoft.Extensions.Logging; using Microsoft.Shared.DiagnosticIds; namespace Microsoft.Extensions.AI; /// /// Provides extension methods for creating a from an . /// [Experimental(DiagnosticIds.Experiments.AgentsAIExperiments)] public static class ChatClientHarnessExtensions { /// /// Creates a new that wraps this with a pre-configured /// pipeline including function invocation, per-service-call chat history persistence, optional in-loop compaction, and a rich set /// of default context providers and agent decorators. /// /// /// The that provides access to the underlying AI model. /// /// /// Optional configuration options for the agent, including instructions override, tools, /// additional context providers, chat history provider, and compaction settings. /// When , the agent uses built-in default settings with compaction disabled. /// /// /// Optional logger factory for creating loggers used by the agent and its components. /// /// /// Optional service provider for resolving dependencies required by AI functions and other agent components. /// /// A new instance. public static HarnessAgent AsHarnessAgent( this IChatClient chatClient, HarnessAgentOptions? options = null, ILoggerFactory? loggerFactory = null, IServiceProvider? services = null) => new(chatClient, options, loggerFactory, services); }