JevNet.Extensions.DependencyInjection
0.2.1
dotnet add package JevNet.Extensions.DependencyInjection --version 0.2.1
NuGet\Install-Package JevNet.Extensions.DependencyInjection -Version 0.2.1
<PackageReference Include="JevNet.Extensions.DependencyInjection" Version="0.2.1" />
<PackageVersion Include="JevNet.Extensions.DependencyInjection" Version="0.2.1" />
<PackageReference Include="JevNet.Extensions.DependencyInjection" />
paket add JevNet.Extensions.DependencyInjection --version 0.2.1
#r "nuget: JevNet.Extensions.DependencyInjection, 0.2.1"
#:package JevNet.Extensions.DependencyInjection@0.2.1
#addin nuget:?package=JevNet.Extensions.DependencyInjection&version=0.2.1
#tool nuget:?package=JevNet.Extensions.DependencyInjection&version=0.2.1
JevNet.Extensions.DependencyInjection
Dependency injection and IHttpClientFactory integration for JevNet, the typed TypeSafe AI, Jev System One, and OpenRouter client.
Install
dotnet add package JevNet.Extensions.DependencyInjection
The core JevNet package is installed automatically as a dependency.
Register the client
using Jev;
using Microsoft.Extensions.DependencyInjection;
services.AddTypeSafeClient(_ => new TypeSafeClientOptions
{
ApiKey = configuration["TypeSafe:ApiKey"],
DefaultModel = configuration["TypeSafe:Model"],
});
You can also omit ApiKey and use the TYPESAFE_API_KEY environment variable.
Inject and use it
public sealed class TicketRouter(ITypeSafeClient client)
{
public async Task<string> RouteAsync(
string message,
CancellationToken cancellationToken)
{
var result = await client.SystemOneAsync(
new { message },
new Dictionary<string, Question>
{
["department"] = Question.Choice(
"Which team should handle this?",
new Dictionary<string, JevValue?>
{
["billing"] = "Charges, invoices, subscriptions, and refunds",
["support"] = "Product questions and technical problems",
["other"] = null,
}),
},
cancellationToken: cancellationToken);
return result.GetChoice("department").Choice;
}
}
AddTypeSafeClient returns an IHttpClientBuilder, so the usual handler, proxy, and resilience customization remains available.
Documentation and support
Licensed under the MIT License.
| 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. |
-
net8.0
- JevNet (>= 0.2.1)
- Microsoft.Extensions.Http (>= 10.0.12)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Improved NuGet discoverability with clearer metadata, project links, a new package icon, and package-specific README documentation.