Uh oh!
There was an error while loading. Please reload this page.
.NET: Support hosted code interpreter for skill script execution - #4192
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request introduces support for executing agent skill scripts via the LLM's hosted code interpreter. The implementation adds a new SkillScriptExecutor abstraction with a concrete HostedCodeInterpreterExecutor implementation that integrates with FileAgentSkillsProvider. The PR also enhances skill resource path detection to support backtick-quoted paths in addition to markdown links, and includes a comprehensive sample demonstrating password generation via script execution.
Changes:
- Introduced
SkillScriptExecutorabstract class with factory method pattern for extensibility - Added
HostedCodeInterpreterExecutorthat provides instructions and registersHostedCodeInterpreterTool - Enhanced
FileAgentSkillsProviderto optionally enable script execution viaFileAgentSkillsProviderOptions.Executor - Migrated prompt templating from format strings (
{0}) to named placeholders ({skills},{executor_instructions}) - Updated regex pattern to recognize backtick-quoted resource paths alongside markdown links
- Added comprehensive unit tests and
Agent_Step02_ScriptExecutionWithCodeInterpretersample project
Reviewed changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
dotnet/src/Microsoft.Agents.AI/Skills/SkillScriptExecutor.cs | Abstract base class defining the contract for script execution modes with factory method |
dotnet/src/Microsoft.Agents.AI/Skills/HostedCodeInterpreterExecutor.cs | Concrete implementation providing instructions and tools for hosted code interpreter execution |
dotnet/src/Microsoft.Agents.AI/Skills/FileAgentSkillsProviderOptions.cs | Added Executor property to enable optional script execution |
dotnet/src/Microsoft.Agents.AI/Skills/FileAgentSkillsProvider.cs | Integrated executor instructions and tools; migrated to named placeholder templating |
dotnet/src/Microsoft.Agents.AI/Skills/FileAgentSkillLoader.cs | Enhanced regex to detect backtick-quoted resource paths (e.g., `scripts/run.py`) |
dotnet/tests/Microsoft.Agents.AI.UnitTests/AgentSkills/SkillScriptExecutorTests.cs | Comprehensive tests for executor creation, instruction/tool provisioning, and provider integration |
dotnet/tests/Microsoft.Agents.AI.UnitTests/AgentSkills/FileAgentSkillsProviderTests.cs | Updated custom template test to use named placeholders; removed obsolete format validation test |
dotnet/tests/Microsoft.Agents.AI.UnitTests/AgentSkills/FileAgentSkillLoaderTests.cs | Tests for backtick resource path extraction in single and mixed scenarios |
dotnet/samples/.../Agent_Step02_ScriptExecutionWithCodeInterpreter/ | Complete sample demonstrating script execution with password-generator skill |
dotnet/agent-framework-dotnet.slnx | Added new sample project to solution |
dotnet/samples/GettingStarted/AgentSkills/README.md | Updated to reference new Step02 sample |
Uh oh!
There was an error while loading. Please reload this page.
Add the standard three-line WARNING comment about DefaultAzureCredential production considerations to both AgentSkills sample Program.cs files, matching the convention used in all other GettingStarted/Agents samples. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Summary
Add support for executing agent skill scripts via the LLM's hosted code interpreter, encapsulated as
SkillExecutor.HostedCodeInterpreter().Changes
FileAgentSkillScriptExecutorabstract class withHostedCodeInterpreterSkillScriptExecutorsubclassFileAgentSkillScriptExecutionContextandFileAgentSkillScriptExecutionDetailsSkillFrontmattertoFileAgentSkillFrontmatterfor naming consistencyFileAgentSkillsProviderOptions.ExecutorAgent_Step02_ScriptExecutionWithCodeInterpretersampleCloses#4131