mirror of
https://github.com/davidkaya/aryx.git
synced 2026-07-24 05:28:46 +02:00
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
26 lines
841 B
C#
26 lines
841 B
C#
using Aryx.AgentHost.Contracts;
|
|
using Aryx.AgentHost.Services;
|
|
using GitHub.Copilot.SDK;
|
|
|
|
namespace Aryx.AgentHost.Tests;
|
|
|
|
internal static class SessionEventTestExtensions
|
|
{
|
|
private static readonly IProviderEventAdapter ProviderEventAdapter = new CopilotEventAdapter();
|
|
|
|
public static void ObserveSessionEvent(
|
|
this CopilotTurnExecutionState state,
|
|
WorkflowNodeDto agentDefinition,
|
|
SessionEvent sessionEvent)
|
|
{
|
|
ArgumentNullException.ThrowIfNull(state);
|
|
ArgumentNullException.ThrowIfNull(agentDefinition);
|
|
ArgumentNullException.ThrowIfNull(sessionEvent);
|
|
|
|
ProviderSessionEvent providerEvent = Assert.IsAssignableFrom<ProviderSessionEvent>(
|
|
ProviderEventAdapter.TryAdapt(sessionEvent));
|
|
|
|
state.ObserveSessionEvent(agentDefinition, providerEvent);
|
|
}
|
|
}
|