// 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;
///
/// Abstracts the system-specific concerns of an agent conversation test run: how agents are created
/// and how context compaction is performed.
///
///
/// Implement this interface to adapt the to a particular AI backend
/// (e.g., OpenAI Chat Completion, Azure AI, OpenAI Responses API). Each implementation controls:
///
/// -
/// How instances are turned into live objects.
///
/// -
/// How context compaction is applied to a list of messages. Compaction is optional; returning
/// means no compaction is performed.
///
///
///
public interface IConversationTestSystem
{
///
/// Creates a live from the supplied .
///
/// The definition describing the agent to create.
/// A token to cancel the operation.
/// A fully-initialised ready to participate in the conversation.
Task CreateAgentAsync(
ConversationAgentDefinition definition,
CancellationToken cancellationToken = default);
///
/// Optionally compacts (reduces) the supplied .
///
/// The current list of messages to compact.
/// A token to cancel the operation.
///
/// The compacted list of messages, or if no compaction was performed.
/// When is returned the original list is used unchanged.
///
Task?> CompactAsync(
IList messages,
CancellationToken cancellationToken = default);
}