An opinionated C# Toolkit for Microsoft Agent Framework that makes life easier
OpenAI | Azure OpenAI | Google (Gemini) | Anthropic (Claude) | XAI (Grok) | Mistral | OpenRouter | GitHub
All agents have AIAgent as base, fully work the rest of Microsoft Agent Framework)
OpenAIAgentFactory factory = new OpenAIAgentFactory(new OpenAIConnection
{
ApiKey = configuration.OpenAiApiKey,
NetworkTimeout = TimeSpan.FromMinutes(5)
});
OpenAIAgent agent = factory.CreateAgent(new OpenAIAgentOptionsForResponseApiWithReasoning
{
Model = "gpt-5",
ReasoningEffort = ResponseReasoningEffortLevel.High,
ReasoningSummaryVerbosity = ResponseReasoningSummaryVerbosity.Detailed,
});GoogleAgentFactory factory = new(new GoogleConnection
{
ApiKey = configuration.GoogleGeminiApiKey
});
GoogleAgent agent = factory.CreateAgent(new GoogleAgentOptions
{
Model = GenerativeAI.GoogleAIModels.Gemini25Pro,
Tools = [AIFunctionFactory.Create(GetWeather)]
});AnthropicAgentFactory factory = new AnthropicAgentFactory("<AnthropicApiKey">);
factory.CreateAgent(new AnthropicAgentOptions
{
Model = "claude-sonnet-4-5",
MaxOutputTokens = 10000, // <-- Force the MaxToken property I always forget
BudgetTokens = 5000
});XAIAgentFactory factory = new(new XAIConnection
{
ApiKey = configuration.XAiGrokApiKey
});
XAIAgent agent = factory.CreateAgent(new OpenAIAgentOptionsForChatClientWithoutReasoning
{
Model = "grok-4-fast-non-reasoning",
Tools = [AIFunctionFactory.Create(GetWeather)]
});MistralAgentFactory mistralAgentFactory = new MistralAgentFactory("<MistralApiKey>");
MistralAgent mistralAgent = mistralAgentFactory.CreateAgent(new MistralAgentOptions
{
Model = Mistral.SDK.ModelDefinitions.MistralSmall
});AzureOpenAIAgent fullBlownAgent = azureOpenAIAgentFactory.CreateAgent(new OpenAIAgentOptionsForResponseApiWithReasoning
{
Id = "1234",
Name = "MyAgent",
Description = "The description of my agent",
Instructions = "Speak like a pirate",
Model = "gpt-5-mini",
ReasoningEffort = ResponseReasoningEffortLevel.Low,
ReasoningSummaryVerbosity = ResponseReasoningSummaryVerbosity.Detailed,
Tools = [AIFunctionFactory.Create(GetWeather)],
RawToolCallDetails = details => { Console.WriteLine(details.ToString()); },
RawHttpCallDetails = details =>
{
Console.WriteLine($"URL: {details.RequestUrl}");
Console.WriteLine($"Request: {details.RequestJson}");
Console.WriteLine($"Response: {details.ResponseJson}");
}
});