DeclarativeAgentExtensions.CreateChatCompletionAgentFromDeclarativeAgentManifestAsync<T> Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Creates a chat completion agent from a declarative agent manifest asynchronously.
public static System.Threading.Tasks.Task<T> CreateChatCompletionAgentFromDeclarativeAgentManifestAsync<T>(this Microsoft.SemanticKernel.Kernel kernel, string filePath, Microsoft.SemanticKernel.Plugins.OpenApi.Extensions.CopilotAgentPluginParameters? pluginParameters = default, Microsoft.SemanticKernel.PromptExecutionSettings? promptExecutionSettings = default, System.Threading.CancellationToken cancellationToken = default) where T : Microsoft.SemanticKernel.Agents.Agent, new();
static member CreateChatCompletionAgentFromDeclarativeAgentManifestAsync : Microsoft.SemanticKernel.Kernel * string * Microsoft.SemanticKernel.Plugins.OpenApi.Extensions.CopilotAgentPluginParameters * Microsoft.SemanticKernel.PromptExecutionSettings * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'T (requires 'T :> Microsoft.SemanticKernel.Agents.Agent and 'T : (new : unit -> 'T))> (requires 'T :> Microsoft.SemanticKernel.Agents.Agent and 'T : (new : unit -> 'T))
<Extension()>
Public Function CreateChatCompletionAgentFromDeclarativeAgentManifestAsync(Of T As {AgentNew}) (kernel As Kernel, filePath As String, Optional pluginParameters As CopilotAgentPluginParameters = Nothing, Optional promptExecutionSettings As PromptExecutionSettings = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of T)
Type Parameters
- T
The type of the agent to create.
Parameters
- kernel
- Kernel
The kernel instance.
- filePath
- String
The file path of the declarative agent manifest.
- pluginParameters
- CopilotAgentPluginParameters
Optional parameters for the Copilot Agent Plugin setup.
- promptExecutionSettings
- PromptExecutionSettings
Optional prompt execution settings. Ensure you enable function calling.
- cancellationToken
- CancellationToken
Optional cancellation token.
Returns
A task that represents the asynchronous operation. The task result contains the created chat completion agent.