Jay.Semantic 1.0.0

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

Jay.Semantic

A lightweight semantic function router for LLMs in .NET
Let your .NET methods be discoverable and invokable by LLMs like ChatGPT!
Register your classes, generate a catalog, and route prompts to real C# methods — no manual binding needed.


✨ Features

  • 🔍 Auto-discovers public methods and parameters using reflection
  • 📄 Generates OpenAI-style function/tool catalog as JSON
  • 🧠 Parses user prompts into FunctionCallRequest JSON using LLM
  • 🚀 Invokes matched methods dynamically using reflection
  • 🖼️ Supports image-based skills (e.g., SkiaSharp drawing)
  • 🔌 Clean, pluggable architecture for rapid AI-based function routing

🚀 Getting Started

dotnet add package Jay.Semantic

🔧 Basic Usage

1. Define Your Skill Class

public class MySkills
{
    public string Greet(string name) => $"Hello, {name}!";
    public int Add(int a, int b) => a + b;
}

2. Register + Use the Semantic Router
var s = new Semantic();
s.RegisterTargetObject(new MySkills(), friendlyName: "skills");

var catalog = s.GenerateFunctionCatalogJson(new MySkills());

// This can come from user input, a voice assistant, chatbot, etc.
string userPrompt = "Add 10 and 20";

var llmJson = await s.GetFunctionCallJsonFromPrompt(userPrompt, catalog);

// Invokes the real method using reflection
var result = await s.InvokeAsyncFromLlmOutput(llmJson);

Console.WriteLine(result.Value); // Output: 30

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 was computed.  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
1.0.1 492 7/24/2025
1.0.0 482 7/24/2025