Update Program.cs

add more http retries
This commit is contained in:
Ryan Sweet 2023-06-16 12:30:13 -07:00 committed by GitHub
parent fdd4422a32
commit a8cc580fa3

View File

@ -31,7 +31,18 @@ class Program
.WithLogger(loggerFactory.CreateLogger<IKernel>())
.WithAzureChatCompletionService(kernelSettings.DeploymentOrModelId, kernelSettings.Endpoint, kernelSettings.ApiKey, true, kernelSettings.ServiceId, true)
.WithMemory(semanticTextMemory)
.WithConfiguration(kernelConfig).Build();
.WithConfiguration(kernelConfig)
.Configure(c => c.SetDefaultHttpRetryConfig(new HttpRetryConfig
{
MaxRetryCount = 6,
UseExponentialBackoff = true,
// MinRetryDelay = TimeSpan.FromSeconds(2),
// MaxRetryDelay = TimeSpan.FromSeconds(8),
// MaxTotalRetryTime = TimeSpan.FromSeconds(30),
// RetryableStatusCodes = new[] { HttpStatusCode.TooManyRequests, HttpStatusCode.RequestTimeout },
// RetryableExceptions = new[] { typeof(HttpRequestException) }
}))
.Build();
var fileOption = new Option<FileInfo?>(
@ -139,4 +150,4 @@ class Program
public static class PM { public static string Readme = "Readme"; public static string BootstrapProject = "BootstrapProject"; }
public static class DevLead { public static string Plan="Plan"; }
public static class Developer { public static string Implement="Implement"; }
public static class Developer { public static string Implement="Implement"; }