ReviDotNet 0.1.0

dotnet add package ReviDotNet --version 0.1.0
                    
NuGet\Install-Package ReviDotNet -Version 0.1.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="ReviDotNet" Version="0.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ReviDotNet" Version="0.1.0" />
                    
Directory.Packages.props
<PackageReference Include="ReviDotNet" />
                    
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 ReviDotNet --version 0.1.0
                    
#r "nuget: ReviDotNet, 0.1.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 ReviDotNet@0.1.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=ReviDotNet&version=0.1.0
                    
Install as a Cake Addin
#tool nuget:?package=ReviDotNet&version=0.1.0
                    
Install as a Cake Tool

ReviDotNet

ReviDotNet is a .NET library that makes working with modern LLMs straightforward, safe, and easily configurable. It separates prompt logic, provider connections, and model settings into simple repository files, adds resilience (retries, validators, output fixers), and provides Roslyn analyzers to catch mistakes at build time.

Note: ReviDotNet is still in development and some features may not be fully implemented yet.

Features

  • Configuration-as-files (kept in your repo)
    • Prompts: .pmt files with sections for [[information]], [[settings]], [[tuning]], raw prompt content, and examples
    • Providers: .rcfg files describing API host, keys, and protocol per provider
    • Models: .rcfg files describing model profiles (limits, defaults, overrides)
  • Supports multiple providers and models with configurable model routing
  • Chat and prompt completion interfaces (automatically chosen or forced per prompt/model)
  • Agent orchestration via .agent files (state loops, transitions, tool gating, guardrails)
  • Structured output guidance options (JSON/Regex/GBNF – manual and auto variants)
  • Resilience: retries, timeout control, token accounting, safe JSON extraction from Markdown
  • Built‑in fixers for common issues (e.g., json-fixer and enum-fixer prompts)
  • Input filtering and optional safety canary to detect injection attempts
  • Simple, strongly-typed inference API: ToObject<T>, ToEnum<TEnum>, ToStringList, ToStringListLimited, ToBool, ToString, streaming via CompletionStream
  • First-class Roslyn analyzers for prompt and agent validation (REVI001, REVI006, REVI007, REVI008)
  • Embeddings support via model profiles dedicated to embeddings

Why ReviDotNet?

ReviDotNet was built for ease of use with a combination of unique features that prioritize repository-centric configuration, compile-time safety, and built-in resilience. While other libraries provide broad abstractions, ReviDotNet focuses on a structured, file-based approach that keeps your prompts and model settings versioned alongside your code.

Feature ReviDotNet Semantic Kernel MEAI LangChain.NET
File-based prompt config (.pmt/.yaml) ✅ Rich ✅ Basic
File-based provider/model config .rcfg ⚠️ appsettings ⚠️ Code ⚠️ Code
Built-in agent orchestration ✅ Full ✅ Full ⚠️ Partial ⚠️ Partial
Built-in model routing
Roslyn compile-time analyzer
Strongly-typed inference API ⚠️ ⚠️
Built-in JSON/enum fixers ⚠️
Injection canary
Embeddings
Streaming
Multi-provider

Repository layout (ReviDotNet)

  • ReviDotNet.Core – main runtime (config parsing, providers, models, inference API)
  • ReviDotNet.Analyzers – Roslyn analyzers (prompt/agent validation at compile time)
  • ReviDotNet.Tests – unit tests and helpers

Your app’s configuration files typically live under an RConfigs folder in your project:

  • RConfigs/Prompts.pmt prompt files (any subfolders)
  • RConfigs/Agents.agent orchestration files (any subfolders)
  • RConfigs/Providers – provider .rcfg files
  • RConfigs/Models/Inference – inference model .rcfg files
  • RConfigs/Models/Embedding – embedding model .rcfg files

Documentation

The core docs are in this repo:

  • Prompt files: ReviDotNet.Core/Docs/prompt-files.md
  • Agent files: ReviDotNet.Core/Docs/agent-files.md
  • Provider files: ReviDotNet.Core/Docs/provider-files.md
  • Model files: ReviDotNet.Core/Docs/model-files.md
  • Inference API: ReviDotNet.Core/Docs/inference.md
  • Analyzers: ReviDotNet.Core/Docs/analyzers.md

Quick start

  1. Add ReviDotNet to your solution
  • Reference the ReviDotNet.Core project (or consume the package if you publish it internally).
  • (Recommended) Add the analyzers to projects that call the Infer.* API:
<ItemGroup>
  <PackageReference Include="ReviDotNet.Analyzers" Version="1.*" PrivateAssets="all" />
</ItemGroup>
  1. Create minimal configuration files in your app repo
  • Provider (RConfigs/Providers/claude.rcfg):
