Jev.TypeSafe.Unofficial.Extensions
0.1.0-preview.3
dotnet add package Jev.TypeSafe.Unofficial.Extensions --version 0.1.0-preview.3
NuGet\Install-Package Jev.TypeSafe.Unofficial.Extensions -Version 0.1.0-preview.3
<PackageReference Include="Jev.TypeSafe.Unofficial.Extensions" Version="0.1.0-preview.3" />
<PackageVersion Include="Jev.TypeSafe.Unofficial.Extensions" Version="0.1.0-preview.3" />
<PackageReference Include="Jev.TypeSafe.Unofficial.Extensions" />
paket add Jev.TypeSafe.Unofficial.Extensions --version 0.1.0-preview.3
#r "nuget: Jev.TypeSafe.Unofficial.Extensions, 0.1.0-preview.3"
#:package Jev.TypeSafe.Unofficial.Extensions@0.1.0-preview.3
#addin nuget:?package=Jev.TypeSafe.Unofficial.Extensions&version=0.1.0-preview.3&prerelease
#tool nuget:?package=Jev.TypeSafe.Unofficial.Extensions&version=0.1.0-preview.3&prerelease
Jev.TypeSafe.Unofficial.Extensions
Unofficial. Dependency-injection support for
Jev.TypeSafe.Unofficial, the community .NET SDK for TypeSafe AI (Jev). Not affiliated with or endorsed by TypeSafe AI.
Registers ITypeSafeClient and TypeSafeClient with Microsoft.Extensions.DependencyInjection, backed by
IHttpClientFactory, with options bound from IConfiguration. Targets netstandard2.0, net8.0, net9.0 and net10.0.
Install
dotnet add package Jev.TypeSafe.Unofficial.Extensions --prerelease
Usage
using Microsoft.Extensions.DependencyInjection;
using TypeSafe.AI;
services.AddTypeSafeClient(options => options.DefaultModel = "jev-latest");
ApiKey falls back to the TYPESAFE_API_KEY environment variable, like the plain client. Inject ITypeSafeClient
wherever you need it.
From configuration
{
"TypeSafe": {
"ApiKey": "...",
"DefaultModel": "jev-latest",
"Timeout": "00:00:10",
"RetryPolicy": { "MaxRetries": 3 },
"DefaultHeaders": { "X-Team": "search" }
}
}
services.AddTypeSafeClient(configuration.GetSection("TypeSafe"));
Keep real keys in user secrets or environment variables, not in appsettings.json.
Overloads
| Overload | Use it to |
|---|---|
AddTypeSafeClient() |
rely on environment variables and defaults |
AddTypeSafeClient(Action<TypeSafeClientOptions>) |
set options in code |
AddTypeSafeClient(Action<TypeSafeClientOptions, IServiceProvider>) |
set options using other registered services |
AddTypeSafeClient(IConfiguration) |
bind a configuration section |
Option sources apply in registration order, with later ones winning. Anything still unset falls back to the environment variables and defaults of the core client.
Customizing the HTTP pipeline
Every overload returns an IHttpClientBuilder:
services.AddTypeSafeClient(configuration.GetSection("TypeSafe"))
.AddHttpMessageHandler<MyLoggingHandler>();
If you add a resilience handler, consider RetryPolicy.None so retries are not applied twice.
Behavior
- Lifetime: one singleton, shared by
ITypeSafeClientandTypeSafeClient. The container disposes it; it does not dispose the factory'sHttpClient. - Logging and time:
ILoggerFactoryandTimeProviderare taken from the container unless you set them explicitly. They are never bound from configuration, nor isLogger. - Timeout: the factory
HttpClient.Timeoutis infinite because the SDK enforces its own per-attempt timeout (TypeSafeClientOptions.Timeout). - Connections: on .NET 8 and later the primary handler is a
SocketsHttpHandlerwith a 2-minute pooled-connection lifetime, so DNS changes are honored by the long-lived client. Override it withConfigurePrimaryHttpMessageHandler. - Validation: options are validated when the client is first resolved, not at host start. Resolve it once during startup if you want to fail fast.
See the main README for the client API.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Jev.TypeSafe.Unofficial (>= 0.1.0-preview.3)
- Microsoft.Extensions.Configuration (>= 10.0.12)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Http (>= 10.0.12)
- Microsoft.Extensions.Options (>= 10.0.12)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.12)
-
net10.0
- Jev.TypeSafe.Unofficial (>= 0.1.0-preview.3)
- Microsoft.Extensions.Configuration (>= 10.0.12)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Http (>= 10.0.12)
- Microsoft.Extensions.Options (>= 10.0.12)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.12)
-
net8.0
- Jev.TypeSafe.Unofficial (>= 0.1.0-preview.3)
- Microsoft.Extensions.Configuration (>= 10.0.12)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Http (>= 10.0.12)
- Microsoft.Extensions.Options (>= 10.0.12)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 10.0.12)
-
net9.0
- Jev.TypeSafe.Unofficial (>= 0.1.0-preview.3)
- Microsoft.Extensions.Configuration (>= 10.0.12)
- Microsoft.Extensions.DependencyInjection.Abstractions (>= 10.0.12)
- Microsoft.Extensions.Http (>= 10.0.12)
- Microsoft.Extensions.Options (>= 10.0.12)
- Microsoft.Extensions.Options.ConfigurationExtensions (>= 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.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0-preview.3 | 81 | 10/3/2026 |