Skip to content

Commit

Permalink
.Net: Disable Azure SDK network timeout when a custom HttpClient is s…
Browse files Browse the repository at this point in the history
…upplied (#5553)

Fixes #5310
  • Loading branch information
stephentoub committed Mar 20, 2024
1 parent 1157fe3 commit 02866be
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -749,6 +749,7 @@ internal static OpenAIClientOptions GetOpenAIClientOptions(HttpClient? httpClien
{
options.Transport = new HttpClientTransport(httpClient);
options.RetryPolicy = new RetryPolicy(maxRetries: 0); // Disable Azure SDK retry policy if and only if a custom HttpClient is provided.
options.Retry.NetworkTimeout = Timeout.InfiniteTimeSpan; // Disable Azure SDK default timeout
}

return options;
Expand Down

0 comments on commit 02866be

Please sign in to comment.