// Copyright (c) Microsoft. All rights reserved. using System.Diagnostics.CodeAnalysis; using Microsoft.Agents.AI; 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, and in-loop compaction. /// /// /// The that provides access to the underlying AI model. /// /// /// The maximum number of tokens the model's context window supports (e.g., 1,050,000 for gpt-5.4). /// Used to configure the compaction strategy. /// /// /// The maximum number of output tokens the model can generate per response (e.g., 128,000 for gpt-5.4). /// Used to configure the compaction strategy. /// /// /// Optional configuration options for the agent, including instructions override, tools, /// additional context providers, and chat history provider. /// When , the agent uses built-in default settings. /// /// A new instance. public static HarnessAgent AsHarnessAgent( this IChatClient chatClient, int maxContextWindowTokens, int maxOutputTokens, HarnessAgentOptions? options = null) => new(chatClient, maxContextWindowTokens, maxOutputTokens, options); }