From a8cc580fa39fbb3e6469f4822edc14a8467c7fc4 Mon Sep 17 00:00:00 2001 From: Ryan Sweet Date: Fri, 16 Jun 2023 12:30:13 -0700 Subject: [PATCH] Update Program.cs add more http retries --- cli/Program.cs | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/cli/Program.cs b/cli/Program.cs index f6da1b116..4fa1f3cc6 100644 --- a/cli/Program.cs +++ b/cli/Program.cs @@ -31,7 +31,18 @@ class Program .WithLogger(loggerFactory.CreateLogger()) .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( @@ -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"; } \ No newline at end of file +public static class Developer { public static string Implement="Implement"; }