AgentSkillsProviderBuilder Class

Definition

Fluent builder for constructing an AgentSkillsProvider backed by a composite source. Intended for advanced scenarios where the simple AgentSkillsProvider constructors are insufficient.

public sealed class AgentSkillsProviderBuilder
type AgentSkillsProviderBuilder = class
Public NotInheritable Class AgentSkillsProviderBuilder
Inheritance
AgentSkillsProviderBuilder

Remarks

For simple, single-source scenarios, prefer the AgentSkillsProvider constructors directly (e.g., passing a skill directory path or a set of skills). Use this builder when you need one or more of the following advanced capabilities:

Example — combining file-based and code-defined skills:

var provider = new AgentSkillsProviderBuilder()
    .UseFileSkills("/path/to/skills")
    .UseSkills(myInlineSkill1, myInlineSkill2)
    .UseFileScriptRunner(SubprocessScriptRunner.RunAsync)
    .Build();

Constructors

Name Description
AgentSkillsProviderBuilder()

Methods

Name Description
Build()

Builds the AgentSkillsProvider.

DisableCaching()

Disables caching of the resolved skill list. By default, skills are fetched once and cached; calling this method causes the source pipeline to be invoked on every request.

UseCachingOptions(Action<CachingAgentSkillsSourceOptions>)

Configures skill caching behavior.

UseFileScriptRunner(AgentFileSkillScriptRunner)

Sets the runner for file-based skill scripts.

UseFileSkill(String, AgentFileSkillsSourceOptions, AgentFileSkillScriptRunner)

Adds a file-based skill source that discovers skills from a filesystem directory.

UseFileSkills(IEnumerable<String>, AgentFileSkillsSourceOptions, AgentFileSkillScriptRunner)

Adds a file-based skill source that discovers skills from multiple filesystem directories.

UseFilter(Func<AgentSkill,AgentSkillsSourceContext,Boolean>)

Sets a filter predicate that controls which skills are included.

UseLoggerFactory(ILoggerFactory)

Sets the logger factory.

UseOptions(Action<AgentSkillsProviderOptions>)

Configures the AgentSkillsProviderOptions using the provided delegate.

UsePromptTemplate(String)

Sets a custom system prompt template.

UseSkill(AgentSkill)

Adds a single skill.

UseSkills(AgentSkill[])

Adds one or more skills.

UseSkills(IEnumerable<AgentSkill>)

Adds skills from the specified collection.

UseSource(AgentSkillsSource)

Adds a custom skill source.

UseSource(Func<ILoggerFactory,AgentSkillsSource>)

Adds a custom skill source created by a factory that receives the builder's logger factory at build time. Use this overload when the source needs logging and should not require the caller to pass an ILoggerFactory explicitly.

Applies to