AgentSkillScript.RunAsync Method

Definition

Runs the script with the given arguments.

public abstract System.Threading.Tasks.Task<object?> RunAsync(Microsoft.Agents.AI.AgentSkill skill, System.Text.Json.JsonElement? arguments, IServiceProvider? serviceProvider, System.Threading.CancellationToken cancellationToken = default);
abstract member RunAsync : Microsoft.Agents.AI.AgentSkill * Nullable<System.Text.Json.JsonElement> * IServiceProvider * System.Threading.CancellationToken -> System.Threading.Tasks.Task<obj>
Public MustOverride Function RunAsync (skill As AgentSkill, arguments As Nullable(Of JsonElement), serviceProvider As IServiceProvider, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Object)

Parameters

skill
AgentSkill

The skill that owns this script.

arguments
Nullable<JsonElement>

Raw JSON arguments for script execution, preserving the original format (object or array) sent by the caller.

serviceProvider
IServiceProvider

Optional service provider for dependency injection.

cancellationToken
CancellationToken

Cancellation token.

Returns

The script execution result.

Applies to