Jay.Semantic
1.0.1
dotnet add package Jay.Semantic --version 1.0.1
NuGet\Install-Package Jay.Semantic -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="Jay.Semantic" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Jay.Semantic" Version="1.0.1" />
<PackageReference Include="Jay.Semantic" />
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.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Jay.Semantic, 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 Jay.Semantic@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=Jay.Semantic&version=1.0.1
#tool nuget:?package=Jay.Semantic&version=1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Jay.Semantic
A lightweight semantic function router for LLMs in .NET
Register your C# methods, generate a function catalog, and invoke them automatically via OpenAI or any LLM provider.
✨ Features
- 🔍 Auto-discovers methods with metadata
- 🧠 Generates tool/function catalog for LLMs
- 📤 Invokes mapped methods based on LLM output
- 🔗 Supports OpenAI,
- 📦 Plug-and-play NuGet package
🚀 Getting Started
dotnet add package Jay.Semantic
var s = new Semantic();
var testclass = new TestClass();
var weather = await s.RegisterSkillAndInvoke(testclass, "What is the current weather?");
//Your custom class
public class TestClass {
[FunctionDescription("This method will return the current weather in sydney")]
public async Task<string> GetCurrentWeatherInSydneyAsync()
{
using var httpClient = new HttpClient();
// Sydney coordinates: Latitude -33.87, Longitude 151.21
var url = "https://api.open-meteo.com/v1/forecast?latitude=-33.87&longitude=151.21¤t_weather=true";
try
{
var response = await httpClient.GetStringAsync(url);
using var weatherData = JsonDocument.Parse(response);
var current = weatherData.RootElement.GetProperty("current_weather");
var temp = current.GetProperty("temperature").GetDouble();
var wind = current.GetProperty("windspeed").GetDouble();
var time = current.GetProperty("time").GetString();
return $"🌤️ As of {time}, the temperature in Sydney is {temp}°C with wind speed {wind} km/h.";
}
catch (Exception ex)
{
return $"❌ Error retrieving weather: {ex.Message}";
}
}
}
Product | Versions 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.
-
net8.0
- Betalgo.OpenAI (>= 8.7.2)
- Microsoft.Graph (>= 5.87.0)
- Newtonsoft.Json (>= 13.0.3)
- OpenAI (>= 2.2.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.