IntentSharp 1.0.1

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package IntentSharp --version 1.0.1
                    
NuGet\Install-Package IntentSharp -Version 1.0.1
                    
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="IntentSharp" Version="1.0.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="IntentSharp" Version="1.0.1" />
                    
Directory.Packages.props
<PackageReference Include="IntentSharp" />
                    
Project file
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 IntentSharp --version 1.0.1
                    
#r "nuget: IntentSharp, 1.0.1"
                    
#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 IntentSharp@1.0.1
                    
#: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=IntentSharp&version=1.0.1
                    
Install as a Cake Addin
#tool nuget:?package=IntentSharp&version=1.0.1
                    
Install as a Cake Tool

IntentSharp: typed, checked AI results for C# and .NET

Extract structured data from emails, classify support requests, or transform application values with OpenAI GPT or Anthropic Claude. IntentSharp returns your .NET type after checking the reply against its type and your rules. A failed check becomes feedback for another attempt, within the attempt, model-call and time limits you set.

Use it in an existing application one call at a time. The core supports values, collections and methods marked with [AIIntent]. A successful result means the configured checks passed; it does not prove factual accuracy.

Choose a package

All four packages target .NET 8, .NET 9 and .NET 10. Keep the IntentSharp packages your application uses at the same version; the add-ons depend on the exact matching version.

Package Add it when you need
IntentSharp Typed calls, code-defined checks, bounded retries and native OpenAI or Anthropic providers
IntentSharp.Catalog Named intents with instructions, result shapes, rules and examples in reloadable YAML or JSON files
IntentSharp.Guardrails Versioned rule files for model, tool and data-operation checkpoints
IntentSharp.Extensions.AI An existing Microsoft.Extensions.AI IChatClient, or catalog intents exposed as agent tools

Quick start: extract and validate an order

Use a .NET 8 or later SDK to create a console application:

dotnet new console -n CheckedOrders --framework net8.0
cd CheckedOrders
dotnet add package IntentSharp --version 1.0.1

Create config/intentsharp.providers.json. Replace the model placeholder with a Claude model available to your Anthropic account, and set ANTHROPIC_API_KEY in the application's environment. The file holds a secret reference, not the API key. Running this example calls the provider and incurs its normal usage charges.

{
  "intentsharp": "providers/1",
  "providers": [
    {
      "name": "main",
      "kind": "anthropic",
      "secret": "env:ANTHROPIC_API_KEY",
      "model": "<your-claude-model-id>"
    }
  ],
  "roles": { "answer": ["main"] }
}

Add this item group inside the application project file so the configuration reaches its build output:

<ItemGroup>
  <None Update="config/**/*" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>

Replace Program.cs with:

using IntentSharp;
using IntentSharp.Documents;
using IntentSharp.Extensions;

using var store = new FolderDocumentStore(Path.Combine(AppContext.BaseDirectory, "config"));
using var client = new IntentClientBuilder().UseProviderOptions(store).Build();

var options = new AIRequestOptions
{
    MaxAttempts = 2,
    MaxModelCalls = 2,
    Timeout = TimeSpan.FromSeconds(30)
}.Require<PurchaseRequest>(x => x.Quantity > 0, "Quantity must be greater than zero.")
 .Require<PurchaseRequest>(x => !string.IsNullOrWhiteSpace(x.Sku), "Sku must not be blank.");

var email = "Dana at Northwind needs 40 units of SKU A-1192.";
var result = await email.AIAsync<PurchaseRequest>(client,
    "Extract the contact, SKU and quantity from the email.", options);

if (result.Success)
    Console.WriteLine($"{result.Value!.Contact}: {result.Value.Quantity} x {result.Value.Sku}");
else
    foreach (var issue in result.Issues) Console.WriteLine(issue);

public sealed class PurchaseRequest
{
    public string Contact { get; set; } = "";
    public string Sku { get; set; } = "";
    public int Quantity { get; set; }
}

Run dotnet run. A passing extraction prints the contact, quantity and SKU. The exact answer depends on the model. If checks still fail within the limits, inspect Issues instead of treating the result as a usable order.

For OpenAI GPT, use kind: "openai", secret: "env:OPENAI_API_KEY" and a model available to your OpenAI account. IntentSharp ships no default model ID. For Ollama, Azure OpenAI or another configured IChatClient, use IntentSharp.Extensions.AI.

Try the checks without a model or API key

The offline sample download targets the published 1.0.0 packages. It demonstrates validation, bounded retries and intent-file reloads with scripted replies. Its self-test makes no model calls. Follow the included instructions, or read the ASP.NET Core extraction walkthrough.

What the checks cover

  • Parsing and reading the reply as your result type, including required members and enum membership.
  • Your Require<T> and Validate<T> checks, with findings fed back on a failed attempt.
  • Attempt, model-call, output-token and time budgets. These bound the work; they do not guarantee a passing answer.

Put business rules in checks, and review the result before an action that needs human approval. These checks do not establish that an extracted fact is true or that every application action is authorized.

Keep changeable behavior in intent files

