Jaa


IAgentHost.SendToAgent Method

Definition

Sends an activity to an Agent.

public System.Threading.Tasks.Task SendToAgent(Microsoft.Agents.Builder.ITurnContext turnContext, string agentName, string agentConversationId, Microsoft.Agents.Core.Models.IActivity activity, System.Threading.CancellationToken cancellationToken = default);
abstract member SendToAgent : Microsoft.Agents.Builder.ITurnContext * string * string * Microsoft.Agents.Core.Models.IActivity * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Function SendToAgent (turnContext As ITurnContext, agentName As String, agentConversationId As String, activity As IActivity, Optional cancellationToken As CancellationToken = Nothing) As Task

Parameters

turnContext
ITurnContext

Context for a turn of the Agent.

agentName
String

An Agent name from configuration.

activity
IActivity

The activity to send.

cancellationToken
CancellationToken

Cancellation token.

Returns

Exceptions

If the specified agentName is null or not found.

Remarks

This is used for Activity.DeliverMode == 'normal'. In order to get the asynchronous replies from the Agent, the OnAgentReply(AgentResponseHandler, UInt16) handler must be set on the AgentApplication.

Applies to