IExternalRequestEnvelope Interface

Definition

Optional interface implemented by request payload types that wrap underlying AI content (such as FunctionCallContent or ToolApprovalRequestContent) and define a paired response envelope.

public interface IExternalRequestEnvelope
type IExternalRequestEnvelope = interface
Public Interface IExternalRequestEnvelope
Derived

Remarks

This abstraction allows higher-level layers (e.g., declarative workflows) to define their own request/response envelope types while still allowing WorkflowSession to surface the inner content to hosts on the request side and to wrap incoming responses back into the envelope on the response side - without the runtime taking a reference back to the higher-level layer.

When an ExternalRequest.Data payload implements this interface, the runtime uses GetInnerRequestContent() to drive wire serialization for hosts (so a host receives a normal FunctionCallContent or ToolApprovalRequestContent), and uses CreateResponse(IList<ChatMessage>) to wrap the host's response payload back into the envelope expected by the workflow's request port.

Methods

Name Description
CreateResponse(IList<ChatMessage>)

Wraps the supplied response messages into the envelope's matching response type for delivery to the workflow's request port.

GetInnerRequestContent()

Returns the inner AI content that should be delivered to the host on the wire. Typically a FunctionCallContent or ToolApprovalRequestContent.

Applies to