Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 78 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
<th align="center"><a href="https://github.com/runagent-dev/runagent-rs">runagent-rs</a></th>
<th align="center"><a href="https://github.com/runagent-dev/runagent-go">runagent-go</a></th>
<th align="center"><a href="https://github.com/runagent-dev/runagent-dart">runagent-dart</a></th>
<th align="center"><a href="https://github.com/runagent-dev/runagent-csharp">runagent-csharp</a></th>
</tr>
</thead>
<tbody>
Expand Down Expand Up @@ -56,6 +57,11 @@
<img src="https://img.shields.io/pub/dm/runagent" alt="pub.dev downloads">
</a>
</td>
<td align="center">
<a href="https://www.nuget.org/packages/RunAgent">
<img src="https://img.shields.io/nuget/dt/RunAgent" alt="NuGet downloads">
</a>
</td>
</tr>
<tr>
<td align="center">
Expand All @@ -77,6 +83,11 @@
<img src="https://img.shields.io/pub/v/runagent" alt="pub.dev version">
</a>
</td>
<td align="center">
<a href="https://www.nuget.org/packages/RunAgent">
<img src="https://img.shields.io/nuget/v/RunAgent" alt="NuGet version">
</a>
</td>
</tr>
</tbody>
</table>
Expand Down Expand Up @@ -255,15 +266,16 @@ async def solve_problem_stream(query, num_solutions, constraints):

**🌐 Access from any language:**

RunAgent offers multi-language SDKs : Rust, TypeScript, JavaScript, Go, Dart, and beyond—so you can integrate seamlessly without ever rewriting your agents for different stacks.
RunAgent offers multi-language SDKs : Rust, TypeScript, JavaScript, Go, Dart, C#/.NET, and beyond—so you can integrate seamlessly without ever rewriting your agents for different stacks.

<table>
<tr>
<td width="20%"><b>Python SDK</b></td>
<td width="20%"><b>JavaScript SDK</b></td>
<td width="20%"><b>Rust SDK</b></td>
<td width="20%"><b>Go SDK</b></td>
<td width="20%"><b>Dart SDK</b></td>
<td width="16.66%"><b>Python SDK</b></td>
<td width="16.66%"><b>JavaScript SDK</b></td>
<td width="16.66%"><b>Rust SDK</b></td>
<td width="16.66%"><b>Go SDK</b></td>
<td width="16.66%"><b>Dart SDK</b></td>
<td width="16.66%"><b>C# SDK</b></td>
</tr>
<tr>
<td valign="top">
Expand Down Expand Up @@ -452,6 +464,56 @@ void main() async {
}
```

</td>
<td valign="top">

```csharp
using RunAgent.Client;
using RunAgent.Types;

class Program
{
static async Task Main()
{
var config = RunAgentClientConfig
.Create("lg-solver-123", "solve_problem")
.WithLocal(true);

var client = await RunAgentClient
.CreateAsync(config);

var result = await client.RunAsync(
new Dictionary<string, object>
{
["query"] = "My laptop is slow",
["num_solutions"] = 3,
["constraints"] = new List<object>
{
new Dictionary<string, object>
{
["type"] = "budget",
["value"] = 100
}
}
}
);
Console.WriteLine(result);

// Streaming
await foreach (var chunk in client.RunStreamAsync(
new Dictionary<string, object>
{
["query"] = "Fix my phone",
["num_solutions"] = 4
}
))
{
Console.Write(chunk);
}
}
}
```

</td>
</tr>
</table>
Expand Down Expand Up @@ -620,6 +682,16 @@ final client = await RunAgentClient.create(
);
```

**C#:**
```csharp
var config = RunAgentClientConfig
.Create("agent-id", "entrypoint")
.WithUserId("user123")
.WithPersistentMemory(true);

var client = await RunAgentClient.CreateAsync(config);
```

### Key Benefits

- ⚡ **Fastest Serverless Memory** - Optimized for low-latency access and updates
Expand Down
121 changes: 121 additions & 0 deletions runagent-csharp/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
# Build results
[Dd]ebug/
[Dd]ebugPublic/
[Rr]elease/
[Rr]eleases/
x64/
x86/
[Ww][Ii][Nn]32/
[Aa][Rr][Mm]/
[Aa][Rr][Mm]64/
bld/
[Bb]in/
[Oo]bj/
[Ll]og/
[Ll]ogs/

# Visual Studio cache/options
.vs/
.vscode/

# NuGet Packages
*.nupkg
*.snupkg
nupkg/
**/packages/*
!**/packages/build/

# User-specific files
*.rsuser
*.suo
*.user
*.userosscache
*.sln.docstates

# Mono auto generated files
mono_crash.*

# Build results
[Bb]uild[Ll]og.*

# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.meta
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc

# Test Results
[Tt]est[Rr]esult*/
[Bb]uild[Ll]og.*

# .NET Core
project.lock.json
project.fragment.lock.json
artifacts/

# StyleCop
StyleCopReport.xml

# Files built by Visual Studio
*_i.c
*_p.c
*_h.h
*.ilk
*.obj
*.iobj
*.pch
*.pdb
*.ipdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.tmp_proj
*_wpftmp.csproj
*.log
*.tlog
*.vspscc
*.vssscc
.builds
*.pidb
*.svclog
*.scc

# Rider
.idea/
*.sln.iml

# macOS
.DS_Store

# Windows
Thumbs.db
ehthumbs.db
Desktop.ini
68 changes: 68 additions & 0 deletions runagent-csharp/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# Changelog

All notable changes to the RunAgent C# SDK will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.1.48] - 2026-02-03

### Fixed
- Fixed `Extractor` field type in `EntryPoint` class to support both string and object types from local server
- Fixed JSON deserialization for non-streaming responses when data is returned as JSON-encoded string
- Improved compatibility with local RunAgent server responses

## [0.1.47] - 2025-02-03

### Added
- Initial release of RunAgent C# SDK
- `RunAgentClient` with async/await support
- Support for both local and remote agent deployments
- REST API client for synchronous execution
- WebSocket client for streaming execution
- Comprehensive error handling with structured error types
- Persistent memory support with user isolation
- Configuration builder with fluent API
- Environment variable resolution
- Architecture discovery and entrypoint validation
- Stream vs non-stream entrypoint guardrails
- Health check functionality
- Complete documentation and examples

### Features
- **RunAgentClientConfig**: Fluent configuration builder
- **RunAgentClient**: Main client with initialization and execution
- **RestClient**: HTTP-based API interactions
- **SocketClient**: WebSocket streaming support
- **Error Taxonomy**: AuthenticationError, ValidationError, ConnectionError, ServerError, RunAgentExecutionError
- **Configuration Precedence**: Constructor args > Environment variables > Defaults
- **Persistent Memory**: User-scoped memory across executions
- **Multi-Framework Support**: Works with LangGraph, CrewAI, Letta, and all Python frameworks

### Examples
- BasicExample: Non-streaming agent execution
- StreamingExample: Real-time streaming responses
- LocalExample: Local agent deployment
- PersistentMemoryExample: Stateful interactions

### Dependencies
- .NET 6.0 or higher
- System.Text.Json 8.0.0

### Documentation
- Comprehensive README with quickstart guide
- Configuration reference table
- Error handling guide
- API reference
- Troubleshooting section
- Security best practices

## [Unreleased]

### Planned
- SQLite database support for local agent discovery
- Connection pooling and retry logic
- Request/response middleware hooks
- Enhanced logging and telemetry
- Support for .NET Framework 4.8+
- Additional examples and tutorials
21 changes: 21 additions & 0 deletions runagent-csharp/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2025 RunAgent Team

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Loading