AgentSkill.GetResourceAsync(String, CancellationToken) Method

Definition

Gets a resource owned by this skill by name.

public virtual System.Threading.Tasks.ValueTask<Microsoft.Agents.AI.AgentSkillResource?> GetResourceAsync(string name, System.Threading.CancellationToken cancellationToken = default);
abstract member GetResourceAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<Microsoft.Agents.AI.AgentSkillResource>
override this.GetResourceAsync : string * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<Microsoft.Agents.AI.AgentSkillResource>
Public Overridable Function GetResourceAsync (name As String, Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of AgentSkillResource)

Parameters

name
String

The resource name (e.g. an identifier or a relative path referenced inside the skill content).

cancellationToken
CancellationToken

Cancellation token.

Returns

The AgentSkillResource, or null when no resource with the given name exists.

Remarks

The default implementation returns null. Override in derived classes that expose resources.

Applies to