With Catalog, instructions, compatible result shapes, rules and examples can live in YAML or JSON files. Supported edits reload while the application runs. New compiled .NET types, new named code validators and new call sites still need an application release. Guardrails adds versioned rule files; technology-specific operations use an ITarget implemented by your application.

Documentation, evaluation and support

IntentSharp is commercial software, not open source. Evaluate free for 30 days on development and test systems; after that, business use needs a paid license. Production use needs a paid license from the first day. For help, use the support information on the website or NuGet's Contact owners link.

The wider direction

Unified Intent Architecture is the wider approach of making instructions, contracts and rules explicit alongside application logic. IntentSharp supplies concrete .NET building blocks for that approach; an application defines its own integrations and approval process.

Built and sold by C2Consultants LLC. C2Empowered, the company's self-hosted operations platform, is built on IntentSharp; how the two fit together.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 is compatible.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (4)

Showing the top 4 NuGet packages that depend on IntentSharp:

Package Downloads
IntentSharp.Catalog

YAML and JSON intent files for C# and .NET: keep LLM instructions, result shapes, validation rules and examples outside compiled code. Run intents by name and check every reply in your process, with failed checks fed back within the configured limits. Supports primitive results, registered .NET types and JSON Schema shapes, plus an in-memory catalog. Intent files are versioned documents with revert. Supported saved edits reload while the application runs; malformed edits retain the last good definitions. New compiled result types, incompatible shapes, new named code checks and new call sites still need an application release. Reload is tested on local folders. Add this package to IntentSharp for file-backed or code-defined named intents; IntentSharp.Extensions.AI includes it. Commercial software, not open source: evaluate free for 30 days on development and test systems; after that, business use needs a paid license, and production use needs one from the first day (intentsharp.com/pricing).

IntentSharp.Extensions.AI

Typed, checked LLM results and agent tools for Microsoft.Extensions.AI IChatClient in C# and .NET. Use your configured chat client, such as Ollama or Azure OpenAI, with IntentSharp validation and bounded retries for invalid output. The backend and its configured adapters determine available models. UseChatClient and UseChatClientAsFallback select providers in code; the chat-client kind in a provider file selects a registered client. AsAIFunctions exposes catalog intents as AIFunction tools for Microsoft Agent Framework or another function-calling host: return a value after the intent checks pass, or an error result describing failure. The host executes function calls. Transport failures are not retried by IntentSharp; configure those retries in the chat-client pipeline or use a fallback. Installs the matching IntentSharp and IntentSharp.Catalog packages. Native OpenAI GPT or Anthropic Claude calls without IChatClient need only the core package. Commercial software, not open source: evaluate free for 30 days on development and test systems; after that, business use needs a paid license, and production use needs one from the first day (intentsharp.com/pricing).

IntentSharp.Guardrails

Guardrails as versioned YAML or JSON rule files for C# and .NET model calls, agent tools and data operations. Evaluate allow and deny lists, patterns, ranges, JSON Schema checks and operation limits in your process, with no model call during rule evaluation. A deny wins over an allow; an invalid rule-file edit keeps the last good version. Decisions identify the rule set, document and version. An AI edit to a rule file is validated and then takes effect by default; access-widening edits are flagged so your own edit writer can hold them for approval. Optional compilation of plain-language rules into deterministic checks is experimental and opt-in. Add this package to IntentSharp when rule sets live in files. Your application must integrate and honor the checkpoint decisions; this is not a sandbox for arbitrary application code. Commercial software, not open source: evaluate free for 30 days on development and test systems; after that, business use needs a paid license, and production use needs one from the first day (intentsharp.com/pricing).

IntentSharp.Specialist

Models defined per intent for C# and .NET, so one application can use several models easily, within one context or across several. For an IntentSharp catalog intent it sends the definition and the context you choose to a specialist service you wire in, waits until a specialist is provided, checks that the returned definition and specialist fit (a comparison in code by default; probe cases and an AI judge are opt-in), keeps the specialist's name and the returned intent for reuse, and runs the intent on that model through the normal IntentSharp pipeline, so every answer is still checked against your type and your rules. It never trains, tunes or changes a model and names no specialist provider: the service adapter, the store, the context sources, the fit checks and what happens after an offer does not fit are seams, and every setting is an option with a default. An offer names a provider configured on the client or brings its own, which the client reaches through a router by name only. A changed definition requests again, and keep-previous lets the specialist in use serve meanwhile. A document store keeps requests, tickets, fit reports and held specialists across restarts and processes; wait windows and an hourly request limit bound the exchange, and a guardrail checkpoint can refuse a request before anything is sent. A scripted specialist service and a contract kit test applications and adapters offline. Installs the matching IntentSharp and IntentSharp.Catalog packages. Commercial software, not open source: evaluate free for 30 days on development and test systems; after that, business use needs a paid license, and production use needs one from the first day (intentsharp.com/pricing).

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.0 67 11/13/2026
1.0.1 300 11/6/2026
1.0.0 222 10/28/2026
1.0.0-rc.3 111 10/20/2026

IntentSharp 1.0.1: updated package READMEs, discovery metadata and runnable examples. No runtime or public API changes. Release notes: https://intentsharp.com/changelog