// Copyright (c) Microsoft. All rights reserved.
using System.Collections.Generic;
using Microsoft.Extensions.AI;
using Microsoft.Shared.Diagnostics;
namespace Microsoft.Agents.AI;
/// Provides context for an in-flight agent run.
public sealed class AgentRunContext
{
///
/// Initializes a new instance of the class.
///
/// The that is executing the current run.
/// The that is associated with the current run if any.
/// The request messages passed into the current run.
/// The that was passed to the current run.
public AgentRunContext(
AIAgent agent,
AgentSession? session,
IReadOnlyCollection requestMessages,
AgentRunOptions? agentRunOptions)
{
this.Agent = Throw.IfNull(agent);
this.Session = session;
this.RequestMessages = Throw.IfNull(requestMessages);
this.RunOptions = agentRunOptions;
}
/// Gets the that is executing the current run.
public AIAgent Agent { get; }
/// Gets the that is associated with the current run.
public AgentSession? Session { get; }
/// Gets the request messages passed into the current run.
public IReadOnlyCollection RequestMessages { get; }
/// Gets the that was passed to the current run.
public AgentRunOptions? RunOptions { get; }
}