XSharp.AI.SDK
1.0.0
dotnet add package XSharp.AI.SDK --version 1.0.0
NuGet\Install-Package XSharp.AI.SDK -Version 1.0.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="XSharp.AI.SDK" Version="1.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="XSharp.AI.SDK" Version="1.0.0" />
<PackageReference Include="XSharp.AI.SDK" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add XSharp.AI.SDK --version 1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: XSharp.AI.SDK, 1.0.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package XSharp.AI.SDK@1.0.0
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=XSharp.AI.SDK&version=1.0.0
#tool nuget:?package=XSharp.AI.SDK&version=1.0.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
XSharp.AI.SDK
The Enterprise AI SDK for X# and Visual FoxPro Developers.
XSharp.AI.SDK is a robust library designed to integrate Large Language Models (LLMs) into X# applications. It bridges the gap between legacy Visual FoxPro / X# systems and modern AI, featuring a powerful ReAct Agent loop, automatic WinForms UI context injection, and built-in resilience patterns.
🚀 Features
- Multi-Provider Support: Seamlessly switch between OpenAI, Anthropic (Claude), Gemini, DeepSeek, Monica, and Groq.
- ReAct Agent Architecture: Autonomous agents that can "Reason" and "Act" using tools.
- WinForms Automation:
- Automatically injects the current Form state (controls, values, captions) into the AI context.
- Allows the AI to interact with the UI (Read values, Click buttons, Change properties) via the
IUIContextProvider.
- Resilience Built-in: Invisible Circuit Breaker and Retry policies to handle API instability.
- Extensible Tooling: Create custom tools using a fluent Delegate API.
- RAG Support: Simple context loading for documents and text.
📦 Installation
dotnet add package XSharp.AI.SDK
⚡ Quick Start
1. Initialize the Service
using XSharp.AI.SDK
// Configure settings
var settings := AISettings{"YOUR_API_KEY", AIProvider.OpenAI}
settings:ModelName := "gpt-4o"
// Create the Agent
// Passing 'self' (a Form) automatically enables UI awareness
var agent := AIAgent{settings, self}
2. Run the Agent
// The agent can see your screen and act on it
var response := await agent:RunAsync("Check the 'CustomerCode' textbox. If it's empty, disable the 'Save' button and tell me why.")
// Output: "I've checked the CustomerCode and it is empty. I have disabled the Save button as requested."
3. Register Custom Tools
var myTool := AITool{"CalculateTax", "Calculates VAT", ;
async delegate(args as Dictionary<string, object>) {
var amount := Convert.ToDecimal(args["amount"])
return (amount * 1.21):ToString()
}}:AddParameter("amount", "number", "The base amount", true)
agent:RegisterTool(myTool)
🏗 Architecture
- AIAgent: The orchestrator that manages the ReAct loop (Think → Act → Observe).
- UIContextFactory: Automatically detects the UI technology (WinForms) and creates a reflection-based inventory of controls.
- ToolRegistry: Manages available capabilities. Includes Meta-tools for self-discovery.
- Resilience:
CircuitBreakerandRetryPolicyensure your enterprise app doesn't crash if the AI API hiccups.
🔧 Supported Providers
| Provider | Default Model |
|---|---|
| OpenAI | gpt-4o |
| Anthropic | claude-3-5-sonnet |
| Gemini | gemini-1.5-flash |
| DeepSeek | deepseek-chat |
| Groq | llama-3.3-70b |
📄 License
MIT License. See LICENSE file for details.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET Framework | net48 is compatible. net481 was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETFramework 4.8
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 130 | 2/8/2026 |