AIAgentSharp 1.0.0
See the version list below for details.
dotnet add package AIAgentSharp --version 1.0.0
NuGet\Install-Package AIAgentSharp -Version 1.0.0
<PackageReference Include="AIAgentSharp" Version="1.0.0" />
<PackageVersion Include="AIAgentSharp" Version="1.0.0" />
<PackageReference Include="AIAgentSharp" />
paket add AIAgentSharp --version 1.0.0
#r "nuget: AIAgentSharp, 1.0.0"
#:package AIAgentSharp@1.0.0
#addin nuget:?package=AIAgentSharp&version=1.0.0
#tool nuget:?package=AIAgentSharp&version=1.0.0
AIAgentSharp
A powerful .NET library for building AI agents with LLM integration, tool execution, and state management.
Features
- 🔄 Re/Act Pattern Support: Full implementation of the Re/Act (Reasoning and Acting) pattern for LLM agents
- 🔧 Function Calling: Support for OpenAI-style function calling when available
- ��️ Tool Framework: Rich tool system with automatic schema generation, validation, and introspection
- 💾 State Persistence: Multiple state store implementations (in-memory, file-based)
- 📊 Real-time Monitoring: Comprehensive event system for monitoring agent activity
- 🔄 Loop Detection: Intelligent loop breaker to prevent infinite loops
- 🔄 Deduplication: Smart caching of tool results to improve performance
Quick Start
using AIAgentSharp;
// Create components
var llm = new OpenAiLlmClient(apiKey, "gpt-4");
var store = new MemoryAgentStateStore();
var tools = new List<ITool> { new ConcatTool(), new GetIndicatorTool() };
// Configure agent
var config = new AgentConfiguration
{
MaxTurns = 40,
UseFunctionCalling = true,
EmitPublicStatus = true
};
// Create and run agent
var agent = new StatefulAgent(llm, store, config: config);
var result = await agent.RunAsync("my-agent", "Your goal here", tools);
Console.WriteLine($"Success: {result.Succeeded}");
Console.WriteLine($"Output: {result.FinalOutput}");
Creating Custom Tools
[ToolParams(Description = "Parameters for weather lookup")]
public sealed class WeatherParams
{
[ToolField(Description = "City name", Required = true)]
public string City { get; set; } = default!;
}
public sealed class WeatherTool : BaseTool<WeatherParams, object>
{
public override string Name => "get_weather";
public override string Description => "Get current weather for a city";
public override async Task<object> InvokeTypedAsync(WeatherParams parameters, CancellationToken ct = default)
{
// Your weather API logic here
return new { city = parameters.City, temperature = "22°C" };
}
}
Installation
dotnet add package AIAgentSharp
Documentation
For detailed documentation, examples, and API reference, visit: https://github.com/erwin-beckers/AIAgentSharp
License
MIT License - see LICENSE file for details.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- OpenAI (>= 2.3.0)
NuGet packages (4)
Showing the top 4 NuGet packages that depend on AIAgentSharp:
Package | Downloads |
---|---|
AIAgentSharp.OpenAI
OpenAI integration for AIAgentSharp - LLM-powered agents with OpenAI models. |
|
AIAgentSharp.Gemini
Google Gemini integration for AIAgentSharp - LLM-powered agents with Google Gemini models. |
|
AIAgentSharp.Mistral
Mistral AI integration for AIAgentSharp - LLM-powered agents with Mistral AI models. |
|
AIAgentSharp.Anthropic
Anthropic Claude integration for AIAgentSharp - LLM-powered agents with Anthropic Claude models. |
GitHub repositories
This package is not used by any popular GitHub repositories.