mirror of
https://github.com/microsoft/agent-framework.git
synced 2026-06-16 21:04:09 +08:00
* refactor: Rename AggregateTurnMessagesExecutor * feat: Rework Agent Hosting for Configurability and HIL support * Adds support for selecting whether updates and/or full responses are emitted to events * Adds support for HIL/FunctionCalls (including interception) * Implements internal support for ExternalRequests from any executor (not just RequestPort) * test: Add tests for new AIAgentHostExecutor functionality * feat: Unify non-Handoff Agent Hosting * doc: More explicit documentation for `overwrite` in RouteBuilder
20 lines
658 B
C#
20 lines
658 B
C#
// Copyright (c) Microsoft. All rights reserved.
|
|
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
using Microsoft.Agents.AI.Workflows.Execution;
|
|
|
|
namespace Microsoft.Agents.AI.Workflows;
|
|
|
|
internal class PortBinding(RequestPort port, IExternalRequestSink sink)
|
|
{
|
|
public RequestPort Port => port;
|
|
public IExternalRequestSink Sink => sink;
|
|
|
|
public ValueTask PostRequestAsync<TRequest>(TRequest request, string? requestId = null, CancellationToken cancellationToken = default)
|
|
{
|
|
ExternalRequest externalRequest = ExternalRequest.Create(this.Port, request, requestId);
|
|
return this.Sink.PostAsync(externalRequest);
|
|
}
|
|
}
|