Implemented rate limit handling for providers

This commit is contained in:
tsommer committed 2024-12-31 19:29:38 +01:00
1 parent e932c21709
commit 45ca0cdb23
10 files changed
+217 -101

No files matched your search

@@ -0,0 +1,23 @@
namespace AIStudio.Tools;
/// <summary>
/// The result of a rate-limited HTTP stream.
/// </summary>
/// <param name="IsFailedAfterAllRetries">True, when the stream failed after all retries.</param>
/// <param name="ErrorMessage">The error message which we might show to the user.</param>
/// <param name="Response">The response from the server.</param>
public readonly record struct HttpRateLimitedStreamResult(
bool IsSuccessful,
bool IsFailedAfterAllRetries,
string ErrorMessage,
HttpResponseMessage? Response) : IDisposable
{
#region IDisposable
public void Dispose()
{
this.Response?.Dispose();
}
#endregion
}