AgentInlineSkill Class

Definition

A skill defined entirely in code with resources (static values or delegates) and scripts (delegates).

public sealed class AgentInlineSkill : Microsoft.Agents.AI.AgentSkill
type AgentInlineSkill = class
    inherit AgentSkill
Public NotInheritable Class AgentInlineSkill
Inherits AgentSkill
Inheritance
AgentInlineSkill

Remarks

All calls to AddResource(String, Object, String), AddResource(String, Delegate, String, JsonSerializerOptions), and AddScript(String, Delegate, String, JsonSerializerOptions) must be made before the skill's GetContentAsync(CancellationToken) is first called. Calls made after that point will not be reflected in the generated content. In typical usage, this means configuring all resources and scripts before registering the skill with an AgentSkillsProvider or AgentSkillsProviderBuilder.

Constructors

Name Description
AgentInlineSkill(AgentSkillFrontmatter, String, JsonSerializerOptions, Func<Nullable<JsonElement>,AIFunctionArguments>)

Initializes a new instance of the AgentInlineSkill class with a pre-built AgentSkillFrontmatter.

AgentInlineSkill(String, String, String, String, String, String, AdditionalPropertiesDictionary, JsonSerializerOptions, Func<Nullable<JsonElement>, AIFunctionArguments>)

Initializes a new instance of the AgentInlineSkill class with all frontmatter properties specified individually.

Properties

Name Description
Frontmatter

Gets the frontmatter metadata for this skill.

Methods

Name Description
AddResource(String, Delegate, String, JsonSerializerOptions)

Registers a dynamic resource with this skill, backed by a C# delegate. The delegate's parameters and return type are automatically marshaled via AIFunctionFactory.

AddResource(String, Object, String)

Registers a static resource with this skill.

AddScript(String, Delegate, String, JsonSerializerOptions)

Registers a script with this skill, backed by a C# delegate. The delegate's parameters and return type are automatically marshaled via AIFunctionFactory.

GetContentAsync(CancellationToken)

Gets the full skill content.

GetResourceAsync(String, CancellationToken)

Gets a resource owned by this skill by name.

GetScriptAsync(String, CancellationToken)

Gets a script owned by this skill by name.

Applies to