[[general]]
name = claude
enabled = true
protocol = Claude
api-url = https://api.anthropic.com/
api-key = environment
default-model = claude-3-5-sonnet-latest
supports-prompt-completion = true

Environment variables for API keys follow: PROVAPIKEY__CLAUDE (uppercase, hyphens/spaces to underscores). See ReviDotNet.Core/Docs/provider-files.md.

  • Model (RConfigs/Models/Inference/anth_sonnet_35.rcfg):
[[general]]
name = anth_sonnet_35
enabled = true
model-string = claude-3-5-sonnet-latest
provider-name = claude

[[settings]]
tier = A
token-limit = 100000
  • Prompt (RConfigs/Prompts/Search/analyze-specs.pmt):
[[information]]
name = analyze-specs
version = 1

[[settings]]
request-json = false

[[_system]]
You are a helpful assistant.

[[_instruction]]
Analyze the following specs and provide 3 bullet points.

[[_exin_1]]
[Specs]
The system should be fast.

[[_exout_1]]
- Low latency
- Efficient
- Responsive
  1. Call the API from C#
using System.Collections.Generic;
using System.Threading;
using System.Threading.Tasks;
using Revi;

public static class Demo
{
    public static async Task RunAsync(CancellationToken token = default)
    {
        List<Input> inputs =
        [
            new Input("Specs", "Users need a clean and fast UI.")
        ];

        // Get raw text
        string? text = await Infer.ToString("search/analyze-specs", inputs, token: token);

        // Get a list of strings
        List<string> points = await Infer.ToStringList("search/analyze-specs", inputs, token: token);

        // Stream output (concatenate chunks)
        StringBuilder builder = new StringBuilder();
        await foreach (string chunk in Infer.CompletionStream("search/analyze-specs", inputs, token: token))
        {
            builder.Append(chunk);
        }

        // Strongly-typed object
        AnalysisResult? result = await Infer.ToObject<AnalysisResult>(
            "search/analyze-specs",
            inputs,
            modelName: null,
            token: token);
    }

    public sealed class AnalysisResult
    {
        public List<string> Points { get; set; } = new List<string>();
    }
}

Notes

  • Prompt names are resolved as: <lower-cased-subfolder(s)>/<[[information]] name>; the physical filename is not used for matching. See ReviDotNet.Core/Docs/analyzers.md.
  • Use ToEnum<TEnum> for constrained label tasks; pass includeEnumValues: true to inject valid options.
  • When request-json = true or a guidance schema is enabled, ToObject<T> will validate and repair common JSON issues.
  • ToStringListLimited allows early stop based on count or a custom evaluator.

Analyzer integration (REVI001, REVI006, REVI007, REVI008)

The ReviDotNet.Analyzers package validates prompt and agent usage at compile time.

  • REVI001: prompt not found in RConfigs/Prompts
  • REVI006: agent not found in RConfigs/Agents
  • REVI007: duplicate effective agent names
  • REVI008: non-constant agent name in Agent.Run / Agent.ToString / Agent.FindAgent

To enable prompt validation, include your .pmt files as AdditionalFiles in the projects that compile the calling code:

<Project>
  <ItemGroup>
    <AdditionalFiles Include="RConfigs\Prompts\**\*.pmt" />
  </ItemGroup>
</Project>

If you use agent orchestration, include .agent files too so agent-related analyzer rules can run:

<Project>
  <ItemGroup>
    <AdditionalFiles Include="RConfigs\Agents\**\*.agent" />
  </ItemGroup>
</Project>

See ReviDotNet.Core/Docs/analyzers.md for details and troubleshooting.

Configuration & secrets

  • Non-secret runtime settings should go through your app’s runtime configuration mechanism (e.g., a RuntimeConfigService).
  • Provider API keys are read from environment variables when you specify api-key = environment in the provider .rcfg. See ReviDotNet.Core/Docs/provider-files.md for the exact variable naming convention.

Embeddings

Define embedding model profiles under RConfigs/Models/Embedding and use them where vectorization is required. See ReviDotNet.Core/Docs/model-files.md for the supported options (dimensions, encoding-format, task-type, etc.).

Testing

  • The ReviDotNet.Tests project contains examples and helpers. You can substitute a fake or local provider during tests.
  • Consider using CI with analyzers enabled and -warnaserror+ to keep configuration drift from reaching production.

Roadmap / Contributions

Open issues or pull requests with:

  • Additional analyzer rules (e.g., checking input label mismatches, guidance schema drift)
  • New provider protocols
  • Samples/tutorials

License

See LICENSE.txt at the repository root of this solution for licensing details pertaining to Revision Labs code.

Product Compatible and additional computed target framework versions.
.NET 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 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
0.1.0 126 4/29/2026