Share via


DurableTaskClientExtensions.AsDurableAgentProxy Method

Definition

Converts a DurableTaskClient to a durable agent proxy.

public static Microsoft.Agents.AI.AIAgent AsDurableAgentProxy(this Microsoft.DurableTask.Client.DurableTaskClient durableClient, Microsoft.Azure.Functions.Worker.FunctionContext context, string agentName);
static member AsDurableAgentProxy : Microsoft.DurableTask.Client.DurableTaskClient * Microsoft.Azure.Functions.Worker.FunctionContext * string -> Microsoft.Agents.AI.AIAgent
<Extension()>
Public Function AsDurableAgentProxy (durableClient As DurableTaskClient, context As FunctionContext, agentName As String) As AIAgent

Parameters

durableClient
DurableTaskClient

The DurableTaskClient to convert.

context
FunctionContext

The FunctionContext for the current function invocation.

agentName
String

The name of the agent.

Returns

A durable agent proxy.

Exceptions

Thrown when durableClient or context is null.

Thrown when agentName is null or empty.

Thrown when durable agents have not been configured on the service collection.

Thrown when the agent has not been registered.

Applies to