Stef.Microsoft.SemanticKernel.WithRetry
0.0.1-preview-01
Prefix Reserved
dotnet add package Stef.Microsoft.SemanticKernel.WithRetry --version 0.0.1-preview-01
NuGet\Install-Package Stef.Microsoft.SemanticKernel.WithRetry -Version 0.0.1-preview-01
<PackageReference Include="Stef.Microsoft.SemanticKernel.WithRetry" Version="0.0.1-preview-01" />
<PackageVersion Include="Stef.Microsoft.SemanticKernel.WithRetry" Version="0.0.1-preview-01" />
<PackageReference Include="Stef.Microsoft.SemanticKernel.WithRetry" />
paket add Stef.Microsoft.SemanticKernel.WithRetry --version 0.0.1-preview-01
#r "nuget: Stef.Microsoft.SemanticKernel.WithRetry, 0.0.1-preview-01"
#:package Stef.Microsoft.SemanticKernel.WithRetry@0.0.1-preview-01
#addin nuget:?package=Stef.Microsoft.SemanticKernel.WithRetry&version=0.0.1-preview-01&prerelease
#tool nuget:?package=Stef.Microsoft.SemanticKernel.WithRetry&version=0.0.1-preview-01&prerelease
Microsoft.SemanticKernel.WithRetry
This is an extension for the Microsoft.SemanticKernel to handle 'Rate limit reached' exceptions using retries.
Info
Semantic Kernel is a model-agnostic SDK that empowers developers to build, orchestrate, and deploy AI agents and multi-agent systems. Whether you're building a simple chatbot or a complex multi-agent workflow, Semantic Kernel provides the tools you need with enterprise-grade reliability and flexibility.
This project can be used to handle exceptions like:
HTTP 429 (tokens: rate_limit_exceeded)
Rate limit reached for gpt-4o in organization org-xxxxxxxxxxxxxxxxxxxxxxxx on tokens per min (TPM): Limit 30000, Used 27855, Requested 5405. Please try again in 6.52s. Visit https://platform.openai.com/account/rate-limits to learn more.
Usage for OpenAI
Before
var builder = Kernel.CreateBuilder();
builder.Services.AddOpenAIChatCompletion(
serviceId: "openai",
modelId: "gpt-4o",
apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")!
);
After
var builder = Kernel.CreateBuilder();
builder.Services.AddOpenAIChatCompletionWithRetry(
modelId: "gpt-4o",
apiKey: Environment.GetEnvironmentVariable("OPENAI_API_KEY")!
);
Usage for Azure OpenAI
Before
var builder = Kernel.CreateBuilder();
builder.Services.AddAzureOpenAIChatCompletion(
deploymentName: "gpt-4o",
apiKey: Environment.GetEnvironmentVariable("AZURE_OPENAI_API_KEY")!,
endpoint: Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT")!
);
After
var builder = Kernel.CreateBuilder();
builder.Services.AddAzureOpenAIChatCompletionWithRetry(
deploymentName: "gpt-4o",
apiKey: Environment.GetEnvironmentVariable("AZURE_OPENAI_API_KEY")!,
endpoint: Environment.GetEnvironmentVariable("AZURE_OPENAI_ENDPOINT")!
);
Sponsors
Entity Framework Extensions and Dapper Plus are major sponsors and proud to contribute to the development of JsonConverter.
| 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
- Microsoft.Extensions.Http.Resilience (>= 8.10.0)
- Microsoft.SemanticKernel (>= 1.70.0)
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.0.1-preview-01 | 104 | 2/8/2026 |
.

