diff --git a/README.md b/README.md index b4038ac..ceeb322 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,7 @@ runagent-rs runagent-go runagent-dart + runagent-csharp @@ -56,6 +57,11 @@ pub.dev downloads + + + NuGet downloads + + @@ -77,6 +83,11 @@ pub.dev version + + + NuGet version + + @@ -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. - - - - - + + + + + + +
Python SDKJavaScript SDKRust SDKGo SDKDart SDKPython SDKJavaScript SDKRust SDKGo SDKDart SDKC# SDK
@@ -452,6 +464,56 @@ void main() async { } ``` + + +```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 + { + ["query"] = "My laptop is slow", + ["num_solutions"] = 3, + ["constraints"] = new List + { + new Dictionary + { + ["type"] = "budget", + ["value"] = 100 + } + } + } + ); + Console.WriteLine(result); + + // Streaming + await foreach (var chunk in client.RunStreamAsync( + new Dictionary + { + ["query"] = "Fix my phone", + ["num_solutions"] = 4 + } + )) + { + Console.Write(chunk); + } + } +} +``` +
@@ -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 diff --git a/runagent-csharp/.gitignore b/runagent-csharp/.gitignore new file mode 100644 index 0000000..209c034 --- /dev/null +++ b/runagent-csharp/.gitignore @@ -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 diff --git a/runagent-csharp/CHANGELOG.md b/runagent-csharp/CHANGELOG.md new file mode 100644 index 0000000..62a0998 --- /dev/null +++ b/runagent-csharp/CHANGELOG.md @@ -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 diff --git a/runagent-csharp/LICENSE b/runagent-csharp/LICENSE new file mode 100644 index 0000000..851319f --- /dev/null +++ b/runagent-csharp/LICENSE @@ -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. diff --git a/runagent-csharp/PUBLISH.md b/runagent-csharp/PUBLISH.md new file mode 100644 index 0000000..edfd273 --- /dev/null +++ b/runagent-csharp/PUBLISH.md @@ -0,0 +1,151 @@ +# Publishing Guide for RunAgent C# SDK + +This guide covers the process of publishing new versions of the RunAgent C# SDK to NuGet. + +## Prerequisites + +1. **NuGet Account**: Create an account at [nuget.org](https://www.nuget.org/) +2. **API Key**: Generate an API key from your NuGet account settings +3. **.NET SDK**: Install .NET SDK 6.0 or higher +4. **Repository Access**: Write access to the runagent-csharp repository + +## Version Bump Checklist + +Before publishing a new version: + +- [ ] Update version number in `RunAgent.csproj` +- [ ] Update version in examples (if referencing version) +- [ ] Update `CHANGELOG.md` with new version and changes +- [ ] Update README if there are API changes or new features +- [ ] Run all tests and ensure they pass +- [ ] Build the project in Release mode +- [ ] Review changes in PR before merging to main + +## Build and Test + +### 1. Clean and Restore + +```bash +dotnet clean +dotnet restore +``` + +### 2. Build in Release Mode + +```bash +dotnet build --configuration Release +``` + +### 3. Run Tests (when available) + +```bash +dotnet test --configuration Release +``` + +### 4. Create NuGet Package + +```bash +dotnet pack --configuration Release --output ./nupkg +``` + +This creates a `.nupkg` file in the `./nupkg` directory. + +## Publishing to NuGet + +### Option 1: Using dotnet CLI + +1. **Set API Key** (first time only): + ```bash + dotnet nuget push --help + ``` + +2. **Push Package**: + ```bash + dotnet nuget push ./nupkg/RunAgent.0.1.47.nupkg --api-key YOUR_API_KEY --source https://api.nuget.org/v3/index.json + ``` + +### Option 2: Using NuGet.org Web Interface + +1. Go to [nuget.org/packages/manage/upload](https://www.nuget.org/packages/manage/upload) +2. Upload the `.nupkg` file from `./nupkg` directory +3. Review and publish + +## Post-Publication + +After publishing: + +1. **Verify Package**: Check that the package appears at https://www.nuget.org/packages/RunAgent +2. **Test Installation**: Install the package in a test project: + ```bash + dotnet new console -n TestRunAgent + cd TestRunAgent + dotnet add package RunAgent + ``` +3. **Tag Release**: Create a git tag for the version: + ```bash + git tag -a v0.1.47 -m "Release version 0.1.47" + git push origin v0.1.47 + ``` +4. **Create GitHub Release**: Create a release on GitHub with changelog notes +5. **Update Documentation**: Update docs.run-agent.ai if needed +6. **Announce**: Share update on Discord, social media, etc. + +## Version Numbering + +Follow [Semantic Versioning](https://semver.org/): + +- **MAJOR** version (X.0.0): Breaking changes +- **MINOR** version (0.X.0): New features, backward compatible +- **PATCH** version (0.0.X): Bug fixes, backward compatible + +### Examples: +- `0.1.47` → `0.1.48`: Bug fix or small improvement +- `0.1.47` → `0.2.0`: New feature added +- `0.1.47` → `1.0.0`: Breaking API change or first stable release + +## Troubleshooting + +### Package Push Fails + +**Error**: "The package already exists" + +**Solution**: Increment version number - NuGet doesn't allow overwriting published versions + +### Build Errors + +**Error**: Missing dependencies + +**Solution**: Run `dotnet restore` and ensure all dependencies are available + +### API Key Issues + +**Error**: "The API key is invalid" + +**Solution**: +1. Verify API key is correct +2. Check API key has push permissions +3. Regenerate API key if needed + +## Release Checklist + +Complete checklist before publishing: + +- [ ] Version bumped in `.csproj` +- [ ] CHANGELOG updated +- [ ] README updated (if needed) +- [ ] All tests passing +- [ ] Build succeeds in Release mode +- [ ] Package created successfully +- [ ] Package pushed to NuGet +- [ ] Installation tested +- [ ] Git tag created +- [ ] GitHub release created +- [ ] Documentation updated +- [ ] Announcement made + +## Contact + +For questions about publishing: +- **Discord**: [RunAgent Community](https://discord.gg/Q9P9AdHVHz) +- **Email**: team@run-agent.ai +- **GitHub Issues**: [runagent-csharp/issues](https://github.com/runagent-dev/runagent-csharp/issues) diff --git a/runagent-csharp/README.md b/runagent-csharp/README.md new file mode 100644 index 0000000..a3f063f --- /dev/null +++ b/runagent-csharp/README.md @@ -0,0 +1,394 @@ +# RunAgent C# SDK + +C# SDK for RunAgent - Secured, reliable AI agent deployment at scale. Run your stack. Let us run your agents. + +[![NuGet Version](https://img.shields.io/nuget/v/RunAgent)](https://www.nuget.org/packages/RunAgent) +[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) + +## Features + +- **Multi-Language Support**: Access Python AI agents from C#/.NET applications +- **Local & Remote Deployment**: Support for both local development and cloud deployments +- **Streaming & Non-Streaming**: Execute agents synchronously or with real-time streaming +- **Persistent Memory**: Enable stateful interactions with user-isolated memory +- **Type-Safe**: Full C# type safety with async/await patterns +- **Framework Agnostic**: Works with any Python agent framework (LangGraph, CrewAI, Letta, etc.) + +## Installation + +### NuGet Package Manager +```bash +dotnet add package RunAgent +``` + +### Package Manager Console +```powershell +Install-Package RunAgent +``` + +## Quick Start + +### Remote Agent Execution + +```csharp +using RunAgent.Client; +using RunAgent.Types; + +// Create client configuration +var config = RunAgentClientConfig + .Create("YOUR_AGENT_ID", "solve_problem") + .WithApiKey("your-api-key"); // Or set RUNAGENT_API_KEY environment variable + +// Initialize client +var client = await RunAgentClient.CreateAsync(config); + +// Execute agent +var result = await client.RunAsync(new Dictionary +{ + ["query"] = "My laptop is slow", + ["num_solutions"] = 3, + ["constraints"] = new List + { + new Dictionary + { + ["type"] = "budget", + ["value"] = 100 + } + } +}); + +Console.WriteLine(JsonSerializer.Serialize(result, new JsonSerializerOptions +{ + WriteIndented = true +})); + +// Cleanup +client.Dispose(); +``` + +### Streaming Execution + +```csharp +// Create client for streaming entrypoint +var config = RunAgentClientConfig + .Create("YOUR_AGENT_ID", "solve_problem_stream") + .WithApiKey("your-api-key"); + +var client = await RunAgentClient.CreateAsync(config); + +// Stream results in real-time +await foreach (var chunk in client.RunStreamAsync(new Dictionary +{ + ["query"] = "Fix my phone", + ["num_solutions"] = 4 +})) +{ + Console.Write(chunk); +} + +client.Dispose(); +``` + +### Local Agent Development + +```csharp +// Connect to local agent +var config = RunAgentClientConfig + .Create("local-agent-id", "generic") + .WithLocal(true) + .WithHostAndPort("127.0.0.1", 8450); // Optional: auto-discovers if not specified + +var client = await RunAgentClient.CreateAsync(config); + +// Execute local agent +var result = await client.RunAsync(new Dictionary +{ + ["message"] = "Hello from C# SDK!" +}); + +client.Dispose(); +``` + +### Persistent Memory + +Enable stateful interactions with persistent memory: + +```csharp +// Create client with persistent memory +var config = RunAgentClientConfig + .Create("YOUR_AGENT_ID", "chat") + .WithApiKey("your-api-key") + .WithUserId("user123") // User identifier for memory isolation + .WithPersistentMemory(true); // Enable persistent memory + +var client = await RunAgentClient.CreateAsync(config); + +// First interaction - agent learns preference +var result1 = await client.RunAsync(new Dictionary +{ + ["message"] = "I prefer dark mode interfaces" +}); + +// Second interaction - agent remembers the preference +var result2 = await client.RunAsync(new Dictionary +{ + ["message"] = "What's my UI preference?" +}); +// Agent responds: "You prefer dark mode interfaces" + +client.Dispose(); +``` + +## Configuration + +### Configuration Precedence + +Configuration values are resolved in the following order: + +1. **Explicit constructor arguments** (highest priority) +2. **Environment variables** +3. **Library defaults** (lowest priority) + +### Configuration Options + +| Option | Type | Required | Default | Description | +|--------|------|----------|---------|-------------| +| `AgentId` | `string` | Yes | - | Agent identifier | +| `EntrypointTag` | `string` | Yes | - | Entrypoint tag to invoke | +| `Local` | `bool` | No | `false` | Enable local mode | +| `Host` | `string` | No | `127.0.0.1` | Local agent host | +| `Port` | `int` | No | `8450` | Local agent port | +| `ApiKey` | `string` | No | - | API key for remote auth | +| `BaseUrl` | `string` | No | `https://backend.run-agent.ai` | Remote deployment URL | +| `UserId` | `string` | No | - | User ID for memory isolation | +| `PersistentMemory` | `bool` | No | `false` | Enable persistent memory | +| `ExtraParams` | `Dictionary` | No | - | Extra metadata parameters | + +### Environment Variables + +- `RUNAGENT_API_KEY` - API key for remote authentication +- `RUNAGENT_BASE_URL` - Base URL for remote deployments + +### Builder Pattern + +Use the fluent builder API for configuration: + +```csharp +var config = RunAgentClientConfig + .Create("agent-id", "entrypoint") + .WithApiKey("key") + .WithUserId("user123") + .WithPersistentMemory(true) + .WithExtraParams(new Dictionary + { + ["custom_field"] = "value" + }); +``` + +## Error Handling + +The SDK provides a comprehensive error taxonomy: + +| Error Type | Description | +|------------|-------------| +| `AuthenticationError` | Missing or invalid API key (HTTP 401, 403) | +| `PermissionError` | Access denied (HTTP 403) | +| `ConnectionError` | Network issues, timeouts, DNS failures | +| `ValidationError` | Bad config, missing agent, invalid entrypoint (HTTP 400, 404, 422) | +| `ServerError` | Backend failures (HTTP 5xx) | +| `RunAgentExecutionError` | Structured execution errors with code, message, suggestion, details | +| `UnknownError` | Unclassified errors | + +### Example Error Handling + +```csharp +try +{ + var client = await RunAgentClient.CreateAsync(config); + var result = await client.RunAsync(kwargs); +} +catch (AuthenticationError ex) +{ + Console.WriteLine($"Auth Error: {ex.Message}"); + Console.WriteLine("Set RUNAGENT_API_KEY or pass apiKey in config"); +} +catch (ValidationError ex) +{ + Console.WriteLine($"Validation Error: {ex.Message}"); +} +catch (RunAgentExecutionError ex) +{ + Console.WriteLine($"Execution Error [{ex.Code}]: {ex.Message}"); + if (ex.Suggestion != null) + Console.WriteLine($"Suggestion: {ex.Suggestion}"); +} +catch (ConnectionError ex) +{ + Console.WriteLine($"Connection Error: {ex.Message}"); +} +``` + +## API Reference + +### RunAgentClient + +#### Static Methods + +- `CreateAsync(RunAgentClientConfig config)` - Create and initialize client +- `CreateFromEnvironmentAsync(string agentId, string entrypointTag)` - Create client from environment variables + +#### Instance Methods + +- `RunAsync(Dictionary? kwargs)` - Execute agent synchronously +- `RunAsync(List? args, Dictionary? kwargs)` - Execute with positional and keyword arguments +- `RunStreamAsync(Dictionary? kwargs)` - Execute with streaming +- `RunStreamAsync(List? args, Dictionary? kwargs)` - Stream with positional and keyword arguments +- `GetAgentArchitecture()` - Get agent architecture definition +- `HealthCheckAsync()` - Check agent availability +- `GetAgentId()` - Get agent ID +- `GetEntrypointTag()` - Get entrypoint tag +- `IsLocal()` - Check if running in local mode +- `GetUserId()` - Get user ID for persistent memory +- `IsPersistentMemoryEnabled()` - Check if persistent memory is enabled +- `GetExtraParams()` - Get extra parameters +- `Dispose()` - Cleanup resources + +## Entrypoint Validation + +The SDK enforces correct usage of streaming vs non-streaming entrypoints: + +- **Streaming entrypoints** (tags ending with `_stream`): Must use `RunStreamAsync()` +- **Non-streaming entrypoints**: Must use `RunAsync()` + +Attempting to use the wrong method will throw a `ValidationError` with a helpful suggestion. + +## Local Agent Setup + +To use local agents: + +1. Start your local agent: + ```bash + cd my-agent + runagent serve . + ``` + +2. Connect from C#: + ```csharp + var config = RunAgentClientConfig + .Create("local-agent-id", "entrypoint") + .WithLocal(true); + + var client = await RunAgentClient.CreateAsync(config); + ``` + +## Persistent Memory + +Persistent Memory enables stateful agent interactions: + +- **User Isolation**: Each `UserId` has isolated memory space +- **Cross-Execution**: State persists across multiple agent invocations +- **Multi-Language**: Works seamlessly with all RunAgent SDKs +- **Serverless**: Built on serverless infrastructure that scales automatically + +### Use Cases + +- Conversational AI with context retention +- Personalized user experiences +- Multi-step workflows +- Learning systems that improve over time + +## Security Best Practices + +1. **Never hardcode API keys** - Use environment variables or secure configuration +2. **Validate inputs** - Always validate user inputs before passing to agents +3. **Handle errors gracefully** - Implement proper error handling for production use +4. **Use HTTPS** - Always use secure connections for remote agents +5. **Isolate users** - Use unique `UserId` values for multi-tenant applications + +## Examples + +See the [examples](./examples) directory for complete working examples: + +- `BasicExample.cs` - Non-streaming agent execution +- `StreamingExample.cs` - Real-time streaming responses +- `LocalExample.cs` - Local agent deployment +- `PersistentMemoryExample.cs` - Stateful interactions with persistent memory + +## Requirements + +- .NET 8.0 or higher +- C# 12.0 or higher + +## Dependencies + +- `System.Text.Json` 9.0.0 + +## Troubleshooting + +### "Authentication failed" error + +**Cause**: Missing or invalid API key + +**Solution**: Set `RUNAGENT_API_KEY` environment variable or pass `apiKey` in config: + +```csharp +var config = RunAgentClientConfig + .Create("agent-id", "entrypoint") + .WithApiKey("your-api-key"); +``` + +### "Entrypoint not found" error + +**Cause**: Specified entrypoint tag doesn't exist + +**Solution**: Check the error message for available entrypoints, or fetch architecture: + +```csharp +var architecture = client.GetAgentArchitecture(); +foreach (var ep in architecture.Entrypoints) +{ + Console.WriteLine($"Available: {ep.Tag}"); +} +``` + +### Connection timeout + +**Cause**: Network issues or agent not responding + +**Solution**: +- For local agents: Ensure agent is running with `runagent serve .` +- For remote agents: Check network connectivity and agent status in dashboard + +### "STREAM_ENTRYPOINT" or "NON_STREAM_ENTRYPOINT" error + +**Cause**: Using wrong method for entrypoint type + +**Solution**: +- For `*_stream` tags: Use `RunStreamAsync()` +- For other tags: Use `RunAsync()` + +## Contributing + +Contributions are welcome! Please see the main [RunAgent repository](https://github.com/runagent-dev/runagent) for contribution guidelines. + +## License + +MIT License - see [LICENSE](LICENSE) file for details. + +## Support + +- **Documentation**: [https://docs.run-agent.ai](https://docs.run-agent.ai) +- **Discord**: [Join our Discord community](https://discord.gg/Q9P9AdHVHz) +- **GitHub Issues**: [Report bugs or request features](https://github.com/runagent-dev/runagent-csharp/issues) + +## Related Projects + +- [runagent-py](https://github.com/runagent-dev/runagent-py) - Python SDK (CLI + Client) +- [runagent-js](https://github.com/runagent-dev/runagent-js) - JavaScript/TypeScript SDK +- [runagent-rs](https://github.com/runagent-dev/runagent-rs) - Rust SDK +- [runagent-go](https://github.com/runagent-dev/runagent-go) - Go SDK +- [runagent-dart](https://github.com/runagent-dev/runagent-dart) - Dart SDK + +--- + +Made with ❤️ by the RunAgent Team diff --git a/runagent-csharp/RunAgent.csproj b/runagent-csharp/RunAgent.csproj new file mode 100644 index 0000000..e888d5f --- /dev/null +++ b/runagent-csharp/RunAgent.csproj @@ -0,0 +1,28 @@ + + + + net8.0 + latest + enable + enable + RunAgent + 0.1.48 + RunAgent Team + RunAgent + C# SDK for RunAgent - Secured, reliable AI agent deployment at scale. Run your stack. Let us run your agents. + MIT + https://github.com/runagent-dev/runagent-csharp + https://github.com/runagent-dev/runagent-csharp + ai;agents;runagent;serverless;deployment;langgraph;crewai + README.md + + + + + + + + + + + diff --git a/runagent-csharp/examples/BasicExample.cs b/runagent-csharp/examples/BasicExample.cs new file mode 100644 index 0000000..8c7065b --- /dev/null +++ b/runagent-csharp/examples/BasicExample.cs @@ -0,0 +1,70 @@ +using RunAgent.Client; +using RunAgent.Types; +using RunAgent.Errors; + +namespace RunAgent.Examples; + +/// +/// Basic example demonstrating non-streaming agent execution +/// +public class BasicExample +{ + public static async Task Main(string[] args) + { + try + { + // Create client configuration + var config = RunAgentClientConfig + .Create("YOUR_AGENT_ID", "solve_problem") + .WithApiKey("your-api-key"); // Or set RUNAGENT_API_KEY environment variable + + // Initialize client + var client = await RunAgentClient.CreateAsync(config); + + // Execute agent with keyword arguments + var result = await client.RunAsync(new Dictionary + { + ["query"] = "My laptop is slow", + ["num_solutions"] = 3, + ["constraints"] = new List + { + new Dictionary + { + ["type"] = "budget", + ["value"] = 100 + } + } + }); + + Console.WriteLine("Result:"); + Console.WriteLine(System.Text.Json.JsonSerializer.Serialize(result, new System.Text.Json.JsonSerializerOptions + { + WriteIndented = true + })); + + // Cleanup + client.Dispose(); + } + catch (AuthenticationError ex) + { + Console.WriteLine($"Authentication Error: {ex.Message}"); + Console.WriteLine("Please set RUNAGENT_API_KEY environment variable or pass API key in config"); + } + catch (ValidationError ex) + { + Console.WriteLine($"Validation Error: {ex.Message}"); + } + catch (ConnectionError ex) + { + Console.WriteLine($"Connection Error: {ex.Message}"); + } + catch (RunAgentExecutionError ex) + { + Console.WriteLine($"Execution Error: {ex}"); + } + catch (Exception ex) + { + Console.WriteLine($"Unexpected Error: {ex.Message}"); + } + } +} diff --git a/runagent-csharp/examples/LocalExample.cs b/runagent-csharp/examples/LocalExample.cs new file mode 100644 index 0000000..b856c56 --- /dev/null +++ b/runagent-csharp/examples/LocalExample.cs @@ -0,0 +1,62 @@ +using RunAgent.Client; +using RunAgent.Types; +using RunAgent.Errors; + +namespace RunAgent.Examples; + +/// +/// Example demonstrating local agent deployment usage +/// +public class LocalExample +{ + public static async Task Main(string[] args) + { + try + { + // Create client configuration for local agent + var config = RunAgentClientConfig + .Create("local-agent-id", "generic") + .WithLocal(true) + .WithHostAndPort("127.0.0.1", 8450); // Optional: will auto-discover if not specified + + // Initialize client + var client = await RunAgentClient.CreateAsync(config); + + Console.WriteLine($"Connected to local agent: {client.GetAgentId()}"); + Console.WriteLine($"Entrypoint: {client.GetEntrypointTag()}"); + + // Check agent health + var isHealthy = await client.HealthCheckAsync(); + Console.WriteLine($"Agent health: {(isHealthy ? "OK" : "FAILED")}"); + + // Execute agent + var result = await client.RunAsync(new Dictionary + { + ["message"] = "Hello from C# SDK!" + }); + + Console.WriteLine("Result:"); + Console.WriteLine(System.Text.Json.JsonSerializer.Serialize(result, new System.Text.Json.JsonSerializerOptions + { + WriteIndented = true + })); + + // Cleanup + client.Dispose(); + } + catch (ValidationError ex) + { + Console.WriteLine($"Validation Error: {ex.Message}"); + Console.WriteLine("Make sure the local agent is running with: runagent serve ."); + } + catch (ConnectionError ex) + { + Console.WriteLine($"Connection Error: {ex.Message}"); + Console.WriteLine("Make sure the local agent is running and accessible"); + } + catch (Exception ex) + { + Console.WriteLine($"Error: {ex.Message}"); + } + } +} diff --git a/runagent-csharp/examples/PersistentMemoryExample.cs b/runagent-csharp/examples/PersistentMemoryExample.cs new file mode 100644 index 0000000..a5f402e --- /dev/null +++ b/runagent-csharp/examples/PersistentMemoryExample.cs @@ -0,0 +1,72 @@ +using RunAgent.Client; +using RunAgent.Types; +using RunAgent.Errors; + +namespace RunAgent.Examples; + +/// +/// Example demonstrating persistent memory for stateful agent interactions +/// +public class PersistentMemoryExample +{ + public static async Task Main(string[] args) + { + try + { + // Create client with persistent memory enabled + var config = RunAgentClientConfig + .Create("YOUR_AGENT_ID", "chat") + .WithApiKey("your-api-key") + .WithUserId("user123") // User identifier for memory isolation + .WithPersistentMemory(true); // Enable persistent memory + + // Initialize client + var client = await RunAgentClient.CreateAsync(config); + + Console.WriteLine($"User ID: {client.GetUserId()}"); + Console.WriteLine($"Persistent Memory: {client.IsPersistentMemoryEnabled()}"); + Console.WriteLine(); + + // First interaction - agent learns user preference + Console.WriteLine("First interaction:"); + var result1 = await client.RunAsync(new Dictionary + { + ["message"] = "I prefer dark mode interfaces" + }); + Console.WriteLine(System.Text.Json.JsonSerializer.Serialize(result1, new System.Text.Json.JsonSerializerOptions + { + WriteIndented = true + })); + Console.WriteLine(); + + // Second interaction - agent remembers the preference + Console.WriteLine("Second interaction:"); + var result2 = await client.RunAsync(new Dictionary + { + ["message"] = "What's my UI preference?" + }); + Console.WriteLine(System.Text.Json.JsonSerializer.Serialize(result2, new System.Text.Json.JsonSerializerOptions + { + WriteIndented = true + })); + Console.WriteLine(); + + Console.WriteLine("Agent successfully remembered context across executions!"); + + // Cleanup + client.Dispose(); + } + catch (AuthenticationError ex) + { + Console.WriteLine($"Authentication Error: {ex.Message}"); + } + catch (ValidationError ex) + { + Console.WriteLine($"Validation Error: {ex.Message}"); + } + catch (Exception ex) + { + Console.WriteLine($"Error: {ex.Message}"); + } + } +} diff --git a/runagent-csharp/examples/StreamingExample.cs b/runagent-csharp/examples/StreamingExample.cs new file mode 100644 index 0000000..60d0694 --- /dev/null +++ b/runagent-csharp/examples/StreamingExample.cs @@ -0,0 +1,64 @@ +using RunAgent.Client; +using RunAgent.Types; +using RunAgent.Errors; + +namespace RunAgent.Examples; + +/// +/// Example demonstrating streaming agent execution with real-time responses +/// +public class StreamingExample +{ + public static async Task Main(string[] args) + { + try + { + // Create client configuration for streaming entrypoint + var config = RunAgentClientConfig + .Create("YOUR_AGENT_ID", "solve_problem_stream") + .WithApiKey("your-api-key"); // Or set RUNAGENT_API_KEY environment variable + + // Initialize client + var client = await RunAgentClient.CreateAsync(config); + + Console.WriteLine("Streaming results:"); + Console.WriteLine("==================="); + + // Execute agent with streaming + await foreach (var chunk in client.RunStreamAsync(new Dictionary + { + ["query"] = "Fix my phone", + ["num_solutions"] = 4 + })) + { + Console.Write(chunk); + } + + Console.WriteLine("\n==================="); + Console.WriteLine("Stream completed"); + + // Cleanup + client.Dispose(); + } + catch (AuthenticationError ex) + { + Console.WriteLine($"Authentication Error: {ex.Message}"); + } + catch (ValidationError ex) + { + Console.WriteLine($"Validation Error: {ex.Message}"); + } + catch (ConnectionError ex) + { + Console.WriteLine($"Connection Error: {ex.Message}"); + } + catch (RunAgentExecutionError ex) + { + Console.WriteLine($"Execution Error: {ex}"); + } + catch (Exception ex) + { + Console.WriteLine($"Unexpected Error: {ex.Message}"); + } + } +} diff --git a/runagent-csharp/src/Client/RestClient.cs b/runagent-csharp/src/Client/RestClient.cs new file mode 100644 index 0000000..acad27b --- /dev/null +++ b/runagent-csharp/src/Client/RestClient.cs @@ -0,0 +1,297 @@ +using System.Net; +using System.Net.Http.Headers; +using System.Text; +using System.Text.Json; +using RunAgent.Errors; +using RunAgent.Types; +using RunAgent.Utils; + +namespace RunAgent.Client; + +/// +/// REST client for HTTP-based RunAgent API interactions +/// +public class RestClient : IDisposable +{ + private readonly HttpClient _httpClient; + private readonly string _baseUrl; + private readonly string? _apiKey; + private readonly bool _isLocal; + + public RestClient(string baseUrl, string? apiKey, bool isLocal) + { + _baseUrl = baseUrl; + _apiKey = apiKey; + _isLocal = isLocal; + + _httpClient = new HttpClient + { + Timeout = TimeSpan.FromSeconds(Constants.DefaultTimeoutSeconds + 10) + }; + + // Set User-Agent header + _httpClient.DefaultRequestHeaders.UserAgent.Add( + new ProductInfoHeaderValue("RunAgent-CSharp", "0.1.47") + ); + + // Set Authorization header for remote calls + if (!_isLocal && !string.IsNullOrEmpty(_apiKey)) + { + _httpClient.DefaultRequestHeaders.Authorization = + new AuthenticationHeaderValue("Bearer", _apiKey); + } + } + + /// + /// Fetch agent architecture and entrypoints + /// + public async Task GetAgentArchitecture(string agentId) + { + var url = $"{_baseUrl}{Constants.ApiPrefix}/agents/{agentId}/architecture"; + + try + { + var response = await _httpClient.GetAsync(url); + var content = await response.Content.ReadAsStringAsync(); + + if (!response.IsSuccessStatusCode) + { + HandleHttpError(response.StatusCode, content); + } + + // Try to parse as envelope first + try + { + var envelope = JsonSerializer.Deserialize>(content); + if (envelope?.Success == true && envelope.Data != null) + { + return envelope.Data; + } + else if (envelope?.Success == false && envelope.Error != null) + { + throw new RunAgentExecutionError( + envelope.Error.Code, + envelope.Error.Message, + envelope.Error.Suggestion, + envelope.Error.Details + ); + } + } + catch (JsonException) + { + // Try parsing as direct payload + var architecture = JsonSerializer.Deserialize(content); + if (architecture != null) + { + return architecture; + } + } + + throw new ValidationError("Failed to parse agent architecture response"); + } + catch (HttpRequestException ex) + { + throw new ConnectionError($"Failed to fetch agent architecture: {ex.Message}", ex); + } + catch (TaskCanceledException) + { + throw new ConnectionError("Request timed out while fetching agent architecture"); + } + } + + /// + /// Execute agent via REST API + /// + public async Task RunAgent( + string agentId, + string entrypointTag, + List? inputArgs = null, + Dictionary? inputKwargs = null, + int timeoutSeconds = Constants.DefaultTimeoutSeconds, + string? userId = null, + bool persistentMemory = false + ) + { + var url = $"{_baseUrl}{Constants.ApiPrefix}/agents/{agentId}/run"; + + var payload = new Dictionary + { + ["entrypoint_tag"] = entrypointTag, + ["input_args"] = inputArgs ?? new List(), + ["input_kwargs"] = inputKwargs ?? new Dictionary(), + ["timeout_seconds"] = timeoutSeconds, + ["async_execution"] = false + }; + + // Add persistent memory parameters if provided + if (!string.IsNullOrEmpty(userId)) + { + payload["user_id"] = userId; + } + if (persistentMemory) + { + payload["persistent_memory"] = persistentMemory; + } + + var jsonContent = JsonSerializer.Serialize(payload); + var content = new StringContent(jsonContent, Encoding.UTF8, "application/json"); + + try + { + var response = await _httpClient.PostAsync(url, content); + var responseContent = await response.Content.ReadAsStringAsync(); + + if (!response.IsSuccessStatusCode) + { + HandleHttpError(response.StatusCode, responseContent); + } + + return ParseRunResponse(responseContent); + } + catch (HttpRequestException ex) + { + throw new ConnectionError($"Failed to execute agent: {ex.Message}", ex); + } + catch (TaskCanceledException) + { + throw new ConnectionError("Request timed out during agent execution"); + } + } + + /// + /// Health check for agent availability + /// + public async Task HealthCheck() + { + var url = $"{_baseUrl}{Constants.ApiPrefix}/health"; + + try + { + var response = await _httpClient.GetAsync(url); + return response.IsSuccessStatusCode; + } + catch + { + return false; + } + } + + /// + /// Parse run response and extract result data + /// + private object? ParseRunResponse(string responseContent) + { + try + { + var envelope = JsonSerializer.Deserialize>(responseContent); + + if (envelope?.Success == false && envelope.Error != null) + { + throw new RunAgentExecutionError( + envelope.Error.Code, + envelope.Error.Message, + envelope.Error.Suggestion, + envelope.Error.Details + ); + } + + if (envelope?.Success == true && envelope.Data.ValueKind != JsonValueKind.Undefined && envelope.Data.ValueKind != JsonValueKind.Null) + { + var data = envelope.Data; + + // Check if data is a string (JSON-encoded string from local server) + if (data.ValueKind == JsonValueKind.String) + { + var dataString = data.GetString(); + if (!string.IsNullOrEmpty(dataString)) + { + // Parse the JSON string + return JsonSerializer.Deserialize(dataString); + } + } + + // Try to extract result_data.data (legacy structured output) + if (data.TryGetProperty("result_data", out var resultData) && + resultData.TryGetProperty("data", out var innerData)) + { + return JsonSerializer.Deserialize(innerData.GetRawText()); + } + + // Return data directly + return JsonSerializer.Deserialize(data.GetRawText()); + } + + // Fallback: try to parse as direct JSON + return JsonSerializer.Deserialize(responseContent); + } + catch (JsonException ex) + { + throw new ValidationError($"Failed to parse response: {ex.Message}"); + } + } + + /// + /// Handle HTTP errors and throw appropriate exceptions + /// + private void HandleHttpError(HttpStatusCode statusCode, string content) + { + // Try to parse structured error + try + { + var envelope = JsonSerializer.Deserialize>(content); + if (envelope?.Error != null) + { + var error = envelope.Error; + var exception = new RunAgentExecutionError( + error.Code, + error.Message, + error.Suggestion, + error.Details + ); + + // Map to specific error types based on code + if (error.Code.Contains("AUTHENTICATION") || statusCode == HttpStatusCode.Unauthorized) + throw new AuthenticationError(exception.Message); + if (error.Code.Contains("PERMISSION") || statusCode == HttpStatusCode.Forbidden) + throw new PermissionError(exception.Message); + if (error.Code.Contains("VALIDATION") || error.Code.Contains("NOT_FOUND")) + throw new ValidationError(exception.Message); + if (error.Code.Contains("SERVER") || error.Code.Contains("INTERNAL")) + throw new ServerError(exception.Message); + + throw exception; + } + } + catch (JsonException) + { + // Fallback to status code mapping + } + + // Map HTTP status codes to error types + var message = $"HTTP {(int)statusCode}: {content}"; + + switch (statusCode) + { + case HttpStatusCode.Unauthorized: + throw new AuthenticationError("Authentication failed. Please provide a valid API key via RUNAGENT_API_KEY environment variable or constructor."); + case HttpStatusCode.Forbidden: + throw new PermissionError("Access denied. Check your API key permissions."); + case HttpStatusCode.BadRequest: + case HttpStatusCode.NotFound: + case HttpStatusCode.UnprocessableEntity: + throw new ValidationError(message); + case HttpStatusCode.InternalServerError: + case HttpStatusCode.BadGateway: + case HttpStatusCode.ServiceUnavailable: + case HttpStatusCode.GatewayTimeout: + throw new ServerError(message); + default: + throw new UnknownError(message); + } + } + + public void Dispose() + { + _httpClient?.Dispose(); + } +} diff --git a/runagent-csharp/src/Client/RunAgentClient.cs b/runagent-csharp/src/Client/RunAgentClient.cs new file mode 100644 index 0000000..c86b006 --- /dev/null +++ b/runagent-csharp/src/Client/RunAgentClient.cs @@ -0,0 +1,272 @@ +using RunAgent.Errors; +using RunAgent.Types; +using RunAgent.Utils; + +namespace RunAgent.Client; + +/// +/// Main client for interacting with RunAgent deployments +/// Supports both local and remote agents with streaming and non-streaming execution +/// +public class RunAgentClient : IDisposable +{ + private readonly RunAgentClientConfig _config; + private readonly RestClient _restClient; + private readonly SocketClient _socketClient; + private readonly string _agentId; + private readonly string _entrypointTag; + private readonly bool _isLocal; + private readonly string? _userId; + private readonly bool _persistentMemory; + private readonly Dictionary? _extraParams; + + private AgentArchitecture? _architecture; + private EntryPoint? _selectedEntrypoint; + + private RunAgentClient(RunAgentClientConfig config) + { + _config = config ?? throw new ArgumentNullException(nameof(config)); + _agentId = config.AgentId; + _entrypointTag = config.EntrypointTag; + _isLocal = config.Local; + _userId = config.UserId; + _persistentMemory = config.PersistentMemory; + _extraParams = config.ExtraParams; + + // Resolve configuration + var apiKey = ConfigLoader.ResolveApiKey(config.ApiKey); + var baseUrl = ConfigLoader.ResolveBaseUrl(config.BaseUrl); + var host = ConfigLoader.ResolveHost(config.Host); + var port = ConfigLoader.ResolvePort(config.Port); + + // Build base URL + string finalBaseUrl; + if (_isLocal) + { + finalBaseUrl = $"http://{host}:{port}"; + } + else + { + finalBaseUrl = baseUrl; + + // Validate API key for remote calls + if (string.IsNullOrEmpty(apiKey)) + { + throw new AuthenticationError( + "API key is required for remote agents. " + + "Set RUNAGENT_API_KEY environment variable or pass apiKey in config." + ); + } + } + + _restClient = new RestClient(finalBaseUrl, apiKey, _isLocal); + _socketClient = new SocketClient(finalBaseUrl, apiKey, _isLocal); + } + + /// + /// Create and initialize a new RunAgentClient + /// + public static async Task CreateAsync(RunAgentClientConfig config) + { + var client = new RunAgentClient(config); + await client.InitializeAsync(); + return client; + } + + /// + /// Create a client from environment variables + /// + public static async Task CreateFromEnvironmentAsync( + string agentId, + string entrypointTag + ) + { + var config = ConfigLoader.FromEnvironment(agentId, entrypointTag); + return await CreateAsync(config); + } + + /// + /// Initialize client by fetching agent architecture and validating entrypoint + /// + private async Task InitializeAsync() + { + try + { + _architecture = await _restClient.GetAgentArchitecture(_agentId); + + if (_architecture?.Entrypoints == null || _architecture.Entrypoints.Count == 0) + { + throw new ValidationError( + "ARCHITECTURE_MISSING: Agent has no entrypoints defined. " + + "Please redeploy the agent with proper entrypoint configuration." + ); + } + + // Find the requested entrypoint + _selectedEntrypoint = _architecture.Entrypoints + .FirstOrDefault(ep => ep.Tag == _entrypointTag); + + if (_selectedEntrypoint == null) + { + var availableTags = string.Join(", ", _architecture.Entrypoints.Select(ep => ep.Tag)); + throw new ValidationError( + $"Entrypoint '{_entrypointTag}' not found. " + + $"Available entrypoints: {availableTags}" + ); + } + } + catch (Exception ex) when (ex is not RunAgentError) + { + throw new ConnectionError( + $"Failed to initialize RunAgent client: {ex.Message}", + ex + ); + } + } + + /// + /// Execute agent synchronously (non-streaming) + /// + public async Task RunAsync(Dictionary? kwargs = null) + { + ValidateNonStreamEntrypoint(); + + return await _restClient.RunAgent( + _agentId, + _entrypointTag, + inputKwargs: kwargs, + userId: _userId, + persistentMemory: _persistentMemory + ); + } + + /// + /// Execute agent synchronously with positional and keyword arguments + /// + public async Task RunAsync( + List? args = null, + Dictionary? kwargs = null + ) + { + ValidateNonStreamEntrypoint(); + + return await _restClient.RunAgent( + _agentId, + _entrypointTag, + inputArgs: args, + inputKwargs: kwargs, + userId: _userId, + persistentMemory: _persistentMemory + ); + } + + /// + /// Execute agent with streaming (yields results incrementally) + /// + public IAsyncEnumerable RunStreamAsync(Dictionary? kwargs = null) + { + ValidateStreamEntrypoint(); + + return _socketClient.RunStream( + _agentId, + _entrypointTag, + inputKwargs: kwargs, + userId: _userId, + persistentMemory: _persistentMemory + ); + } + + /// + /// Execute agent with streaming and positional/keyword arguments + /// + public IAsyncEnumerable RunStreamAsync( + List? args = null, + Dictionary? kwargs = null + ) + { + ValidateStreamEntrypoint(); + + return _socketClient.RunStream( + _agentId, + _entrypointTag, + inputArgs: args, + inputKwargs: kwargs, + userId: _userId, + persistentMemory: _persistentMemory + ); + } + + /// + /// Get agent architecture + /// + public AgentArchitecture? GetAgentArchitecture() => _architecture; + + /// + /// Health check for agent availability + /// + public async Task HealthCheckAsync() => await _restClient.HealthCheck(); + + /// + /// Get agent ID + /// + public string GetAgentId() => _agentId; + + /// + /// Get entrypoint tag + /// + public string GetEntrypointTag() => _entrypointTag; + + /// + /// Check if running in local mode + /// + public bool IsLocal() => _isLocal; + + /// + /// Get user ID for persistent memory + /// + public string? GetUserId() => _userId; + + /// + /// Check if persistent memory is enabled + /// + public bool IsPersistentMemoryEnabled() => _persistentMemory; + + /// + /// Get extra parameters + /// + public Dictionary? GetExtraParams() => _extraParams; + + /// + /// Validate that current entrypoint is NOT a streaming entrypoint + /// + private void ValidateNonStreamEntrypoint() + { + if (_entrypointTag.EndsWith("_stream")) + { + throw new ValidationError( + $"STREAM_ENTRYPOINT: Entrypoint '{_entrypointTag}' is a streaming entrypoint. " + + "Use RunStreamAsync() instead of RunAsync() for streaming entrypoints." + ); + } + } + + /// + /// Validate that current entrypoint IS a streaming entrypoint + /// + private void ValidateStreamEntrypoint() + { + if (!_entrypointTag.EndsWith("_stream")) + { + throw new ValidationError( + $"NON_STREAM_ENTRYPOINT: Entrypoint '{_entrypointTag}' is not a streaming entrypoint. " + + "Use RunAsync() instead of RunStreamAsync() for non-streaming entrypoints." + ); + } + } + + public void Dispose() + { + _restClient?.Dispose(); + _socketClient?.Dispose(); + } +} diff --git a/runagent-csharp/src/Client/SocketClient.cs b/runagent-csharp/src/Client/SocketClient.cs new file mode 100644 index 0000000..4d38a01 --- /dev/null +++ b/runagent-csharp/src/Client/SocketClient.cs @@ -0,0 +1,272 @@ +using System.Net.WebSockets; +using System.Text; +using System.Text.Json; +using RunAgent.Errors; +using RunAgent.Types; +using RunAgent.Utils; + +namespace RunAgent.Client; + +/// +/// WebSocket client for streaming RunAgent responses +/// +public class SocketClient : IDisposable +{ + private readonly string _baseUrl; + private readonly string? _apiKey; + private readonly bool _isLocal; + private ClientWebSocket? _webSocket; + + public SocketClient(string baseUrl, string? apiKey, bool isLocal) + { + _baseUrl = baseUrl; + _apiKey = apiKey; + _isLocal = isLocal; + } + + /// + /// Stream agent execution results via WebSocket + /// + public async IAsyncEnumerable RunStream( + string agentId, + string entrypointTag, + List? inputArgs = null, + Dictionary? inputKwargs = null, + int timeoutSeconds = Constants.DefaultStreamTimeoutSeconds, + string? userId = null, + bool persistentMemory = false + ) + { + // Convert HTTP URL to WebSocket URL + var wsBaseUrl = _baseUrl + .Replace("https://", "wss://") + .Replace("http://", "ws://"); + + var uri = _isLocal + ? $"{wsBaseUrl}{Constants.ApiPrefix}/agents/{agentId}/run-stream" + : $"{wsBaseUrl}{Constants.ApiPrefix}/agents/{agentId}/run-stream?token={_apiKey}"; + + _webSocket = new ClientWebSocket(); + + // Connect to WebSocket + try + { + await _webSocket.ConnectAsync(new Uri(uri), CancellationToken.None); + } + catch (WebSocketException ex) + { + throw new ConnectionError($"WebSocket connection failed: {ex.Message}", ex); + } + + // Send initial request payload + var payload = new Dictionary + { + ["entrypoint_tag"] = entrypointTag, + ["input_args"] = inputArgs ?? new List(), + ["input_kwargs"] = inputKwargs ?? new Dictionary(), + ["timeout_seconds"] = timeoutSeconds, + ["async_execution"] = false + }; + + // Add persistent memory parameters if provided + if (!string.IsNullOrEmpty(userId)) + { + payload["user_id"] = userId; + } + if (persistentMemory) + { + payload["persistent_memory"] = persistentMemory; + } + + var requestJson = JsonSerializer.Serialize(payload); + var requestBytes = Encoding.UTF8.GetBytes(requestJson); + await _webSocket.SendAsync( + new ArraySegment(requestBytes), + WebSocketMessageType.Text, + true, + CancellationToken.None + ); + + // Receive and yield messages (no try-catch around yield) + var buffer = new byte[4096]; + var messageBuilder = new StringBuilder(); + + try + { + while (_webSocket.State == WebSocketState.Open) + { + var result = await _webSocket.ReceiveAsync( + new ArraySegment(buffer), + CancellationToken.None + ); + + if (result.MessageType == WebSocketMessageType.Close) + { + await _webSocket.CloseAsync( + WebSocketCloseStatus.NormalClosure, + string.Empty, + CancellationToken.None + ); + break; + } + + var chunk = Encoding.UTF8.GetString(buffer, 0, result.Count); + messageBuilder.Append(chunk); + + if (result.EndOfMessage) + { + var message = messageBuilder.ToString(); + messageBuilder.Clear(); + + // Parse WebSocket message + var content = ParseWebSocketMessage(message); + if (content != null) + { + yield return content; + } + + // Check if stream completed + if (IsStreamCompleted(message)) + { + break; + } + } + } + } + finally + { + if (_webSocket?.State == WebSocketState.Open) + { + await _webSocket.CloseAsync( + WebSocketCloseStatus.NormalClosure, + string.Empty, + CancellationToken.None + ); + } + _webSocket?.Dispose(); + _webSocket = null; + } + } + + /// + /// Parse WebSocket message and extract content + /// + private string? ParseWebSocketMessage(string message) + { + try + { + using var doc = JsonDocument.Parse(message); + var root = doc.RootElement; + + // Check message type + if (!root.TryGetProperty("type", out var typeElement)) + { + return message; // Return raw message if no type field + } + + var type = typeElement.GetString(); + + switch (type) + { + case "error": + // Handle error messages + if (root.TryGetProperty("code", out var code) && + root.TryGetProperty("message", out var errorMsg)) + { + var suggestion = root.TryGetProperty("suggestion", out var sugg) + ? sugg.GetString() + : null; + var details = root.TryGetProperty("details", out var det) + ? det.GetString() + : null; + + throw new RunAgentExecutionError( + code.GetString() ?? "UNKNOWN_ERROR", + errorMsg.GetString() ?? "Unknown error occurred", + suggestion, + details + ); + } + throw new RunAgentError(root.TryGetProperty("message", out var msg) + ? msg.GetString() ?? "Unknown error" + : "Unknown error"); + + case "status": + // Status messages are informational, don't yield them + return null; + + case "data": + // Extract and return data content + if (root.TryGetProperty("content", out var content)) + { + // Try to deserialize as structured data + if (content.ValueKind == JsonValueKind.String) + { + return content.GetString(); + } + else + { + return JsonSerializer.Serialize(content); + } + } + return null; + + default: + return message; + } + } + catch (JsonException) + { + // If parsing fails, return raw message + return message; + } + } + + /// + /// Check if stream has completed + /// + private bool IsStreamCompleted(string message) + { + try + { + using var doc = JsonDocument.Parse(message); + var root = doc.RootElement; + + if (root.TryGetProperty("type", out var type) && + type.GetString() == "status" && + root.TryGetProperty("status", out var status)) + { + return status.GetString() == "stream_completed"; + } + } + catch (JsonException) + { + // Ignore parse errors + } + + return false; + } + + public void Dispose() + { + if (_webSocket != null) + { + if (_webSocket.State == WebSocketState.Open) + { + try + { + _webSocket.CloseAsync( + WebSocketCloseStatus.NormalClosure, + string.Empty, + CancellationToken.None + ).Wait(TimeSpan.FromSeconds(5)); + } + catch + { + // Ignore close errors + } + } + _webSocket.Dispose(); + } + } +} diff --git a/runagent-csharp/src/Errors/RunAgentError.cs b/runagent-csharp/src/Errors/RunAgentError.cs new file mode 100644 index 0000000..b68cc85 --- /dev/null +++ b/runagent-csharp/src/Errors/RunAgentError.cs @@ -0,0 +1,92 @@ +namespace RunAgent.Errors; + +/// +/// Base exception class for all RunAgent errors +/// +public class RunAgentError : Exception +{ + public RunAgentError(string message) : base(message) { } + public RunAgentError(string message, Exception innerException) : base(message, innerException) { } +} + +/// +/// Authentication error (401, 403) - Missing or invalid API key +/// +public class AuthenticationError : RunAgentError +{ + public AuthenticationError(string message) : base(message) { } +} + +/// +/// Permission error (403) - Access denied +/// +public class PermissionError : RunAgentError +{ + public PermissionError(string message) : base(message) { } +} + +/// +/// Connection error - Network issues, DNS, TLS, timeouts +/// +public class ConnectionError : RunAgentError +{ + public ConnectionError(string message) : base(message) { } + public ConnectionError(string message, Exception innerException) : base(message, innerException) { } +} + +/// +/// Validation error (400, 422) - Bad config, missing agent, invalid entrypoint +/// +public class ValidationError : RunAgentError +{ + public ValidationError(string message) : base(message) { } +} + +/// +/// Server error (5xx) - Backend failures +/// +public class ServerError : RunAgentError +{ + public ServerError(string message) : base(message) { } +} + +/// +/// Unknown error - Unclassified errors +/// +public class UnknownError : RunAgentError +{ + public UnknownError(string message) : base(message) { } + public UnknownError(string message, Exception innerException) : base(message, innerException) { } +} + +/// +/// Structured execution error with code, message, suggestion, and details +/// +public class RunAgentExecutionError : RunAgentError +{ + public string Code { get; } + public string? Suggestion { get; } + public string? Details { get; } + + public RunAgentExecutionError( + string code, + string message, + string? suggestion = null, + string? details = null + ) : base(message) + { + Code = code; + Suggestion = suggestion; + Details = details; + } + + public override string ToString() + { + var msg = $"[{Code}] {Message}"; + if (!string.IsNullOrEmpty(Suggestion)) + msg += $"\nSuggestion: {Suggestion}"; + if (!string.IsNullOrEmpty(Details)) + msg += $"\nDetails: {Details}"; + return msg; + } +} diff --git a/runagent-csharp/src/Types/Config.cs b/runagent-csharp/src/Types/Config.cs new file mode 100644 index 0000000..a846327 --- /dev/null +++ b/runagent-csharp/src/Types/Config.cs @@ -0,0 +1,222 @@ +using System.Text.Json.Serialization; + +namespace RunAgent.Types; + +/// +/// Configuration for RunAgent client +/// +public class RunAgentClientConfig +{ + /// + /// Agent identifier (required) + /// + [JsonPropertyName("agent_id")] + public string AgentId { get; set; } + + /// + /// Entrypoint tag to invoke (required) + /// + [JsonPropertyName("entrypoint_tag")] + public string EntrypointTag { get; set; } + + /// + /// Enable local mode for co-located agents (default: false) + /// + [JsonPropertyName("local")] + public bool Local { get; set; } = false; + + /// + /// Host for local agent (optional, overrides auto-discovery) + /// + [JsonPropertyName("host")] + public string? Host { get; set; } + + /// + /// Port for local agent (optional, overrides auto-discovery) + /// + [JsonPropertyName("port")] + public int? Port { get; set; } + + /// + /// API key for remote authentication (optional, overrides environment) + /// + [JsonPropertyName("api_key")] + public string? ApiKey { get; set; } + + /// + /// Base URL for remote deployments (optional, overrides environment) + /// + [JsonPropertyName("base_url")] + public string? BaseUrl { get; set; } + + /// + /// User identifier for persistent memory isolation (optional) + /// + [JsonPropertyName("user_id")] + public string? UserId { get; set; } + + /// + /// Enable persistent memory across executions (default: false) + /// + [JsonPropertyName("persistent_memory")] + public bool PersistentMemory { get; set; } = false; + + /// + /// Extra parameters for future metadata use (optional) + /// + [JsonPropertyName("extra_params")] + public Dictionary? ExtraParams { get; set; } + + public RunAgentClientConfig(string agentId, string entrypointTag) + { + AgentId = agentId ?? throw new ArgumentNullException(nameof(agentId)); + EntrypointTag = entrypointTag ?? throw new ArgumentNullException(nameof(entrypointTag)); + } + + /// + /// Factory method for fluent configuration + /// + public static RunAgentClientConfig Create(string agentId, string entrypointTag) + { + return new RunAgentClientConfig(agentId, entrypointTag); + } + + /// + /// Set local mode + /// + public RunAgentClientConfig WithLocal(bool local) + { + Local = local; + return this; + } + + /// + /// Set host and port for local agent + /// + public RunAgentClientConfig WithHostAndPort(string host, int port) + { + Host = host; + Port = port; + return this; + } + + /// + /// Set API key for remote authentication + /// + public RunAgentClientConfig WithApiKey(string apiKey) + { + ApiKey = apiKey; + return this; + } + + /// + /// Set base URL for remote deployments + /// + public RunAgentClientConfig WithBaseUrl(string baseUrl) + { + BaseUrl = baseUrl; + return this; + } + + /// + /// Set user ID for persistent memory isolation + /// + public RunAgentClientConfig WithUserId(string userId) + { + UserId = userId; + return this; + } + + /// + /// Enable persistent memory + /// + public RunAgentClientConfig WithPersistentMemory(bool persistentMemory) + { + PersistentMemory = persistentMemory; + return this; + } + + /// + /// Set extra parameters + /// + public RunAgentClientConfig WithExtraParams(Dictionary extraParams) + { + ExtraParams = extraParams; + return this; + } +} + +/// +/// Agent architecture definition +/// +public class AgentArchitecture +{ + [JsonPropertyName("agent_id")] + public string? AgentId { get; set; } + + [JsonPropertyName("entrypoints")] + public List? Entrypoints { get; set; } +} + +/// +/// Entrypoint definition for agent functions +/// +public class EntryPoint +{ + [JsonPropertyName("tag")] + public string Tag { get; set; } = string.Empty; + + [JsonPropertyName("file")] + public string? File { get; set; } + + [JsonPropertyName("module")] + public string? Module { get; set; } + + [JsonPropertyName("extractor")] + public object? Extractor { get; set; } + + [JsonPropertyName("description")] + public string? Description { get; set; } +} + +/// +/// API response envelope +/// +public class ApiResponse +{ + [JsonPropertyName("success")] + public bool Success { get; set; } + + [JsonPropertyName("data")] + public T? Data { get; set; } + + [JsonPropertyName("message")] + public string? Message { get; set; } + + [JsonPropertyName("error")] + public ErrorInfo? Error { get; set; } + + [JsonPropertyName("timestamp")] + public string? Timestamp { get; set; } + + [JsonPropertyName("request_id")] + public string? RequestId { get; set; } +} + +/// +/// Error information in API responses +/// +public class ErrorInfo +{ + [JsonPropertyName("code")] + public string Code { get; set; } = string.Empty; + + [JsonPropertyName("message")] + public string Message { get; set; } = string.Empty; + + [JsonPropertyName("suggestion")] + public string? Suggestion { get; set; } + + [JsonPropertyName("details")] + public string? Details { get; set; } +} diff --git a/runagent-csharp/src/Utils/ConfigLoader.cs b/runagent-csharp/src/Utils/ConfigLoader.cs new file mode 100644 index 0000000..f29bc12 --- /dev/null +++ b/runagent-csharp/src/Utils/ConfigLoader.cs @@ -0,0 +1,83 @@ +using RunAgent.Types; + +namespace RunAgent.Utils; + +/// +/// Utility for loading and resolving RunAgent configuration +/// Configuration precedence: Constructor args > Environment variables > Defaults +/// +public static class ConfigLoader +{ + /// + /// Resolve API key from config or environment + /// + public static string? ResolveApiKey(string? configApiKey) + { + return configApiKey ?? Environment.GetEnvironmentVariable(Constants.EnvApiKey); + } + + /// + /// Resolve base URL from config or environment + /// + public static string ResolveBaseUrl(string? configBaseUrl) + { + return configBaseUrl + ?? Environment.GetEnvironmentVariable(Constants.EnvBaseUrl) + ?? Constants.DefaultBaseUrl; + } + + /// + /// Resolve host for local agent + /// + public static string ResolveHost(string? configHost) + { + return configHost ?? Constants.DefaultLocalHost; + } + + /// + /// Resolve port for local agent + /// + public static int ResolvePort(int? configPort) + { + return configPort ?? Constants.DefaultLocalPort; + } + + /// + /// Create a RunAgentClientConfig from environment variables + /// + public static RunAgentClientConfig FromEnvironment(string agentId, string entrypointTag) + { + var config = new RunAgentClientConfig(agentId, entrypointTag) + { + ApiKey = Environment.GetEnvironmentVariable(Constants.EnvApiKey), + BaseUrl = Environment.GetEnvironmentVariable(Constants.EnvBaseUrl) + }; + return config; + } + + /// + /// Expand tilde in path (Unix-style home directory) + /// + public static string ExpandPath(string path) + { + if (string.IsNullOrEmpty(path)) + return path; + + if (path.StartsWith("~/") || path == "~") + { + var home = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile); + return path.Replace("~", home); + } + + return path; + } + + /// + /// Get local database path + /// + public static string GetLocalDatabasePath() + { + var cacheDir = ExpandPath(Constants.LocalCacheDirectory); + return Path.Combine(cacheDir, Constants.DatabaseFileName); + } +} diff --git a/runagent-csharp/src/Utils/Constants.cs b/runagent-csharp/src/Utils/Constants.cs new file mode 100644 index 0000000..f3987b8 --- /dev/null +++ b/runagent-csharp/src/Utils/Constants.cs @@ -0,0 +1,57 @@ +namespace RunAgent.Utils; + +/// +/// SDK constants for RunAgent client configuration and defaults +/// +public static class Constants +{ + /// + /// Default base URL for remote RunAgent deployments + /// + public const string DefaultBaseUrl = "https://backend.run-agent.ai"; + + /// + /// API version prefix + /// + public const string ApiPrefix = "/api/v1"; + + /// + /// Default local host for agent communication + /// + public const string DefaultLocalHost = "127.0.0.1"; + + /// + /// Default local port for agent communication + /// + public const int DefaultLocalPort = 8450; + + /// + /// Default timeout for non-streaming requests (seconds) + /// + public const int DefaultTimeoutSeconds = 300; + + /// + /// Default timeout for streaming requests (seconds) + /// + public const int DefaultStreamTimeoutSeconds = 600; + + /// + /// Environment variable name for API key + /// + public const string EnvApiKey = "RUNAGENT_API_KEY"; + + /// + /// Environment variable name for base URL + /// + public const string EnvBaseUrl = "RUNAGENT_BASE_URL"; + + /// + /// Local cache directory path + /// + public const string LocalCacheDirectory = "~/.runagent"; + + /// + /// Database file name for local agent discovery + /// + public const string DatabaseFileName = "runagent_local.db"; +} diff --git a/runagent/utils/enums/framework.py b/runagent/utils/enums/framework.py index ba31fa3..6008615 100644 --- a/runagent/utils/enums/framework.py +++ b/runagent/utils/enums/framework.py @@ -15,13 +15,14 @@ class Framework(Enum): LLAMAINDEX = "llamaindex" OPENAI = "openai" N8N = "n8n" + PARLANT = "parlant" @classmethod def _pythonic_frameworks_cache(cls) -> t.FrozenSet['Framework']: return frozenset({ cls.AG2, cls.AGNO, cls.AUTOGEN, cls.CREWAI, cls.LANGCHAIN, cls.LANGGRAPH, cls.LETTA, - cls.LLAMAINDEX, cls.OPENAI + cls.LLAMAINDEX, cls.OPENAI, cls.PARLANT }) @classmethod diff --git a/test_scripts/csharp/test_agno/Program.cs b/test_scripts/csharp/test_agno/Program.cs new file mode 100644 index 0000000..325604f --- /dev/null +++ b/test_scripts/csharp/test_agno/Program.cs @@ -0,0 +1,92 @@ +// Async version non-streaming +using RunAgent.Client; +using RunAgent.Types; +using RunAgent.Errors; + +class Program +{ + static async Task Main(string[] args) + { + try + { + var config = RunAgentClientConfig.Create( + agentId: "ae29bd73-b3d3-99c8-a98f-5d7aec7ee911", + entrypointTag: "agno_print_response" + ); + config.WithLocal(true); + + var client = await RunAgentClient.CreateAsync(config); + + var response = await client.RunAsync(new Dictionary + { + ["prompt"] = "which is better toyota or land rover" + }); + + Console.WriteLine($"Response: {response}"); + } + catch (RunAgentError ex) + { + Console.WriteLine($"Error: {ex.Message}"); + if (ex is RunAgentExecutionError execError && execError.Suggestion != null) + { + Console.WriteLine($"Suggestion: {execError.Suggestion}"); + } + Environment.Exit(1); + } + catch (Exception ex) + { + Console.WriteLine($"Unexpected error: {ex.Message}"); + Environment.Exit(1); + } + } +} + +// ******************************Streaming Part with agno**************************************** +// Async version streaming (C# idiomatic approach) + +// using RunAgent.Client; +// using RunAgent.Types; +// using RunAgent.Errors; + +// class Program +// { +// static async Task Main(string[] args) +// { +// try +// { +// var config = RunAgentClientConfig.Create( +// agentId: "ae29bd73-b3d3-99c8-a98f-5d7aec7ee911", +// entrypointTag: "agno_print_response_stream" +// ); +// config.WithLocal(true); +// var client = await RunAgentClient.CreateAsync(config); + +// // Real streaming - processes chunks as they arrive (idiomatic C#/.NET) +// // This is the recommended approach for .NET developers +// await foreach (var chunk in client.RunStreamAsync(new Dictionary +// { +// ["prompt"] = "tell me a short story about scotland" +// })) +// { +// Console.WriteLine($"Response: {chunk}"); +// } + +// // Cleanup +// client.Dispose(); +// } +// catch (RunAgentError ex) +// { +// Console.WriteLine($"Error: {ex.Message}"); +// if (ex is RunAgentExecutionError execError && execError.Suggestion != null) +// { +// Console.WriteLine($"Suggestion: {execError.Suggestion}"); +// } +// Environment.Exit(1); +// } +// catch (Exception ex) +// { +// Console.WriteLine($"Unexpected error: {ex.Message}"); +// Environment.Exit(1); +// } +// } +// } diff --git a/test_scripts/csharp/test_agno/README.md b/test_scripts/csharp/test_agno/README.md new file mode 100644 index 0000000..8d8f07c --- /dev/null +++ b/test_scripts/csharp/test_agno/README.md @@ -0,0 +1,145 @@ +# RunAgent C# SDK Test - Agno Agent + +This test script demonstrates the RunAgent C# SDK with a deployed Agno agent. + +## Test Agent + +- **Agent ID**: `ae29bd73-b3d3-42c8-a98f-5d7aec7ee919` +- **Entrypoints**: + - `agno_print_response` - Non-streaming response + - `agno_print_response_stream` - Streaming response + +## Prerequisites + +1. .NET 8.0 or higher installed +2. RunAgent API key configured (set `RUNAGENT_API_KEY` environment variable) + +## Setup + +### Option 1: Using Local SDK Reference + +The project is already configured to reference the local RunAgent SDK: + +```bash +cd /home/dev/radeen/runagent/test_scripts/csharp/test_agno +dotnet restore +``` + +### Option 2: Using NuGet Package + +Modify `test_agno.csproj` to use the published NuGet package: + +```xml + + + +``` + +## Running the Tests + +### Set API Key + +```bash +export RUNAGENT_API_KEY=your-api-key-here +``` + +### Run the Test + +```bash +dotnet run +``` + +## Test Versions + +The `Program.cs` file includes both versions (commented and active): + +### Non-Streaming Version (Commented) + +Tests synchronous execution with `agno_print_response` entrypoint: + +```csharp +var config = RunAgentClientConfig.Create( + agentId: "ae29bd73-b3d3-42c8-a98f-5d7aec7ee919", + entrypointTag: "agno_print_response" +); + +var client = await RunAgentClient.CreateAsync(config); + +var response = await client.RunAsync(new Dictionary +{ + ["prompt"] = "which is better toyota or land rover" +}); + +Console.WriteLine($"Response: {response}"); +``` + +### Streaming Version (Active) + +Tests real-time streaming with `agno_print_response_stream` entrypoint: + +```csharp +var config = RunAgentClientConfig.Create( + agentId: "ae29bd73-b3d3-42c8-a98f-5d7aec7ee919", + entrypointTag: "agno_print_response_stream" +); + +var client = await RunAgentClient.CreateAsync(config); + +await foreach (var chunk in client.RunStreamAsync(new Dictionary +{ + ["prompt"] = "tell me a short story about scotland" +})) +{ + Console.WriteLine($"Response: {chunk}"); +} +``` + +## Switching Between Versions + +To test the non-streaming version: + +1. Comment out the streaming version (lines 42-77) +2. Uncomment the non-streaming version (lines 1-39) +3. Run with `dotnet run` + +## Expected Output + +### Non-Streaming +``` +Response: [JSON response from agent] +``` + +### Streaming +``` +Response: [chunk 1] +Response: [chunk 2] +Response: [chunk 3] +... +``` + +## Troubleshooting + +### "Authentication failed" error + +Set the `RUNAGENT_API_KEY` environment variable: +```bash +export RUNAGENT_API_KEY=your-api-key-here +``` + +### "Entrypoint not found" error + +Verify the agent is deployed and the entrypoint tag is correct. + +### Build errors + +Ensure .NET SDK 6.0 or higher is installed: +```bash +dotnet --version +``` + +## Related Test Scripts + +- `../dart/test_agno/` - Dart version of this test +- `../rust/test_agno/` - Rust version of this test +- `../js/test_agno/` - JavaScript version of this test +- `../python/test_agno/` - Python version of this test diff --git a/test_scripts/csharp/test_agno/bin/Debug/net8.0/RunAgent.dll b/test_scripts/csharp/test_agno/bin/Debug/net8.0/RunAgent.dll new file mode 100644 index 0000000..2257fe6 Binary files /dev/null and b/test_scripts/csharp/test_agno/bin/Debug/net8.0/RunAgent.dll differ diff --git a/test_scripts/csharp/test_agno/bin/Debug/net8.0/RunAgent.pdb b/test_scripts/csharp/test_agno/bin/Debug/net8.0/RunAgent.pdb new file mode 100644 index 0000000..d40b09b Binary files /dev/null and b/test_scripts/csharp/test_agno/bin/Debug/net8.0/RunAgent.pdb differ diff --git a/test_scripts/csharp/test_agno/bin/Debug/net8.0/System.IO.Pipelines.dll b/test_scripts/csharp/test_agno/bin/Debug/net8.0/System.IO.Pipelines.dll new file mode 100755 index 0000000..712f47d Binary files /dev/null and b/test_scripts/csharp/test_agno/bin/Debug/net8.0/System.IO.Pipelines.dll differ diff --git a/test_scripts/csharp/test_agno/bin/Debug/net8.0/System.Text.Encodings.Web.dll b/test_scripts/csharp/test_agno/bin/Debug/net8.0/System.Text.Encodings.Web.dll new file mode 100755 index 0000000..5c04169 Binary files /dev/null and b/test_scripts/csharp/test_agno/bin/Debug/net8.0/System.Text.Encodings.Web.dll differ diff --git a/test_scripts/csharp/test_agno/bin/Debug/net8.0/System.Text.Json.dll b/test_scripts/csharp/test_agno/bin/Debug/net8.0/System.Text.Json.dll new file mode 100755 index 0000000..f4dd021 Binary files /dev/null and b/test_scripts/csharp/test_agno/bin/Debug/net8.0/System.Text.Json.dll differ diff --git a/test_scripts/csharp/test_agno/bin/Debug/net8.0/runtimes/browser/lib/net8.0/System.Text.Encodings.Web.dll b/test_scripts/csharp/test_agno/bin/Debug/net8.0/runtimes/browser/lib/net8.0/System.Text.Encodings.Web.dll new file mode 100755 index 0000000..38c9af4 Binary files /dev/null and b/test_scripts/csharp/test_agno/bin/Debug/net8.0/runtimes/browser/lib/net8.0/System.Text.Encodings.Web.dll differ diff --git a/test_scripts/csharp/test_agno/bin/Debug/net8.0/test_agno b/test_scripts/csharp/test_agno/bin/Debug/net8.0/test_agno new file mode 100755 index 0000000..0cf0c74 Binary files /dev/null and b/test_scripts/csharp/test_agno/bin/Debug/net8.0/test_agno differ diff --git a/test_scripts/csharp/test_agno/bin/Debug/net8.0/test_agno.deps.json b/test_scripts/csharp/test_agno/bin/Debug/net8.0/test_agno.deps.json new file mode 100644 index 0000000..620cace --- /dev/null +++ b/test_scripts/csharp/test_agno/bin/Debug/net8.0/test_agno.deps.json @@ -0,0 +1,96 @@ +{ + "runtimeTarget": { + "name": ".NETCoreApp,Version=v8.0", + "signature": "" + }, + "compilationOptions": {}, + "targets": { + ".NETCoreApp,Version=v8.0": { + "test_agno/1.0.0": { + "dependencies": { + "RunAgent": "0.1.47" + }, + "runtime": { + "test_agno.dll": {} + } + }, + "System.IO.Pipelines/9.0.0": { + "runtime": { + "lib/net8.0/System.IO.Pipelines.dll": { + "assemblyVersion": "9.0.0.0", + "fileVersion": "9.0.24.52809" + } + } + }, + "System.Text.Encodings.Web/9.0.0": { + "runtime": { + "lib/net8.0/System.Text.Encodings.Web.dll": { + "assemblyVersion": "9.0.0.0", + "fileVersion": "9.0.24.52809" + } + }, + "runtimeTargets": { + "runtimes/browser/lib/net8.0/System.Text.Encodings.Web.dll": { + "rid": "browser", + "assetType": "runtime", + "assemblyVersion": "9.0.0.0", + "fileVersion": "9.0.24.52809" + } + } + }, + "System.Text.Json/9.0.0": { + "dependencies": { + "System.IO.Pipelines": "9.0.0", + "System.Text.Encodings.Web": "9.0.0" + }, + "runtime": { + "lib/net8.0/System.Text.Json.dll": { + "assemblyVersion": "9.0.0.0", + "fileVersion": "9.0.24.52809" + } + } + }, + "RunAgent/0.1.47": { + "dependencies": { + "System.Text.Json": "9.0.0" + }, + "runtime": { + "RunAgent.dll": {} + } + } + } + }, + "libraries": { + "test_agno/1.0.0": { + "type": "project", + "serviceable": false, + "sha512": "" + }, + "System.IO.Pipelines/9.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-eA3cinogwaNB4jdjQHOP3Z3EuyiDII7MT35jgtnsA4vkn0LUrrSHsU0nzHTzFzmaFYeKV7MYyMxOocFzsBHpTw==", + "path": "system.io.pipelines/9.0.0", + "hashPath": "system.io.pipelines.9.0.0.nupkg.sha512" + }, + "System.Text.Encodings.Web/9.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-e2hMgAErLbKyUUwt18qSBf9T5Y+SFAL3ZedM8fLupkVj8Rj2PZ9oxQ37XX2LF8fTO1wNIxvKpihD7Of7D/NxZw==", + "path": "system.text.encodings.web/9.0.0", + "hashPath": "system.text.encodings.web.9.0.0.nupkg.sha512" + }, + "System.Text.Json/9.0.0": { + "type": "package", + "serviceable": true, + "sha512": "sha512-js7+qAu/9mQvnhA4EfGMZNEzXtJCDxgkgj8ohuxq/Qxv+R56G+ljefhiJHOxTNiw54q8vmABCWUwkMulNdlZ4A==", + "path": "system.text.json/9.0.0", + "hashPath": "system.text.json.9.0.0.nupkg.sha512" + }, + "RunAgent/0.1.47": { + "type": "project", + "serviceable": false, + "sha512": "" + } + } +} \ No newline at end of file diff --git a/test_scripts/csharp/test_agno/bin/Debug/net8.0/test_agno.dll b/test_scripts/csharp/test_agno/bin/Debug/net8.0/test_agno.dll new file mode 100644 index 0000000..15ac19e Binary files /dev/null and b/test_scripts/csharp/test_agno/bin/Debug/net8.0/test_agno.dll differ diff --git a/test_scripts/csharp/test_agno/bin/Debug/net8.0/test_agno.pdb b/test_scripts/csharp/test_agno/bin/Debug/net8.0/test_agno.pdb new file mode 100644 index 0000000..15d10a2 Binary files /dev/null and b/test_scripts/csharp/test_agno/bin/Debug/net8.0/test_agno.pdb differ diff --git a/test_scripts/csharp/test_agno/bin/Debug/net8.0/test_agno.runtimeconfig.json b/test_scripts/csharp/test_agno/bin/Debug/net8.0/test_agno.runtimeconfig.json new file mode 100644 index 0000000..becfaea --- /dev/null +++ b/test_scripts/csharp/test_agno/bin/Debug/net8.0/test_agno.runtimeconfig.json @@ -0,0 +1,12 @@ +{ + "runtimeOptions": { + "tfm": "net8.0", + "framework": { + "name": "Microsoft.NETCore.App", + "version": "8.0.0" + }, + "configProperties": { + "System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false + } + } +} \ No newline at end of file diff --git a/test_scripts/csharp/test_agno/obj/Debug/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs b/test_scripts/csharp/test_agno/obj/Debug/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs new file mode 100644 index 0000000..2217181 --- /dev/null +++ b/test_scripts/csharp/test_agno/obj/Debug/net8.0/.NETCoreApp,Version=v8.0.AssemblyAttributes.cs @@ -0,0 +1,4 @@ +// +using System; +using System.Reflection; +[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v8.0", FrameworkDisplayName = ".NET 8.0")] diff --git a/test_scripts/csharp/test_agno/obj/Debug/net8.0/apphost b/test_scripts/csharp/test_agno/obj/Debug/net8.0/apphost new file mode 100755 index 0000000..0cf0c74 Binary files /dev/null and b/test_scripts/csharp/test_agno/obj/Debug/net8.0/apphost differ diff --git a/test_scripts/csharp/test_agno/obj/Debug/net8.0/ref/test_agno.dll b/test_scripts/csharp/test_agno/obj/Debug/net8.0/ref/test_agno.dll new file mode 100644 index 0000000..427fcbb Binary files /dev/null and b/test_scripts/csharp/test_agno/obj/Debug/net8.0/ref/test_agno.dll differ diff --git a/test_scripts/csharp/test_agno/obj/Debug/net8.0/refint/test_agno.dll b/test_scripts/csharp/test_agno/obj/Debug/net8.0/refint/test_agno.dll new file mode 100644 index 0000000..427fcbb Binary files /dev/null and b/test_scripts/csharp/test_agno/obj/Debug/net8.0/refint/test_agno.dll differ diff --git a/test_scripts/csharp/test_agno/obj/Debug/net8.0/test_agno.AssemblyInfo.cs b/test_scripts/csharp/test_agno/obj/Debug/net8.0/test_agno.AssemblyInfo.cs new file mode 100644 index 0000000..5c0657b --- /dev/null +++ b/test_scripts/csharp/test_agno/obj/Debug/net8.0/test_agno.AssemblyInfo.cs @@ -0,0 +1,22 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Reflection; + +[assembly: System.Reflection.AssemblyCompanyAttribute("test_agno")] +[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] +[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+d10db76eaa0d81348bc1c1049c5a54057a21b0c4")] +[assembly: System.Reflection.AssemblyProductAttribute("test_agno")] +[assembly: System.Reflection.AssemblyTitleAttribute("test_agno")] +[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] + +// Generated by the MSBuild WriteCodeFragment class. + diff --git a/test_scripts/csharp/test_agno/obj/Debug/net8.0/test_agno.AssemblyInfoInputs.cache b/test_scripts/csharp/test_agno/obj/Debug/net8.0/test_agno.AssemblyInfoInputs.cache new file mode 100644 index 0000000..fdbb0d3 --- /dev/null +++ b/test_scripts/csharp/test_agno/obj/Debug/net8.0/test_agno.AssemblyInfoInputs.cache @@ -0,0 +1 @@ +7c7631ab35e08716c713bd0d840a7097c7e5bd29256b5fdceb2dbfe3e80a8269 diff --git a/test_scripts/csharp/test_agno/obj/Debug/net8.0/test_agno.GeneratedMSBuildEditorConfig.editorconfig b/test_scripts/csharp/test_agno/obj/Debug/net8.0/test_agno.GeneratedMSBuildEditorConfig.editorconfig new file mode 100644 index 0000000..fd7800c --- /dev/null +++ b/test_scripts/csharp/test_agno/obj/Debug/net8.0/test_agno.GeneratedMSBuildEditorConfig.editorconfig @@ -0,0 +1,13 @@ +is_global = true +build_property.TargetFramework = net8.0 +build_property.TargetPlatformMinVersion = +build_property.UsingMicrosoftNETSdkWeb = +build_property.ProjectTypeGuids = +build_property.InvariantGlobalization = +build_property.PlatformNeutralAssembly = +build_property.EnforceExtendedAnalyzerRules = +build_property._SupportedPlatformList = Linux,macOS,Windows +build_property.RootNamespace = test_agno +build_property.ProjectDir = /home/dev/radeen/runagent/test_scripts/csharp/test_agno/ +build_property.EnableComHosting = +build_property.EnableGeneratedComInterfaceComImportInterop = diff --git a/test_scripts/csharp/test_agno/obj/Debug/net8.0/test_agno.GlobalUsings.g.cs b/test_scripts/csharp/test_agno/obj/Debug/net8.0/test_agno.GlobalUsings.g.cs new file mode 100644 index 0000000..8578f3d --- /dev/null +++ b/test_scripts/csharp/test_agno/obj/Debug/net8.0/test_agno.GlobalUsings.g.cs @@ -0,0 +1,8 @@ +// +global using global::System; +global using global::System.Collections.Generic; +global using global::System.IO; +global using global::System.Linq; +global using global::System.Net.Http; +global using global::System.Threading; +global using global::System.Threading.Tasks; diff --git a/test_scripts/csharp/test_agno/obj/Debug/net8.0/test_agno.assets.cache b/test_scripts/csharp/test_agno/obj/Debug/net8.0/test_agno.assets.cache new file mode 100644 index 0000000..cc87841 Binary files /dev/null and b/test_scripts/csharp/test_agno/obj/Debug/net8.0/test_agno.assets.cache differ diff --git a/test_scripts/csharp/test_agno/obj/Debug/net8.0/test_agno.csproj.AssemblyReference.cache b/test_scripts/csharp/test_agno/obj/Debug/net8.0/test_agno.csproj.AssemblyReference.cache new file mode 100644 index 0000000..a991093 Binary files /dev/null and b/test_scripts/csharp/test_agno/obj/Debug/net8.0/test_agno.csproj.AssemblyReference.cache differ diff --git a/test_scripts/csharp/test_agno/obj/Debug/net8.0/test_agno.csproj.CopyComplete b/test_scripts/csharp/test_agno/obj/Debug/net8.0/test_agno.csproj.CopyComplete new file mode 100644 index 0000000..e69de29 diff --git a/test_scripts/csharp/test_agno/obj/Debug/net8.0/test_agno.csproj.CoreCompileInputs.cache b/test_scripts/csharp/test_agno/obj/Debug/net8.0/test_agno.csproj.CoreCompileInputs.cache new file mode 100644 index 0000000..839146e --- /dev/null +++ b/test_scripts/csharp/test_agno/obj/Debug/net8.0/test_agno.csproj.CoreCompileInputs.cache @@ -0,0 +1 @@ +4338dc339c9018962bb9c7d6eb0454a83c4f0d82653a621f524ca89349c44624 diff --git a/test_scripts/csharp/test_agno/obj/Debug/net8.0/test_agno.csproj.FileListAbsolute.txt b/test_scripts/csharp/test_agno/obj/Debug/net8.0/test_agno.csproj.FileListAbsolute.txt new file mode 100644 index 0000000..5d2e5dd --- /dev/null +++ b/test_scripts/csharp/test_agno/obj/Debug/net8.0/test_agno.csproj.FileListAbsolute.txt @@ -0,0 +1,23 @@ +/home/dev/radeen/runagent/test_scripts/csharp/test_agno/obj/Debug/net8.0/test_agno.csproj.AssemblyReference.cache +/home/dev/radeen/runagent/test_scripts/csharp/test_agno/obj/Debug/net8.0/test_agno.GeneratedMSBuildEditorConfig.editorconfig +/home/dev/radeen/runagent/test_scripts/csharp/test_agno/obj/Debug/net8.0/test_agno.AssemblyInfoInputs.cache +/home/dev/radeen/runagent/test_scripts/csharp/test_agno/obj/Debug/net8.0/test_agno.AssemblyInfo.cs +/home/dev/radeen/runagent/test_scripts/csharp/test_agno/obj/Debug/net8.0/test_agno.csproj.CoreCompileInputs.cache +/home/dev/radeen/runagent/test_scripts/csharp/test_agno/obj/Debug/net8.0/test_agno.sourcelink.json +/home/dev/radeen/runagent/test_scripts/csharp/test_agno/bin/Debug/net8.0/test_agno +/home/dev/radeen/runagent/test_scripts/csharp/test_agno/bin/Debug/net8.0/test_agno.deps.json +/home/dev/radeen/runagent/test_scripts/csharp/test_agno/bin/Debug/net8.0/test_agno.runtimeconfig.json +/home/dev/radeen/runagent/test_scripts/csharp/test_agno/bin/Debug/net8.0/test_agno.dll +/home/dev/radeen/runagent/test_scripts/csharp/test_agno/bin/Debug/net8.0/test_agno.pdb +/home/dev/radeen/runagent/test_scripts/csharp/test_agno/bin/Debug/net8.0/System.IO.Pipelines.dll +/home/dev/radeen/runagent/test_scripts/csharp/test_agno/bin/Debug/net8.0/System.Text.Encodings.Web.dll +/home/dev/radeen/runagent/test_scripts/csharp/test_agno/bin/Debug/net8.0/System.Text.Json.dll +/home/dev/radeen/runagent/test_scripts/csharp/test_agno/bin/Debug/net8.0/runtimes/browser/lib/net8.0/System.Text.Encodings.Web.dll +/home/dev/radeen/runagent/test_scripts/csharp/test_agno/bin/Debug/net8.0/RunAgent.dll +/home/dev/radeen/runagent/test_scripts/csharp/test_agno/bin/Debug/net8.0/RunAgent.pdb +/home/dev/radeen/runagent/test_scripts/csharp/test_agno/obj/Debug/net8.0/test_agno.dll +/home/dev/radeen/runagent/test_scripts/csharp/test_agno/obj/Debug/net8.0/refint/test_agno.dll +/home/dev/radeen/runagent/test_scripts/csharp/test_agno/obj/Debug/net8.0/test_agno.pdb +/home/dev/radeen/runagent/test_scripts/csharp/test_agno/obj/Debug/net8.0/test_agno.genruntimeconfig.cache +/home/dev/radeen/runagent/test_scripts/csharp/test_agno/obj/Debug/net8.0/ref/test_agno.dll +/home/dev/radeen/runagent/test_scripts/csharp/test_agno/obj/Debug/net8.0/test_agno.csproj.CopyComplete diff --git a/test_scripts/csharp/test_agno/obj/Debug/net8.0/test_agno.dll b/test_scripts/csharp/test_agno/obj/Debug/net8.0/test_agno.dll new file mode 100644 index 0000000..15ac19e Binary files /dev/null and b/test_scripts/csharp/test_agno/obj/Debug/net8.0/test_agno.dll differ diff --git a/test_scripts/csharp/test_agno/obj/Debug/net8.0/test_agno.genruntimeconfig.cache b/test_scripts/csharp/test_agno/obj/Debug/net8.0/test_agno.genruntimeconfig.cache new file mode 100644 index 0000000..2b82588 --- /dev/null +++ b/test_scripts/csharp/test_agno/obj/Debug/net8.0/test_agno.genruntimeconfig.cache @@ -0,0 +1 @@ +23f201fd1d70ddf09770e15d49c9bc6ab29af20b80ac99470ad40cd0bed156e3 diff --git a/test_scripts/csharp/test_agno/obj/Debug/net8.0/test_agno.pdb b/test_scripts/csharp/test_agno/obj/Debug/net8.0/test_agno.pdb new file mode 100644 index 0000000..15d10a2 Binary files /dev/null and b/test_scripts/csharp/test_agno/obj/Debug/net8.0/test_agno.pdb differ diff --git a/test_scripts/csharp/test_agno/obj/Debug/net8.0/test_agno.sourcelink.json b/test_scripts/csharp/test_agno/obj/Debug/net8.0/test_agno.sourcelink.json new file mode 100644 index 0000000..89cc795 --- /dev/null +++ b/test_scripts/csharp/test_agno/obj/Debug/net8.0/test_agno.sourcelink.json @@ -0,0 +1 @@ +{"documents":{"/home/dev/radeen/runagent/*":"https://raw.githubusercontent.com/runagent-dev/runagent/d10db76eaa0d81348bc1c1049c5a54057a21b0c4/*"}} \ No newline at end of file diff --git a/test_scripts/csharp/test_agno/obj/project.assets.json b/test_scripts/csharp/test_agno/obj/project.assets.json new file mode 100644 index 0000000..2e22cb0 --- /dev/null +++ b/test_scripts/csharp/test_agno/obj/project.assets.json @@ -0,0 +1,281 @@ +{ + "version": 3, + "targets": { + "net8.0": { + "System.IO.Pipelines/9.0.0": { + "type": "package", + "compile": { + "lib/net8.0/System.IO.Pipelines.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net8.0/System.IO.Pipelines.dll": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net8.0/_._": {} + } + }, + "System.Text.Encodings.Web/9.0.0": { + "type": "package", + "compile": { + "lib/net8.0/System.Text.Encodings.Web.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net8.0/System.Text.Encodings.Web.dll": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net8.0/_._": {} + }, + "runtimeTargets": { + "runtimes/browser/lib/net8.0/System.Text.Encodings.Web.dll": { + "assetType": "runtime", + "rid": "browser" + } + } + }, + "System.Text.Json/9.0.0": { + "type": "package", + "dependencies": { + "System.IO.Pipelines": "9.0.0", + "System.Text.Encodings.Web": "9.0.0" + }, + "compile": { + "lib/net8.0/System.Text.Json.dll": { + "related": ".xml" + } + }, + "runtime": { + "lib/net8.0/System.Text.Json.dll": { + "related": ".xml" + } + }, + "build": { + "buildTransitive/net8.0/System.Text.Json.targets": {} + } + }, + "RunAgent/0.1.47": { + "type": "project", + "framework": ".NETCoreApp,Version=v8.0", + "dependencies": { + "System.Text.Json": "9.0.0" + }, + "compile": { + "bin/placeholder/RunAgent.dll": {} + }, + "runtime": { + "bin/placeholder/RunAgent.dll": {} + } + } + } + }, + "libraries": { + "System.IO.Pipelines/9.0.0": { + "sha512": "eA3cinogwaNB4jdjQHOP3Z3EuyiDII7MT35jgtnsA4vkn0LUrrSHsU0nzHTzFzmaFYeKV7MYyMxOocFzsBHpTw==", + "type": "package", + "path": "system.io.pipelines/9.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "PACKAGE.md", + "THIRD-PARTY-NOTICES.TXT", + "buildTransitive/net461/System.IO.Pipelines.targets", + "buildTransitive/net462/_._", + "buildTransitive/net8.0/_._", + "buildTransitive/netcoreapp2.0/System.IO.Pipelines.targets", + "lib/net462/System.IO.Pipelines.dll", + "lib/net462/System.IO.Pipelines.xml", + "lib/net8.0/System.IO.Pipelines.dll", + "lib/net8.0/System.IO.Pipelines.xml", + "lib/net9.0/System.IO.Pipelines.dll", + "lib/net9.0/System.IO.Pipelines.xml", + "lib/netstandard2.0/System.IO.Pipelines.dll", + "lib/netstandard2.0/System.IO.Pipelines.xml", + "system.io.pipelines.9.0.0.nupkg.sha512", + "system.io.pipelines.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "System.Text.Encodings.Web/9.0.0": { + "sha512": "e2hMgAErLbKyUUwt18qSBf9T5Y+SFAL3ZedM8fLupkVj8Rj2PZ9oxQ37XX2LF8fTO1wNIxvKpihD7Of7D/NxZw==", + "type": "package", + "path": "system.text.encodings.web/9.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "PACKAGE.md", + "THIRD-PARTY-NOTICES.TXT", + "buildTransitive/net461/System.Text.Encodings.Web.targets", + "buildTransitive/net462/_._", + "buildTransitive/net8.0/_._", + "buildTransitive/netcoreapp2.0/System.Text.Encodings.Web.targets", + "lib/net462/System.Text.Encodings.Web.dll", + "lib/net462/System.Text.Encodings.Web.xml", + "lib/net8.0/System.Text.Encodings.Web.dll", + "lib/net8.0/System.Text.Encodings.Web.xml", + "lib/net9.0/System.Text.Encodings.Web.dll", + "lib/net9.0/System.Text.Encodings.Web.xml", + "lib/netstandard2.0/System.Text.Encodings.Web.dll", + "lib/netstandard2.0/System.Text.Encodings.Web.xml", + "runtimes/browser/lib/net8.0/System.Text.Encodings.Web.dll", + "runtimes/browser/lib/net8.0/System.Text.Encodings.Web.xml", + "runtimes/browser/lib/net9.0/System.Text.Encodings.Web.dll", + "runtimes/browser/lib/net9.0/System.Text.Encodings.Web.xml", + "system.text.encodings.web.9.0.0.nupkg.sha512", + "system.text.encodings.web.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "System.Text.Json/9.0.0": { + "sha512": "js7+qAu/9mQvnhA4EfGMZNEzXtJCDxgkgj8ohuxq/Qxv+R56G+ljefhiJHOxTNiw54q8vmABCWUwkMulNdlZ4A==", + "type": "package", + "path": "system.text.json/9.0.0", + "files": [ + ".nupkg.metadata", + ".signature.p7s", + "Icon.png", + "LICENSE.TXT", + "PACKAGE.md", + "THIRD-PARTY-NOTICES.TXT", + "analyzers/dotnet/roslyn3.11/cs/System.Text.Json.SourceGeneration.dll", + "analyzers/dotnet/roslyn3.11/cs/cs/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/de/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/es/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/fr/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/it/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/ja/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/ko/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/pl/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/pt-BR/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/ru/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/tr/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/zh-Hans/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn3.11/cs/zh-Hant/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/System.Text.Json.SourceGeneration.dll", + "analyzers/dotnet/roslyn4.0/cs/cs/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/de/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/es/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/fr/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/it/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/ja/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/ko/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/pl/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/pt-BR/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/ru/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/tr/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/zh-Hans/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.0/cs/zh-Hant/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/System.Text.Json.SourceGeneration.dll", + "analyzers/dotnet/roslyn4.4/cs/cs/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/de/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/es/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/fr/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/it/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/ja/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/ko/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/pl/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/pt-BR/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/ru/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/tr/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/zh-Hans/System.Text.Json.SourceGeneration.resources.dll", + "analyzers/dotnet/roslyn4.4/cs/zh-Hant/System.Text.Json.SourceGeneration.resources.dll", + "buildTransitive/net461/System.Text.Json.targets", + "buildTransitive/net462/System.Text.Json.targets", + "buildTransitive/net8.0/System.Text.Json.targets", + "buildTransitive/netcoreapp2.0/System.Text.Json.targets", + "buildTransitive/netstandard2.0/System.Text.Json.targets", + "lib/net462/System.Text.Json.dll", + "lib/net462/System.Text.Json.xml", + "lib/net8.0/System.Text.Json.dll", + "lib/net8.0/System.Text.Json.xml", + "lib/net9.0/System.Text.Json.dll", + "lib/net9.0/System.Text.Json.xml", + "lib/netstandard2.0/System.Text.Json.dll", + "lib/netstandard2.0/System.Text.Json.xml", + "system.text.json.9.0.0.nupkg.sha512", + "system.text.json.nuspec", + "useSharedDesignerContext.txt" + ] + }, + "RunAgent/0.1.47": { + "type": "project", + "path": "../../../runagent-csharp/RunAgent.csproj", + "msbuildProject": "../../../runagent-csharp/RunAgent.csproj" + } + }, + "projectFileDependencyGroups": { + "net8.0": [ + "RunAgent >= 0.1.47" + ] + }, + "packageFolders": { + "/home/dev/.nuget/packages/": {} + }, + "project": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/dev/radeen/runagent/test_scripts/csharp/test_agno/test_agno.csproj", + "projectName": "test_agno", + "projectPath": "/home/dev/radeen/runagent/test_scripts/csharp/test_agno/test_agno.csproj", + "packagesPath": "/home/dev/.nuget/packages/", + "outputPath": "/home/dev/radeen/runagent/test_scripts/csharp/test_agno/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/dev/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net8.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net8.0": { + "targetAlias": "net8.0", + "projectReferences": { + "/home/dev/radeen/runagent/runagent-csharp/RunAgent.csproj": { + "projectPath": "/home/dev/radeen/runagent/runagent-csharp/RunAgent.csproj" + } + } + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "net8.0": { + "targetAlias": "net8.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/lib/dotnet/sdk/8.0.122/PortableRuntimeIdentifierGraph.json" + } + } + } +} \ No newline at end of file diff --git a/test_scripts/csharp/test_agno/obj/project.nuget.cache b/test_scripts/csharp/test_agno/obj/project.nuget.cache new file mode 100644 index 0000000..db75e79 --- /dev/null +++ b/test_scripts/csharp/test_agno/obj/project.nuget.cache @@ -0,0 +1,12 @@ +{ + "version": 2, + "dgSpecHash": "v5+P8v51n2FlNn2j8R2KL467FtgZnjNjIa7uV2AtlmCPBAdZDRuuQFYky0249NthKyKjRgfO7JrAjIlFgCmUxw==", + "success": true, + "projectFilePath": "/home/dev/radeen/runagent/test_scripts/csharp/test_agno/test_agno.csproj", + "expectedPackageFiles": [ + "/home/dev/.nuget/packages/system.io.pipelines/9.0.0/system.io.pipelines.9.0.0.nupkg.sha512", + "/home/dev/.nuget/packages/system.text.encodings.web/9.0.0/system.text.encodings.web.9.0.0.nupkg.sha512", + "/home/dev/.nuget/packages/system.text.json/9.0.0/system.text.json.9.0.0.nupkg.sha512" + ], + "logs": [] +} \ No newline at end of file diff --git a/test_scripts/csharp/test_agno/obj/test_agno.csproj.nuget.dgspec.json b/test_scripts/csharp/test_agno/obj/test_agno.csproj.nuget.dgspec.json new file mode 100644 index 0000000..0b5a7f5 --- /dev/null +++ b/test_scripts/csharp/test_agno/obj/test_agno.csproj.nuget.dgspec.json @@ -0,0 +1,124 @@ +{ + "format": 1, + "restore": { + "/home/dev/radeen/runagent/test_scripts/csharp/test_agno/test_agno.csproj": {} + }, + "projects": { + "/home/dev/radeen/runagent/runagent-csharp/RunAgent.csproj": { + "version": "0.1.47", + "restore": { + "projectUniqueName": "/home/dev/radeen/runagent/runagent-csharp/RunAgent.csproj", + "projectName": "RunAgent", + "projectPath": "/home/dev/radeen/runagent/runagent-csharp/RunAgent.csproj", + "packagesPath": "/home/dev/.nuget/packages/", + "outputPath": "/home/dev/radeen/runagent/runagent-csharp/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/dev/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net8.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net8.0": { + "targetAlias": "net8.0", + "projectReferences": {} + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "net8.0": { + "targetAlias": "net8.0", + "dependencies": { + "System.Text.Json": { + "target": "Package", + "version": "[9.0.0, )" + } + }, + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/lib/dotnet/sdk/8.0.122/PortableRuntimeIdentifierGraph.json" + } + } + }, + "/home/dev/radeen/runagent/test_scripts/csharp/test_agno/test_agno.csproj": { + "version": "1.0.0", + "restore": { + "projectUniqueName": "/home/dev/radeen/runagent/test_scripts/csharp/test_agno/test_agno.csproj", + "projectName": "test_agno", + "projectPath": "/home/dev/radeen/runagent/test_scripts/csharp/test_agno/test_agno.csproj", + "packagesPath": "/home/dev/.nuget/packages/", + "outputPath": "/home/dev/radeen/runagent/test_scripts/csharp/test_agno/obj/", + "projectStyle": "PackageReference", + "configFilePaths": [ + "/home/dev/.nuget/NuGet/NuGet.Config" + ], + "originalTargetFrameworks": [ + "net8.0" + ], + "sources": { + "https://api.nuget.org/v3/index.json": {} + }, + "frameworks": { + "net8.0": { + "targetAlias": "net8.0", + "projectReferences": { + "/home/dev/radeen/runagent/runagent-csharp/RunAgent.csproj": { + "projectPath": "/home/dev/radeen/runagent/runagent-csharp/RunAgent.csproj" + } + } + } + }, + "warningProperties": { + "warnAsError": [ + "NU1605" + ] + } + }, + "frameworks": { + "net8.0": { + "targetAlias": "net8.0", + "imports": [ + "net461", + "net462", + "net47", + "net471", + "net472", + "net48", + "net481" + ], + "assetTargetFallback": true, + "warn": true, + "frameworkReferences": { + "Microsoft.NETCore.App": { + "privateAssets": "all" + } + }, + "runtimeIdentifierGraphPath": "/usr/lib/dotnet/sdk/8.0.122/PortableRuntimeIdentifierGraph.json" + } + } + } + } +} \ No newline at end of file diff --git a/test_scripts/csharp/test_agno/obj/test_agno.csproj.nuget.g.props b/test_scripts/csharp/test_agno/obj/test_agno.csproj.nuget.g.props new file mode 100644 index 0000000..c7e3e97 --- /dev/null +++ b/test_scripts/csharp/test_agno/obj/test_agno.csproj.nuget.g.props @@ -0,0 +1,15 @@ + + + + True + NuGet + $(MSBuildThisFileDirectory)project.assets.json + /home/dev/.nuget/packages/ + /home/dev/.nuget/packages/ + PackageReference + 6.8.1 + + + + + \ No newline at end of file diff --git a/test_scripts/csharp/test_agno/obj/test_agno.csproj.nuget.g.targets b/test_scripts/csharp/test_agno/obj/test_agno.csproj.nuget.g.targets new file mode 100644 index 0000000..3d3029f --- /dev/null +++ b/test_scripts/csharp/test_agno/obj/test_agno.csproj.nuget.g.targets @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/test_scripts/csharp/test_agno/test_agno.csproj b/test_scripts/csharp/test_agno/test_agno.csproj new file mode 100644 index 0000000..9e04a43 --- /dev/null +++ b/test_scripts/csharp/test_agno/test_agno.csproj @@ -0,0 +1,19 @@ + + + + Exe + net8.0 + latest + enable + enable + + + + + + + + + + + diff --git a/test_scripts/python/client_test_agno.py b/test_scripts/python/client_test_agno.py index 5b40c65..c8972f0 100644 --- a/test_scripts/python/client_test_agno.py +++ b/test_scripts/python/client_test_agno.py @@ -3,8 +3,7 @@ ra = RunAgentClient( agent_id="ae29bd73-b3d3-99c8-a98f-5d7aec7ee911", entrypoint_tag="agno_print_response", - local=True, - port=8455 + local=True )