// Copyright (c) Microsoft. All rights reserved. using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; using Microsoft.Agents.AI; using Microsoft.Extensions.AI; namespace AgentConversation.IntegrationTests; /// /// Defines a single agent conversation test case. /// /// /// Each test case describes the initial conversation context (as a list of instances), /// the agents that participate in the conversation, the steps to execute, and the expected outcomes. /// The initial context can either be loaded from a previously serialized file or generated on-demand /// via . /// public interface IConversationTestCase { /// /// Gets the human-readable name that uniquely identifies this test case. /// string Name { get; } /// /// Gets the agents involved in this test case, keyed by their names. /// Each entry is a that describes how to create the agent. /// IReadOnlyDictionary AgentDefinitions { get; } /// /// Returns the initial list of instances to restore into the conversation /// context before any steps are executed. /// /// /// The initial chat messages. These are typically loaded from a previously serialized JSON file /// produced by . /// IList GetInitialMessages(); /// /// Gets the ordered list of steps to execute against the restored conversation context. /// IReadOnlyList Steps { get; } /// /// Creates the initial conversation context by actually driving a conversation with the provided agents, /// then returns the resulting list of messages. /// /// /// This method is intended to be called once (e.g., during a setup phase) to produce the serialized /// context that subsequent test runs will deserialize. Implementations should build up a long or /// complex conversation that is representative of the long-running operation scenario being validated. /// /// /// The agents to use when building the initial context, keyed by their names as defined in /// . /// /// A token to cancel the operation. /// /// The ordered list of instances that form the initial context. /// Task> CreateInitialContextAsync( IReadOnlyDictionary agents, CancellationToken cancellationToken = default); }