Share via


YamlAgentFactoryExtensions.CreateFromYamlAsync Method

Definition

Create a AIAgent from the given agent YAML.

public static System.Threading.Tasks.Task<Microsoft.Agents.AI.AIAgent> CreateFromYamlAsync(this Microsoft.Agents.AI.PromptAgentFactory agentFactory, string agentYaml, System.Threading.CancellationToken cancellationToken = default);
static member CreateFromYamlAsync : Microsoft.Agents.AI.PromptAgentFactory * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Agents.AI.AIAgent>
<Extension()>
Public Function CreateFromYamlAsync (agentFactory As PromptAgentFactory, agentYaml As String, Optional cancellationToken As CancellationToken = Nothing) As Task(Of AIAgent)

Parameters

agentFactory
PromptAgentFactory

PromptAgentFactory which will be used to create the agent.

agentYaml
String

Text string containing the YAML representation of an AIAgent.

cancellationToken
CancellationToken

Optional cancellation token

Returns

Applies to