بنقرة واحدة
create-agent-provider
Instructions for creating a new Agent Provider NuGet package for AgentFrameworkToolkit
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
القائمة
Instructions for creating a new Agent Provider NuGet package for AgentFrameworkToolkit
التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.
استنادا إلى تصنيف SOC المهني
| name | create-agent-provider |
| description | Instructions for creating a new Agent Provider NuGet package for AgentFrameworkToolkit |
This skill guides you through creating a new Agent Provider NuGet package for the AgentFrameworkToolkit. Agent Providers enable integration with different LLM services (e.g., Anthropic, OpenAI, Google, Mistral).
Choose implementation approach:
OpenAI-Compatible Provider - If the LLM service has an OpenAI-compatible API:
Custom Provider - If the LLM service has a unique API:
Most provider packages include these components (OpenAI-compatible providers reuse AgentFrameworkToolkit.OpenAI.AgentOptions):
<Provider>Connection)<Provider>AgentFactory)ChatClientAgent (custom providers)AgentFrameworkToolkit.MiddlewareHelper<Provider>AgentOptions) (custom providers only)<Provider>Agent)AIAgentInnerAgent property<Provider>ChatModels) (only if provider is specific. if it offers multiple LLMs don't include such)mkdir src/AgentFrameworkToolkit.<Provider>
Important repo conventions (don’t fight the build system):
src/* projects inherit defaults from Directory.Build.props (currently net8.0).nuget-package.props in each src/* .csproj.Directory.Packages.props (no versions in .csproj).Follow existing providers:
src/AgentFrameworkToolkit.OpenRouter/, src/AgentFrameworkToolkit.XAI/, src/AgentFrameworkToolkit.Cohere/src/AgentFrameworkToolkit.Anthropic/, src/AgentFrameworkToolkit.GitHub/, src/AgentFrameworkToolkit.Google/, src/AgentFrameworkToolkit.Mistral/Create ServiceCollectionExtensions.cs for dependency injection using the repo naming convention:
Add<Provider>AgentFactory(this IServiceCollection services, string apiKey)Add<Provider>AgentFactory(this IServiceCollection services, <Provider>Connection connection)Provider tests live in development/Tests/ and make real API calls.
See Testing Guide for the repo’s concrete pattern.
Quick checklist:
development/Tests/Tests.csprojdevelopment/Sandbox/Sandbox.csprojAgentProvider enum in development/Tests/TestBase.cscase to GetAgentForScenarioAsync(...) in development/Tests/TestBase.csdevelopment/Tests/<Provider>Tests.cs:
SimpleAgentTestsAsync, NormalAgentTestsAsync, etc.)Add<Provider>AgentFactory(...)development/Sandbox/Providers/<Provider>.cs and optionally wire it in development/Sandbox/Program.csdevelopment/Secrets/Secrets.cs and development/Secrets/SecretsManager.csdotnet user-secrets for the development/Secrets/Secrets.csproj projectAgentFrameworkToolkit.slnx under /Packages/Directory.Packages.propsREADME.md provider tablesrc/AgentFrameworkToolkit.<Provider>/README.mdCHANGELOG.mddotnet build --configuration Release
Use the shared helper instead of re-implementing ordering rules:
AgentFrameworkToolkit.MiddlewareHelper.ApplyMiddleware(...)public class <Provider>AgentFactory
{
public <Provider>Connection Connection { get; }
public <Provider>AgentFactory(string apiKey);
public <Provider>AgentFactory(<Provider>Connection connection);
public <Provider>Agent CreateAgent(<Provider>AgentOptions options)
{
// 1. Get SDK client from connection
// 2. Build IChatClient (or use SDK-provided one)
// 3. Create ChatClientAgent
// 4. Apply middleware via MiddlewareHelper
// 5. Wrap in provider-specific agent
}
}
.csproj instead of Directory.Packages.propsAgentFrameworkToolkit.slnx and README.mddevelopment/Tests/TestBase.cs test harnessdevelopment/Secrets/SecretsManager.cs)