.NET: feat(AgentSkills): add IncludeSkillInstructions option to AgentSkills…#5063
Open
thesamuel23 wants to merge 2 commits intomicrosoft:mainfrom
Open
.NET: feat(AgentSkills): add IncludeSkillInstructions option to AgentSkills…#5063thesamuel23 wants to merge 2 commits intomicrosoft:mainfrom
thesamuel23 wants to merge 2 commits intomicrosoft:mainfrom
Conversation
…Provider - Add `IncludeSkillInstructions` property to `AgentSkillsProviderOptions` (default true). - Update `AgentSkillsProvider` to omit skill instructions from the system prompt when `IncludeSkillInstructions` is false. - Add `IncludeSkillInstructions` fluent method to `AgentSkillsProviderBuilder`. - Skip prompt template validation in `AgentSkillsProvider` constructor when instructions are disabled. - Add unit tests for the new option in both provider and builder.
Author
|
@microsoft-github-policy-service agree company="AgentMatters.ai" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
…Provider
IncludeSkillInstructionsproperty toAgentSkillsProviderOptions(default true).AgentSkillsProviderto omit skill instructions from the system prompt whenIncludeSkillInstructionsis false.IncludeSkillInstructionsfluent method toAgentSkillsProviderBuilder.AgentSkillsProviderconstructor when instructions are disabled.Motivation and Context
There are scenarios where an agent might already have prior knowledge of the skills, or where they are being advertised through other means. In these cases, including the default skill-related system prompt is redundant or undesirable.
Why is this change required? To allow users to suppress the automatic injection of skill-related instructions into the system prompt.
What problem does it solve? It provides a way to omit the "Advertise" step of the Agent Skills specification while still keeping the underlying skill tools (load_skill, read_skill_resource, etc.) available in the AIContext.
What scenario does it contribute to? Advanced agent configurations where the system prompt needs to be carefully managed or where skill discovery is handled outside of the standard system prompt.
Description
This PR introduces the IncludeSkillInstructions option to the AgentSkillsProvider to control the advertisement of skills in the system prompt.
AgentSkillsProviderOptions: Added IncludeSkillInstructions (bool, default true).
AgentSkillsProvider:
Updated BuildSkillsInstructions to respect the flag and skip instruction generation when false.
Updated the constructor to skip the SkillsInstructionPrompt template validation if instructions are disabled, as they will not be used.
AgentSkillsProviderBuilder: Added a fluent IncludeSkillInstructions(bool enabled = true) method.
Unit Tests: Added and updated tests in AgentSkillsProviderTests.cs and AgentSkillsProviderBuilderTests.cs to verify that instructions are correctly suppressed while tools remain available, and that redundant validation is skipped.