diff --git a/src/libs/Mistral/Generated/Mistral.AudioSpeechClient.Speech.g.cs b/src/libs/Mistral/Generated/Mistral.AudioSpeechClient.Speech.g.cs
index 5b8a606f..b4f479ed 100644
--- a/src/libs/Mistral/Generated/Mistral.AudioSpeechClient.Speech.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.AudioSpeechClient.Speech.g.cs
@@ -51,6 +51,29 @@ partial void ProcessSpeechResponseContent(
///
public async global::System.Threading.Tasks.Task SpeechAsync(
+ global::Mistral.SpeechRequest request,
+ global::Mistral.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await SpeechAsResponseAsync(
+
+ request: request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Speech
+ /// Generate speech from text using a saved voice or a reference audio clip.
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> SpeechAsResponseAsync(
+
global::Mistral.SpeechRequest request,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
@@ -90,10 +113,11 @@ partial void ProcessSpeechResponseContent(
var __maxAttempts = global::Mistral.AutoSDKRequestOptionsSupport.GetMaxAttempts(
clientOptions: Options,
requestOptions: requestOptions,
- supportsRetry: true);
+ supportsRetry: false);
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Mistral.PathBuilder(
path: "/v1/audio/speech",
baseUri: HttpClient.BaseAddress);
@@ -173,6 +197,8 @@ partial void ProcessSpeechResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -183,6 +209,11 @@ partial void ProcessSpeechResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -200,6 +231,8 @@ partial void ProcessSpeechResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -209,8 +242,7 @@ partial void ProcessSpeechResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -219,6 +251,11 @@ partial void ProcessSpeechResponseContent(
__attempt < __maxAttempts &&
global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -235,14 +272,15 @@ partial void ProcessSpeechResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -282,6 +320,8 @@ partial void ProcessSpeechResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -302,6 +342,8 @@ partial void ProcessSpeechResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -364,9 +406,13 @@ partial void ProcessSpeechResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Mistral.SpeechResponse.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Mistral.SpeechResponse.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -394,9 +440,13 @@ partial void ProcessSpeechResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Mistral.SpeechResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Mistral.SpeechResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Mistral/Generated/Mistral.AudioSpeechClient.SpeechAsStream.g.cs b/src/libs/Mistral/Generated/Mistral.AudioSpeechClient.SpeechAsStream.g.cs
index c5f9e0dc..9c6b438e 100644
--- a/src/libs/Mistral/Generated/Mistral.AudioSpeechClient.SpeechAsStream.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.AudioSpeechClient.SpeechAsStream.g.cs
@@ -85,10 +85,11 @@ partial void ProcessSpeechAsStreamResponse(
var __maxAttempts = global::Mistral.AutoSDKRequestOptionsSupport.GetMaxAttempts(
clientOptions: Options,
requestOptions: requestOptions,
- supportsRetry: true);
+ supportsRetry: false);
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Mistral.PathBuilder(
path: "/v1/audio/speech",
baseUri: HttpClient.BaseAddress);
@@ -168,6 +169,8 @@ partial void ProcessSpeechAsStreamResponse(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -178,6 +181,11 @@ partial void ProcessSpeechAsStreamResponse(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -195,6 +203,8 @@ partial void ProcessSpeechAsStreamResponse(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -204,8 +214,7 @@ partial void ProcessSpeechAsStreamResponse(
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -214,6 +223,11 @@ partial void ProcessSpeechAsStreamResponse(
__attempt < __maxAttempts &&
global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -230,14 +244,15 @@ partial void ProcessSpeechAsStreamResponse(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -277,6 +292,8 @@ partial void ProcessSpeechAsStreamResponse(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -297,6 +314,8 @@ partial void ProcessSpeechAsStreamResponse(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
diff --git a/src/libs/Mistral/Generated/Mistral.AudioSpeechClient.g.cs b/src/libs/Mistral/Generated/Mistral.AudioSpeechClient.g.cs
index f9a95d8e..1f37d34e 100644
--- a/src/libs/Mistral/Generated/Mistral.AudioSpeechClient.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.AudioSpeechClient.g.cs
@@ -73,10 +73,10 @@ public AudioSpeechClient(
/// Client-wide request defaults such as headers, query parameters, retries, and timeout.
/// Dispose the HttpClient when the instance is disposed. True by default.
public AudioSpeechClient(
- global::System.Net.Http.HttpClient? httpClient = null,
- global::System.Uri? baseUri = null,
- global::System.Collections.Generic.List? authorizations = null,
- global::Mistral.AutoSDKClientOptions? options = null,
+ global::System.Net.Http.HttpClient? httpClient,
+ global::System.Uri? baseUri,
+ global::System.Collections.Generic.List? authorizations,
+ global::Mistral.AutoSDKClientOptions? options,
bool disposeHttpClient = true)
{
diff --git a/src/libs/Mistral/Generated/Mistral.AudioTranscriptionsClient.CreateStreamingTranscriptionSse.g.cs b/src/libs/Mistral/Generated/Mistral.AudioTranscriptionsClient.CreateStreamingTranscriptionSse.g.cs
index 6f3e318a..f7e7f827 100644
--- a/src/libs/Mistral/Generated/Mistral.AudioTranscriptionsClient.CreateStreamingTranscriptionSse.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.AudioTranscriptionsClient.CreateStreamingTranscriptionSse.g.cs
@@ -75,10 +75,11 @@ partial void ProcessCreateStreamingTranscriptionSseResponse(
var __maxAttempts = global::Mistral.AutoSDKRequestOptionsSupport.GetMaxAttempts(
clientOptions: Options,
requestOptions: requestOptions,
- supportsRetry: true);
+ supportsRetry: false);
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Mistral.PathBuilder(
path: "/v1/audio/transcriptions#stream",
baseUri: HttpClient.BaseAddress);
@@ -111,10 +112,12 @@ partial void ProcessCreateStreamingTranscriptionSseResponse(
__httpRequest.Headers.Add(__authorization.Name, __authorization.Value);
}
}
+
var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent();
__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent(request.Model ?? string.Empty),
name: "\"model\"");
+
if (request.File != default)
{
@@ -155,64 +158,75 @@ request.Filename is null
{
__contentFile.Headers.ContentDisposition.FileNameStar = null;
}
- }
+
+ }
if (request.FileUrl != default)
{
__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent(request.FileUrl ?? string.Empty),
name: "\"file_url\"");
- }
+
+ }
if (request.FileId != default)
{
__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent(request.FileId ?? string.Empty),
name: "\"file_id\"");
- }
+
+ }
if (request.Language != default)
{
__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent(request.Language ?? string.Empty),
name: "\"language\"");
- }
+
+ }
if (request.Temperature != default)
{
__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Temperature, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty),
name: "\"temperature\"");
- }
+
+ }
if (request.Stream != default)
{
__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Stream, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()),
name: "\"stream\"");
- }
+
+ }
if (request.Diarize != default)
{
__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Diarize, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()),
name: "\"diarize\"");
- }
+
+ }
if (request.ContextBias != default)
{
__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.ContextBias, x => x))}]"),
name: "\"context_bias\"");
- }
+
+ }
if (request.TimestampGranularities != default)
{
__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.TimestampGranularities, x => x.ToValueString()))}]"),
name: "\"timestamp_granularities\"");
+
}
+
__httpRequest.Content = __httpRequestContent;
+
global::Mistral.AutoSDKRequestOptionsSupport.ApplyHeaders(
request: __httpRequest,
clientHeaders: Options.Headers,
@@ -254,6 +268,8 @@ request.Filename is null
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -264,6 +280,11 @@ request.Filename is null
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -281,6 +302,8 @@ request.Filename is null
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -290,8 +313,7 @@ request.Filename is null
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -300,6 +322,11 @@ request.Filename is null
__attempt < __maxAttempts &&
global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -316,14 +343,15 @@ request.Filename is null
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -363,6 +391,8 @@ request.Filename is null
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -383,6 +413,8 @@ request.Filename is null
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -535,5 +567,512 @@ request.Filename is null
yield return __response;
}
}
+
+ ///
+ /// Create Streaming Transcription (SSE)
+ ///
+ ///
+ ///
+ /// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464
+ ///
+ ///
+ /// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464
+ ///
+ ///
+ /// Url of a file to be transcribed
+ /// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464
+ ///
+ ///
+ /// ID of a file uploaded to /v1/files
+ /// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464
+ ///
+ ///
+ /// Language of the audio, e.g. 'en'. Providing the language can boost accuracy.
+ /// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464
+ ///
+ ///
+ /// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464
+ ///
+ ///
+ /// Default Value: true
+ ///
+ ///
+ /// Default Value: false
+ ///
+ ///
+ /// Default Value: []
+ ///
+ ///
+ /// Granularities of timestamps to include in the response.
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Collections.Generic.IAsyncEnumerable CreateStreamingTranscriptionSseAsync(
+ string model,
+ global::System.IO.Stream? file = default,
+ string? filename = default,
+ string? fileUrl = default,
+ string? fileId = default,
+ string? language = default,
+ double? temperature = default,
+ bool? stream = default,
+ bool? diarize = default,
+ global::System.Collections.Generic.IList? contextBias = default,
+ global::System.Collections.Generic.IList? timestampGranularities = default,
+ global::Mistral.AutoSDKRequestOptions? requestOptions = default,
+ [global::System.Runtime.CompilerServices.EnumeratorCancellation] global::System.Threading.CancellationToken cancellationToken = default)
+ {
+
+ var request = new global::Mistral.AudioTranscriptionRequestStream
+ {
+ Model = model,
+ File = global::System.Array.Empty(),
+ Filename = filename,
+ FileUrl = fileUrl,
+ FileId = fileId,
+ Language = language,
+ Temperature = temperature,
+ Stream = stream,
+ Diarize = diarize,
+ ContextBias = contextBias,
+ TimestampGranularities = timestampGranularities,
+ };
+ PrepareArguments(
+ client: HttpClient);
+ PrepareCreateStreamingTranscriptionSseArguments(
+ httpClient: HttpClient,
+ request: request);
+
+
+ var __authorizations = global::Mistral.EndPointSecurityResolver.ResolveAuthorizations(
+ availableAuthorizations: Authorizations,
+ securityRequirements: s_CreateStreamingTranscriptionSseSecurityRequirements,
+ operationName: "CreateStreamingTranscriptionSseAsync");
+
+ using var __timeoutCancellationTokenSource = global::Mistral.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken);
+ var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
+ var __effectiveReadResponseAsString = global::Mistral.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ fallbackValue: ReadResponseAsString);
+ var __maxAttempts = global::Mistral.AutoSDKRequestOptionsSupport.GetMaxAttempts(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ supportsRetry: false);
+
+ global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
+ {
+
+ var __pathBuilder = new global::Mistral.PathBuilder(
+ path: "/v1/audio/transcriptions#stream",
+ baseUri: HttpClient.BaseAddress);
+ var __path = __pathBuilder.ToString();
+ __path = global::Mistral.AutoSDKRequestOptionsSupport.AppendQueryParameters(
+ path: __path,
+ clientParameters: Options.QueryParameters,
+ requestParameters: requestOptions?.QueryParameters);
+ var __httpRequest = new global::System.Net.Http.HttpRequestMessage(
+ method: global::System.Net.Http.HttpMethod.Post,
+ requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute));
+#if NET6_0_OR_GREATER
+ __httpRequest.Version = global::System.Net.HttpVersion.Version11;
+ __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher;
+#endif
+
+ foreach (var __authorization in __authorizations)
+ {
+ if (__authorization.Type == "Http" ||
+ __authorization.Type == "OAuth2" ||
+ __authorization.Type == "OpenIdConnect")
+ {
+ __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue(
+ scheme: __authorization.Name,
+ parameter: __authorization.Value);
+ }
+ else if (__authorization.Type == "ApiKey" &&
+ __authorization.Location == "Header")
+ {
+ __httpRequest.Headers.Add(__authorization.Name, __authorization.Value);
+ }
+ }
+
+ var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent();
+ __httpRequestContent.Add(
+ content: new global::System.Net.Http.StringContent(request.Model ?? string.Empty),
+ name: "\"model\"");
+
+ if (file != default)
+ {
+
+ var __contentFile = new global::System.Net.Http.StreamContent(file);
+ __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue(
+ request.Filename is null
+ ? "application/octet-stream"
+ : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch
+ {
+ ".aac" => "audio/aac",
+ ".flac" => "audio/flac",
+ ".gif" => "image/gif",
+ ".jpeg" => "image/jpeg",
+ ".jpg" => "image/jpeg",
+ ".json" => "application/json",
+ ".m4a" => "audio/mp4",
+ ".mp3" => "audio/mpeg",
+ ".mp4" => "video/mp4",
+ ".mpeg" => "audio/mpeg",
+ ".mpga" => "audio/mpeg",
+ ".oga" => "audio/ogg",
+ ".ogg" => "audio/ogg",
+ ".opus" => "audio/ogg",
+ ".pdf" => "application/pdf",
+ ".png" => "image/png",
+ ".txt" => "text/plain",
+ ".wav" => "audio/wav",
+ ".weba" => "audio/webm",
+ ".webm" => "video/webm",
+ ".webp" => "image/webp",
+ _ => "application/octet-stream",
+ });
+ __httpRequestContent.Add(
+ content: __contentFile,
+ name: "\"file\"",
+ fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty);
+ if (__contentFile.Headers.ContentDisposition != null)
+ {
+ __contentFile.Headers.ContentDisposition.FileNameStar = null;
+ }
+
+ }
+ if (request.FileUrl != default)
+ {
+
+ __httpRequestContent.Add(
+ content: new global::System.Net.Http.StringContent(request.FileUrl ?? string.Empty),
+ name: "\"file_url\"");
+
+ }
+ if (request.FileId != default)
+ {
+
+ __httpRequestContent.Add(
+ content: new global::System.Net.Http.StringContent(request.FileId ?? string.Empty),
+ name: "\"file_id\"");
+
+ }
+ if (request.Language != default)
+ {
+
+ __httpRequestContent.Add(
+ content: new global::System.Net.Http.StringContent(request.Language ?? string.Empty),
+ name: "\"language\"");
+
+ }
+ if (request.Temperature != default)
+ {
+
+ __httpRequestContent.Add(
+ content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Temperature, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty),
+ name: "\"temperature\"");
+
+ }
+ if (request.Stream != default)
+ {
+
+ __httpRequestContent.Add(
+ content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Stream, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()),
+ name: "\"stream\"");
+
+ }
+ if (request.Diarize != default)
+ {
+
+ __httpRequestContent.Add(
+ content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Diarize, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()),
+ name: "\"diarize\"");
+
+ }
+ if (request.ContextBias != default)
+ {
+
+ __httpRequestContent.Add(
+ content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.ContextBias, x => x))}]"),
+ name: "\"context_bias\"");
+
+ }
+ if (request.TimestampGranularities != default)
+ {
+
+ __httpRequestContent.Add(
+ content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.TimestampGranularities, x => x.ToValueString()))}]"),
+ name: "\"timestamp_granularities\"");
+
+ }
+
+ __httpRequest.Content = __httpRequestContent;
+
+ global::Mistral.AutoSDKRequestOptionsSupport.ApplyHeaders(
+ request: __httpRequest,
+ clientHeaders: Options.Headers,
+ requestHeaders: requestOptions?.Headers);
+
+ PrepareRequest(
+ client: HttpClient,
+ request: __httpRequest);
+ PrepareCreateStreamingTranscriptionSseRequest(
+ httpClient: HttpClient,
+ httpRequestMessage: __httpRequest,
+ request: request);
+
+ return __httpRequest;
+ }
+
+ global::System.Net.Http.HttpRequestMessage? __httpRequest = null;
+ global::System.Net.Http.HttpResponseMessage? __response = null;
+ var __attemptNumber = 0;
+ try
+ {
+ for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++)
+ {
+ __attemptNumber = __attempt;
+ __httpRequest = __CreateHttpRequest();
+ await global::Mistral.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
+ clientOptions: Options,
+ context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "CreateStreamingTranscriptionSse",
+ methodName: "CreateStreamingTranscriptionSseAsync",
+ pathTemplate: "\"/v1/audio/transcriptions#stream\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ try
+ {
+ __response = await HttpClient.SendAsync(
+ request: __httpRequest,
+ completionOption: global::System.Net.Http.HttpCompletionOption.ResponseHeadersRead,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ }
+ catch (global::System.Net.Http.HttpRequestException __exception)
+ {
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
+ var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
+ await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "CreateStreamingTranscriptionSse",
+ methodName: "CreateStreamingTranscriptionSseAsync",
+ pathTemplate: "\"/v1/audio/transcriptions#stream\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: __exception,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ if (!__willRetry)
+ {
+ throw;
+ }
+
+ __httpRequest.Dispose();
+ __httpRequest = null;
+ await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ if (__response != null &&
+ __attempt < __maxAttempts &&
+ global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
+ {
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
+ await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "CreateStreamingTranscriptionSse",
+ methodName: "CreateStreamingTranscriptionSseAsync",
+ pathTemplate: "\"/v1/audio/transcriptions#stream\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ __response.Dispose();
+ __response = null;
+ __httpRequest.Dispose();
+ __httpRequest = null;
+ await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ break;
+ }
+
+ if (__response == null)
+ {
+ throw new global::System.InvalidOperationException("No response received.");
+ }
+
+ using (__response)
+ {
+
+ ProcessResponse(
+ client: HttpClient,
+ response: __response);
+ ProcessCreateStreamingTranscriptionSseResponse(
+ httpClient: HttpClient,
+ httpResponseMessage: __response);
+ if (__response.IsSuccessStatusCode)
+ {
+ await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
+ clientOptions: Options,
+ context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "CreateStreamingTranscriptionSse",
+ methodName: "CreateStreamingTranscriptionSseAsync",
+ pathTemplate: "\"/v1/audio/transcriptions#stream\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ else
+ {
+ await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "CreateStreamingTranscriptionSse",
+ methodName: "CreateStreamingTranscriptionSseAsync",
+ pathTemplate: "\"/v1/audio/transcriptions#stream\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+ }
+ catch (global::System.Net.Http.HttpRequestException __ex)
+ {
+ string? __content = null;
+ try
+ {
+ __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+ }
+ catch (global::System.Exception)
+ {
+ }
+
+ throw new global::Mistral.ApiException(
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ statusCode: __response.StatusCode)
+ {
+ ResponseBody = __content,
+ ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value),
+ };
+ }
+
+ using var __stream = await __response.Content.ReadAsStreamAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ await foreach (var __sseEvent in global::System.Net.ServerSentEvents.SseParser
+ .Create(__stream).EnumerateAsync(__effectiveCancellationToken))
+ {
+ var __content = __sseEvent.Data;
+ if (__content == "[DONE]")
+ {
+ yield break;
+ }
+
+ var __streamedResponse = global::Mistral.TranscriptionStreamEvents.FromJson(__content, JsonSerializerContext) ??
+ throw new global::Mistral.ApiException(
+ message: $"Response deserialization failed for \"{__content}\" ",
+ statusCode: __response.StatusCode)
+ {
+ ResponseBody = __content,
+ ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value),
+ };
+
+ yield return __streamedResponse;
+ }
+
+ }
+ }
+ finally
+ {
+ __httpRequest?.Dispose();
+ }
+ }
}
}
\ No newline at end of file
diff --git a/src/libs/Mistral/Generated/Mistral.AudioTranscriptionsClient.CreateTranscription.g.cs b/src/libs/Mistral/Generated/Mistral.AudioTranscriptionsClient.CreateTranscription.g.cs
index eae18f4a..1af6a7f3 100644
--- a/src/libs/Mistral/Generated/Mistral.AudioTranscriptionsClient.CreateTranscription.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.AudioTranscriptionsClient.CreateTranscription.g.cs
@@ -50,6 +50,28 @@ partial void ProcessCreateTranscriptionResponseContent(
///
public async global::System.Threading.Tasks.Task CreateTranscriptionAsync(
+ global::Mistral.AudioTranscriptionRequest request,
+ global::Mistral.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await CreateTranscriptionAsResponseAsync(
+
+ request: request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Create Transcription
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> CreateTranscriptionAsResponseAsync(
+
global::Mistral.AudioTranscriptionRequest request,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
@@ -80,10 +102,11 @@ partial void ProcessCreateTranscriptionResponseContent(
var __maxAttempts = global::Mistral.AutoSDKRequestOptionsSupport.GetMaxAttempts(
clientOptions: Options,
requestOptions: requestOptions,
- supportsRetry: true);
+ supportsRetry: false);
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Mistral.PathBuilder(
path: "/v1/audio/transcriptions",
baseUri: HttpClient.BaseAddress);
@@ -116,10 +139,12 @@ partial void ProcessCreateTranscriptionResponseContent(
__httpRequest.Headers.Add(__authorization.Name, __authorization.Value);
}
}
+
var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent();
__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent(request.Model ?? string.Empty),
name: "\"model\"");
+
if (request.File != default)
{
@@ -160,64 +185,75 @@ request.Filename is null
{
__contentFile.Headers.ContentDisposition.FileNameStar = null;
}
- }
+
+ }
if (request.FileUrl != default)
{
__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent(request.FileUrl ?? string.Empty),
name: "\"file_url\"");
- }
+
+ }
if (request.FileId != default)
{
__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent(request.FileId ?? string.Empty),
name: "\"file_id\"");
- }
+
+ }
if (request.Language != default)
{
__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent(request.Language ?? string.Empty),
name: "\"language\"");
- }
+
+ }
if (request.Temperature != default)
{
__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Temperature, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty),
name: "\"temperature\"");
- }
+
+ }
if (request.Stream != default)
{
__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Stream, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()),
name: "\"stream\"");
- }
+
+ }
if (request.Diarize != default)
{
__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Diarize, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()),
name: "\"diarize\"");
- }
+
+ }
if (request.ContextBias != default)
{
__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.ContextBias, x => x))}]"),
name: "\"context_bias\"");
- }
+
+ }
if (request.TimestampGranularities != default)
{
__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.TimestampGranularities, x => x.ToValueString()))}]"),
name: "\"timestamp_granularities\"");
+
}
+
__httpRequest.Content = __httpRequestContent;
+
global::Mistral.AutoSDKRequestOptionsSupport.ApplyHeaders(
request: __httpRequest,
clientHeaders: Options.Headers,
@@ -259,6 +295,8 @@ request.Filename is null
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -269,6 +307,11 @@ request.Filename is null
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -286,6 +329,8 @@ request.Filename is null
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -295,8 +340,7 @@ request.Filename is null
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -305,6 +349,11 @@ request.Filename is null
__attempt < __maxAttempts &&
global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -321,14 +370,15 @@ request.Filename is null
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -368,6 +418,8 @@ request.Filename is null
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -388,6 +440,8 @@ request.Filename is null
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -412,9 +466,13 @@ request.Filename is null
{
__response.EnsureSuccessStatusCode();
- return
- global::Mistral.TranscriptionResponse.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Mistral.TranscriptionResponse.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -442,9 +500,13 @@ request.Filename is null
#endif
).ConfigureAwait(false);
- return
- await global::Mistral.TranscriptionResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Mistral.TranscriptionResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -559,5 +621,1074 @@ request.Filename is null
requestOptions: requestOptions,
cancellationToken: cancellationToken).ConfigureAwait(false);
}
+
+ ///
+ /// Create Transcription
+ ///
+ ///
+ /// ID of the model to be used.
+ ///
+ ///
+ /// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464
+ ///
+ ///
+ /// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464
+ ///
+ ///
+ /// Url of a file to be transcribed
+ /// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464
+ ///
+ ///
+ /// ID of a file uploaded to /v1/files
+ /// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464
+ ///
+ ///
+ /// Language of the audio, e.g. 'en'. Providing the language can boost accuracy.
+ /// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464
+ ///
+ ///
+ /// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464
+ ///
+ ///
+ /// Default Value: false
+ ///
+ ///
+ /// Default Value: false
+ ///
+ ///
+ /// Default Value: []
+ ///
+ ///
+ /// Granularities of timestamps to include in the response.
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task CreateTranscriptionAsync(
+ string model,
+ global::System.IO.Stream? file = default,
+ string? filename = default,
+ string? fileUrl = default,
+ string? fileId = default,
+ string? language = default,
+ double? temperature = default,
+ bool? stream = default,
+ bool? diarize = default,
+ global::System.Collections.Generic.IList? contextBias = default,
+ global::System.Collections.Generic.IList? timestampGranularities = default,
+ global::Mistral.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+
+ var request = new global::Mistral.AudioTranscriptionRequest
+ {
+ Model = model,
+ File = global::System.Array.Empty(),
+ Filename = filename,
+ FileUrl = fileUrl,
+ FileId = fileId,
+ Language = language,
+ Temperature = temperature,
+ Stream = stream,
+ Diarize = diarize,
+ ContextBias = contextBias,
+ TimestampGranularities = timestampGranularities,
+ };
+ PrepareArguments(
+ client: HttpClient);
+ PrepareCreateTranscriptionArguments(
+ httpClient: HttpClient,
+ request: request);
+
+
+ var __authorizations = global::Mistral.EndPointSecurityResolver.ResolveAuthorizations(
+ availableAuthorizations: Authorizations,
+ securityRequirements: s_CreateTranscriptionSecurityRequirements,
+ operationName: "CreateTranscriptionAsync");
+
+ using var __timeoutCancellationTokenSource = global::Mistral.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken);
+ var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
+ var __effectiveReadResponseAsString = global::Mistral.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ fallbackValue: ReadResponseAsString);
+ var __maxAttempts = global::Mistral.AutoSDKRequestOptionsSupport.GetMaxAttempts(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ supportsRetry: false);
+
+ global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
+ {
+
+ var __pathBuilder = new global::Mistral.PathBuilder(
+ path: "/v1/audio/transcriptions",
+ baseUri: HttpClient.BaseAddress);
+ var __path = __pathBuilder.ToString();
+ __path = global::Mistral.AutoSDKRequestOptionsSupport.AppendQueryParameters(
+ path: __path,
+ clientParameters: Options.QueryParameters,
+ requestParameters: requestOptions?.QueryParameters);
+ var __httpRequest = new global::System.Net.Http.HttpRequestMessage(
+ method: global::System.Net.Http.HttpMethod.Post,
+ requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute));
+#if NET6_0_OR_GREATER
+ __httpRequest.Version = global::System.Net.HttpVersion.Version11;
+ __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher;
+#endif
+
+ foreach (var __authorization in __authorizations)
+ {
+ if (__authorization.Type == "Http" ||
+ __authorization.Type == "OAuth2" ||
+ __authorization.Type == "OpenIdConnect")
+ {
+ __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue(
+ scheme: __authorization.Name,
+ parameter: __authorization.Value);
+ }
+ else if (__authorization.Type == "ApiKey" &&
+ __authorization.Location == "Header")
+ {
+ __httpRequest.Headers.Add(__authorization.Name, __authorization.Value);
+ }
+ }
+
+ var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent();
+ __httpRequestContent.Add(
+ content: new global::System.Net.Http.StringContent(request.Model ?? string.Empty),
+ name: "\"model\"");
+
+ if (file != default)
+ {
+
+ var __contentFile = new global::System.Net.Http.StreamContent(file);
+ __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue(
+ request.Filename is null
+ ? "application/octet-stream"
+ : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch
+ {
+ ".aac" => "audio/aac",
+ ".flac" => "audio/flac",
+ ".gif" => "image/gif",
+ ".jpeg" => "image/jpeg",
+ ".jpg" => "image/jpeg",
+ ".json" => "application/json",
+ ".m4a" => "audio/mp4",
+ ".mp3" => "audio/mpeg",
+ ".mp4" => "video/mp4",
+ ".mpeg" => "audio/mpeg",
+ ".mpga" => "audio/mpeg",
+ ".oga" => "audio/ogg",
+ ".ogg" => "audio/ogg",
+ ".opus" => "audio/ogg",
+ ".pdf" => "application/pdf",
+ ".png" => "image/png",
+ ".txt" => "text/plain",
+ ".wav" => "audio/wav",
+ ".weba" => "audio/webm",
+ ".webm" => "video/webm",
+ ".webp" => "image/webp",
+ _ => "application/octet-stream",
+ });
+ __httpRequestContent.Add(
+ content: __contentFile,
+ name: "\"file\"",
+ fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty);
+ if (__contentFile.Headers.ContentDisposition != null)
+ {
+ __contentFile.Headers.ContentDisposition.FileNameStar = null;
+ }
+
+ }
+ if (request.FileUrl != default)
+ {
+
+ __httpRequestContent.Add(
+ content: new global::System.Net.Http.StringContent(request.FileUrl ?? string.Empty),
+ name: "\"file_url\"");
+
+ }
+ if (request.FileId != default)
+ {
+
+ __httpRequestContent.Add(
+ content: new global::System.Net.Http.StringContent(request.FileId ?? string.Empty),
+ name: "\"file_id\"");
+
+ }
+ if (request.Language != default)
+ {
+
+ __httpRequestContent.Add(
+ content: new global::System.Net.Http.StringContent(request.Language ?? string.Empty),
+ name: "\"language\"");
+
+ }
+ if (request.Temperature != default)
+ {
+
+ __httpRequestContent.Add(
+ content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Temperature, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty),
+ name: "\"temperature\"");
+
+ }
+ if (request.Stream != default)
+ {
+
+ __httpRequestContent.Add(
+ content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Stream, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()),
+ name: "\"stream\"");
+
+ }
+ if (request.Diarize != default)
+ {
+
+ __httpRequestContent.Add(
+ content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Diarize, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()),
+ name: "\"diarize\"");
+
+ }
+ if (request.ContextBias != default)
+ {
+
+ __httpRequestContent.Add(
+ content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.ContextBias, x => x))}]"),
+ name: "\"context_bias\"");
+
+ }
+ if (request.TimestampGranularities != default)
+ {
+
+ __httpRequestContent.Add(
+ content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.TimestampGranularities, x => x.ToValueString()))}]"),
+ name: "\"timestamp_granularities\"");
+
+ }
+
+ __httpRequest.Content = __httpRequestContent;
+
+ global::Mistral.AutoSDKRequestOptionsSupport.ApplyHeaders(
+ request: __httpRequest,
+ clientHeaders: Options.Headers,
+ requestHeaders: requestOptions?.Headers);
+
+ PrepareRequest(
+ client: HttpClient,
+ request: __httpRequest);
+ PrepareCreateTranscriptionRequest(
+ httpClient: HttpClient,
+ httpRequestMessage: __httpRequest,
+ request: request);
+
+ return __httpRequest;
+ }
+
+ global::System.Net.Http.HttpRequestMessage? __httpRequest = null;
+ global::System.Net.Http.HttpResponseMessage? __response = null;
+ var __attemptNumber = 0;
+ try
+ {
+ for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++)
+ {
+ __attemptNumber = __attempt;
+ __httpRequest = __CreateHttpRequest();
+ await global::Mistral.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
+ clientOptions: Options,
+ context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "CreateTranscription",
+ methodName: "CreateTranscriptionAsync",
+ pathTemplate: "\"/v1/audio/transcriptions\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ try
+ {
+ __response = await HttpClient.SendAsync(
+ request: __httpRequest,
+ completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ }
+ catch (global::System.Net.Http.HttpRequestException __exception)
+ {
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
+ var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
+ await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "CreateTranscription",
+ methodName: "CreateTranscriptionAsync",
+ pathTemplate: "\"/v1/audio/transcriptions\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: __exception,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ if (!__willRetry)
+ {
+ throw;
+ }
+
+ __httpRequest.Dispose();
+ __httpRequest = null;
+ await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ if (__response != null &&
+ __attempt < __maxAttempts &&
+ global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
+ {
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
+ await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "CreateTranscription",
+ methodName: "CreateTranscriptionAsync",
+ pathTemplate: "\"/v1/audio/transcriptions\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ __response.Dispose();
+ __response = null;
+ __httpRequest.Dispose();
+ __httpRequest = null;
+ await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ break;
+ }
+
+ if (__response == null)
+ {
+ throw new global::System.InvalidOperationException("No response received.");
+ }
+
+ using (__response)
+ {
+
+ ProcessResponse(
+ client: HttpClient,
+ response: __response);
+ ProcessCreateTranscriptionResponse(
+ httpClient: HttpClient,
+ httpResponseMessage: __response);
+ if (__response.IsSuccessStatusCode)
+ {
+ await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
+ clientOptions: Options,
+ context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "CreateTranscription",
+ methodName: "CreateTranscriptionAsync",
+ pathTemplate: "\"/v1/audio/transcriptions\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ else
+ {
+ await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "CreateTranscription",
+ methodName: "CreateTranscriptionAsync",
+ pathTemplate: "\"/v1/audio/transcriptions\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+
+ if (__effectiveReadResponseAsString)
+ {
+ var __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ ProcessResponseContent(
+ client: HttpClient,
+ response: __response,
+ content: ref __content);
+ ProcessCreateTranscriptionResponseContent(
+ httpClient: HttpClient,
+ httpResponseMessage: __response,
+ content: ref __content);
+
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+
+ return
+ global::Mistral.TranscriptionResponse.FromJson(__content, JsonSerializerContext) ??
+ throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ }
+ catch (global::System.Exception __ex)
+ {
+ throw new global::Mistral.ApiException(
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ statusCode: __response.StatusCode)
+ {
+ ResponseBody = __content,
+ ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value),
+ };
+ }
+ }
+ else
+ {
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+ using var __content = await __response.Content.ReadAsStreamAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ return
+ await global::Mistral.TranscriptionResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ throw new global::System.InvalidOperationException("Response deserialization failed.");
+ }
+ catch (global::System.Exception __ex)
+ {
+ string? __content = null;
+ try
+ {
+ __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+ }
+ catch (global::System.Exception)
+ {
+ }
+
+ throw new global::Mistral.ApiException(
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ statusCode: __response.StatusCode)
+ {
+ ResponseBody = __content,
+ ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value),
+ };
+ }
+ }
+
+ }
+ }
+ finally
+ {
+ __httpRequest?.Dispose();
+ }
+ }
+ ///
+ /// Create Transcription
+ ///
+ ///
+ /// ID of the model to be used.
+ ///
+ ///
+ /// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464
+ ///
+ ///
+ /// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464
+ ///
+ ///
+ /// Url of a file to be transcribed
+ /// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464
+ ///
+ ///
+ /// ID of a file uploaded to /v1/files
+ /// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464
+ ///
+ ///
+ /// Language of the audio, e.g. 'en'. Providing the language can boost accuracy.
+ /// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464
+ ///
+ ///
+ /// Default Value: openapi-json-null-sentinel-value-2BF93600-0FE4-4250-987A-E5DDB203E464
+ ///
+ ///
+ /// Default Value: false
+ ///
+ ///
+ /// Default Value: false
+ ///
+ ///
+ /// Default Value: []
+ ///
+ ///
+ /// Granularities of timestamps to include in the response.
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> CreateTranscriptionAsResponseAsync(
+ string model,
+ global::System.IO.Stream? file = default,
+ string? filename = default,
+ string? fileUrl = default,
+ string? fileId = default,
+ string? language = default,
+ double? temperature = default,
+ bool? stream = default,
+ bool? diarize = default,
+ global::System.Collections.Generic.IList? contextBias = default,
+ global::System.Collections.Generic.IList? timestampGranularities = default,
+ global::Mistral.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+
+ var request = new global::Mistral.AudioTranscriptionRequest
+ {
+ Model = model,
+ File = global::System.Array.Empty(),
+ Filename = filename,
+ FileUrl = fileUrl,
+ FileId = fileId,
+ Language = language,
+ Temperature = temperature,
+ Stream = stream,
+ Diarize = diarize,
+ ContextBias = contextBias,
+ TimestampGranularities = timestampGranularities,
+ };
+ PrepareArguments(
+ client: HttpClient);
+ PrepareCreateTranscriptionArguments(
+ httpClient: HttpClient,
+ request: request);
+
+
+ var __authorizations = global::Mistral.EndPointSecurityResolver.ResolveAuthorizations(
+ availableAuthorizations: Authorizations,
+ securityRequirements: s_CreateTranscriptionSecurityRequirements,
+ operationName: "CreateTranscriptionAsync");
+
+ using var __timeoutCancellationTokenSource = global::Mistral.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken);
+ var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
+ var __effectiveReadResponseAsString = global::Mistral.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ fallbackValue: ReadResponseAsString);
+ var __maxAttempts = global::Mistral.AutoSDKRequestOptionsSupport.GetMaxAttempts(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ supportsRetry: false);
+
+ global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
+ {
+
+ var __pathBuilder = new global::Mistral.PathBuilder(
+ path: "/v1/audio/transcriptions",
+ baseUri: HttpClient.BaseAddress);
+ var __path = __pathBuilder.ToString();
+ __path = global::Mistral.AutoSDKRequestOptionsSupport.AppendQueryParameters(
+ path: __path,
+ clientParameters: Options.QueryParameters,
+ requestParameters: requestOptions?.QueryParameters);
+ var __httpRequest = new global::System.Net.Http.HttpRequestMessage(
+ method: global::System.Net.Http.HttpMethod.Post,
+ requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute));
+#if NET6_0_OR_GREATER
+ __httpRequest.Version = global::System.Net.HttpVersion.Version11;
+ __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher;
+#endif
+
+ foreach (var __authorization in __authorizations)
+ {
+ if (__authorization.Type == "Http" ||
+ __authorization.Type == "OAuth2" ||
+ __authorization.Type == "OpenIdConnect")
+ {
+ __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue(
+ scheme: __authorization.Name,
+ parameter: __authorization.Value);
+ }
+ else if (__authorization.Type == "ApiKey" &&
+ __authorization.Location == "Header")
+ {
+ __httpRequest.Headers.Add(__authorization.Name, __authorization.Value);
+ }
+ }
+
+ var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent();
+ __httpRequestContent.Add(
+ content: new global::System.Net.Http.StringContent(request.Model ?? string.Empty),
+ name: "\"model\"");
+
+ if (file != default)
+ {
+
+ var __contentFile = new global::System.Net.Http.StreamContent(file);
+ __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue(
+ request.Filename is null
+ ? "application/octet-stream"
+ : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch
+ {
+ ".aac" => "audio/aac",
+ ".flac" => "audio/flac",
+ ".gif" => "image/gif",
+ ".jpeg" => "image/jpeg",
+ ".jpg" => "image/jpeg",
+ ".json" => "application/json",
+ ".m4a" => "audio/mp4",
+ ".mp3" => "audio/mpeg",
+ ".mp4" => "video/mp4",
+ ".mpeg" => "audio/mpeg",
+ ".mpga" => "audio/mpeg",
+ ".oga" => "audio/ogg",
+ ".ogg" => "audio/ogg",
+ ".opus" => "audio/ogg",
+ ".pdf" => "application/pdf",
+ ".png" => "image/png",
+ ".txt" => "text/plain",
+ ".wav" => "audio/wav",
+ ".weba" => "audio/webm",
+ ".webm" => "video/webm",
+ ".webp" => "image/webp",
+ _ => "application/octet-stream",
+ });
+ __httpRequestContent.Add(
+ content: __contentFile,
+ name: "\"file\"",
+ fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty);
+ if (__contentFile.Headers.ContentDisposition != null)
+ {
+ __contentFile.Headers.ContentDisposition.FileNameStar = null;
+ }
+
+ }
+ if (request.FileUrl != default)
+ {
+
+ __httpRequestContent.Add(
+ content: new global::System.Net.Http.StringContent(request.FileUrl ?? string.Empty),
+ name: "\"file_url\"");
+
+ }
+ if (request.FileId != default)
+ {
+
+ __httpRequestContent.Add(
+ content: new global::System.Net.Http.StringContent(request.FileId ?? string.Empty),
+ name: "\"file_id\"");
+
+ }
+ if (request.Language != default)
+ {
+
+ __httpRequestContent.Add(
+ content: new global::System.Net.Http.StringContent(request.Language ?? string.Empty),
+ name: "\"language\"");
+
+ }
+ if (request.Temperature != default)
+ {
+
+ __httpRequestContent.Add(
+ content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Temperature, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty),
+ name: "\"temperature\"");
+
+ }
+ if (request.Stream != default)
+ {
+
+ __httpRequestContent.Add(
+ content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Stream, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()),
+ name: "\"stream\"");
+
+ }
+ if (request.Diarize != default)
+ {
+
+ __httpRequestContent.Add(
+ content: new global::System.Net.Http.StringContent((global::System.Convert.ToString(request.Diarize, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty).ToLowerInvariant()),
+ name: "\"diarize\"");
+
+ }
+ if (request.ContextBias != default)
+ {
+
+ __httpRequestContent.Add(
+ content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.ContextBias, x => x))}]"),
+ name: "\"context_bias\"");
+
+ }
+ if (request.TimestampGranularities != default)
+ {
+
+ __httpRequestContent.Add(
+ content: new global::System.Net.Http.StringContent($"[{string.Join(",", global::System.Linq.Enumerable.Select(request.TimestampGranularities, x => x.ToValueString()))}]"),
+ name: "\"timestamp_granularities\"");
+
+ }
+
+ __httpRequest.Content = __httpRequestContent;
+
+ global::Mistral.AutoSDKRequestOptionsSupport.ApplyHeaders(
+ request: __httpRequest,
+ clientHeaders: Options.Headers,
+ requestHeaders: requestOptions?.Headers);
+
+ PrepareRequest(
+ client: HttpClient,
+ request: __httpRequest);
+ PrepareCreateTranscriptionRequest(
+ httpClient: HttpClient,
+ httpRequestMessage: __httpRequest,
+ request: request);
+
+ return __httpRequest;
+ }
+
+ global::System.Net.Http.HttpRequestMessage? __httpRequest = null;
+ global::System.Net.Http.HttpResponseMessage? __response = null;
+ var __attemptNumber = 0;
+ try
+ {
+ for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++)
+ {
+ __attemptNumber = __attempt;
+ __httpRequest = __CreateHttpRequest();
+ await global::Mistral.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
+ clientOptions: Options,
+ context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "CreateTranscription",
+ methodName: "CreateTranscriptionAsync",
+ pathTemplate: "\"/v1/audio/transcriptions\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ try
+ {
+ __response = await HttpClient.SendAsync(
+ request: __httpRequest,
+ completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ }
+ catch (global::System.Net.Http.HttpRequestException __exception)
+ {
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
+ var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
+ await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "CreateTranscription",
+ methodName: "CreateTranscriptionAsync",
+ pathTemplate: "\"/v1/audio/transcriptions\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: __exception,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ if (!__willRetry)
+ {
+ throw;
+ }
+
+ __httpRequest.Dispose();
+ __httpRequest = null;
+ await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ if (__response != null &&
+ __attempt < __maxAttempts &&
+ global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
+ {
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
+ await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "CreateTranscription",
+ methodName: "CreateTranscriptionAsync",
+ pathTemplate: "\"/v1/audio/transcriptions\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ __response.Dispose();
+ __response = null;
+ __httpRequest.Dispose();
+ __httpRequest = null;
+ await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ break;
+ }
+
+ if (__response == null)
+ {
+ throw new global::System.InvalidOperationException("No response received.");
+ }
+
+ using (__response)
+ {
+
+ ProcessResponse(
+ client: HttpClient,
+ response: __response);
+ ProcessCreateTranscriptionResponse(
+ httpClient: HttpClient,
+ httpResponseMessage: __response);
+ if (__response.IsSuccessStatusCode)
+ {
+ await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
+ clientOptions: Options,
+ context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "CreateTranscription",
+ methodName: "CreateTranscriptionAsync",
+ pathTemplate: "\"/v1/audio/transcriptions\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ else
+ {
+ await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "CreateTranscription",
+ methodName: "CreateTranscriptionAsync",
+ pathTemplate: "\"/v1/audio/transcriptions\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+
+ if (__effectiveReadResponseAsString)
+ {
+ var __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ ProcessResponseContent(
+ client: HttpClient,
+ response: __response,
+ content: ref __content);
+ ProcessCreateTranscriptionResponseContent(
+ httpClient: HttpClient,
+ httpResponseMessage: __response,
+ content: ref __content);
+
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+
+ var __value = global::Mistral.TranscriptionResponse.FromJson(__content, JsonSerializerContext) ??
+ throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ throw new global::Mistral.ApiException(
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ statusCode: __response.StatusCode)
+ {
+ ResponseBody = __content,
+ ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value),
+ };
+ }
+ }
+ else
+ {
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+ using var __content = await __response.Content.ReadAsStreamAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ var __value = await global::Mistral.TranscriptionResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ string? __content = null;
+ try
+ {
+ __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+ }
+ catch (global::System.Exception)
+ {
+ }
+
+ throw new global::Mistral.ApiException(
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ statusCode: __response.StatusCode)
+ {
+ ResponseBody = __content,
+ ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value),
+ };
+ }
+ }
+
+ }
+ }
+ finally
+ {
+ __httpRequest?.Dispose();
+ }
+ }
}
}
\ No newline at end of file
diff --git a/src/libs/Mistral/Generated/Mistral.AudioTranscriptionsClient.g.cs b/src/libs/Mistral/Generated/Mistral.AudioTranscriptionsClient.g.cs
index c8daa48a..9b036933 100644
--- a/src/libs/Mistral/Generated/Mistral.AudioTranscriptionsClient.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.AudioTranscriptionsClient.g.cs
@@ -73,10 +73,10 @@ public AudioTranscriptionsClient(
/// Client-wide request defaults such as headers, query parameters, retries, and timeout.
/// Dispose the HttpClient when the instance is disposed. True by default.
public AudioTranscriptionsClient(
- global::System.Net.Http.HttpClient? httpClient = null,
- global::System.Uri? baseUri = null,
- global::System.Collections.Generic.List? authorizations = null,
- global::Mistral.AutoSDKClientOptions? options = null,
+ global::System.Net.Http.HttpClient? httpClient,
+ global::System.Uri? baseUri,
+ global::System.Collections.Generic.List? authorizations,
+ global::Mistral.AutoSDKClientOptions? options,
bool disposeHttpClient = true)
{
diff --git a/src/libs/Mistral/Generated/Mistral.AudioVoicesClient.CreateANewVoice.g.cs b/src/libs/Mistral/Generated/Mistral.AudioVoicesClient.CreateANewVoice.g.cs
index 441580c4..ebf047bc 100644
--- a/src/libs/Mistral/Generated/Mistral.AudioVoicesClient.CreateANewVoice.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.AudioVoicesClient.CreateANewVoice.g.cs
@@ -51,6 +51,29 @@ partial void ProcessCreateANewVoiceResponseContent(
///
public async global::System.Threading.Tasks.Task CreateANewVoiceAsync(
+ global::Mistral.VoiceCreateRequest request,
+ global::Mistral.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await CreateANewVoiceAsResponseAsync(
+
+ request: request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Create a new voice
+ /// Create a new voice with a base64-encoded audio sample
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> CreateANewVoiceAsResponseAsync(
+
global::Mistral.VoiceCreateRequest request,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
@@ -85,6 +108,7 @@ partial void ProcessCreateANewVoiceResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Mistral.PathBuilder(
path: "/v1/audio/voices",
baseUri: HttpClient.BaseAddress);
@@ -164,6 +188,8 @@ partial void ProcessCreateANewVoiceResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -174,6 +200,11 @@ partial void ProcessCreateANewVoiceResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -191,6 +222,8 @@ partial void ProcessCreateANewVoiceResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -200,8 +233,7 @@ partial void ProcessCreateANewVoiceResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -210,6 +242,11 @@ partial void ProcessCreateANewVoiceResponseContent(
__attempt < __maxAttempts &&
global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -226,14 +263,15 @@ partial void ProcessCreateANewVoiceResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -273,6 +311,8 @@ partial void ProcessCreateANewVoiceResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -293,6 +333,8 @@ partial void ProcessCreateANewVoiceResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -355,9 +397,13 @@ partial void ProcessCreateANewVoiceResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Mistral.VoiceResponse.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Mistral.VoiceResponse.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -385,9 +431,13 @@ partial void ProcessCreateANewVoiceResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Mistral.VoiceResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Mistral.VoiceResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Mistral/Generated/Mistral.AudioVoicesClient.DeleteACustomVoice.g.cs b/src/libs/Mistral/Generated/Mistral.AudioVoicesClient.DeleteACustomVoice.g.cs
index dbd54811..3cd4da14 100644
--- a/src/libs/Mistral/Generated/Mistral.AudioVoicesClient.DeleteACustomVoice.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.AudioVoicesClient.DeleteACustomVoice.g.cs
@@ -53,6 +53,27 @@ partial void ProcessDeleteACustomVoiceResponseContent(
global::System.Guid voiceId,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await DeleteACustomVoiceAsResponseAsync(
+ voiceId: voiceId,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Delete a custom voice
+ /// Delete a custom voice
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> DeleteACustomVoiceAsResponseAsync(
+ global::System.Guid voiceId,
+ global::Mistral.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -82,6 +103,7 @@ partial void ProcessDeleteACustomVoiceResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Mistral.PathBuilder(
path: $"/v1/audio/voices/{voiceId}",
baseUri: HttpClient.BaseAddress);
@@ -155,6 +177,8 @@ partial void ProcessDeleteACustomVoiceResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -165,6 +189,11 @@ partial void ProcessDeleteACustomVoiceResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -182,6 +211,8 @@ partial void ProcessDeleteACustomVoiceResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -191,8 +222,7 @@ partial void ProcessDeleteACustomVoiceResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -201,6 +231,11 @@ partial void ProcessDeleteACustomVoiceResponseContent(
__attempt < __maxAttempts &&
global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -217,14 +252,15 @@ partial void ProcessDeleteACustomVoiceResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -264,6 +300,8 @@ partial void ProcessDeleteACustomVoiceResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -284,6 +322,8 @@ partial void ProcessDeleteACustomVoiceResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -346,9 +386,13 @@ partial void ProcessDeleteACustomVoiceResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Mistral.VoiceResponse.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Mistral.VoiceResponse.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -376,9 +420,13 @@ partial void ProcessDeleteACustomVoiceResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Mistral.VoiceResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Mistral.VoiceResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Mistral/Generated/Mistral.AudioVoicesClient.GetVoiceDetails.g.cs b/src/libs/Mistral/Generated/Mistral.AudioVoicesClient.GetVoiceDetails.g.cs
index 27406b3d..382d134a 100644
--- a/src/libs/Mistral/Generated/Mistral.AudioVoicesClient.GetVoiceDetails.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.AudioVoicesClient.GetVoiceDetails.g.cs
@@ -53,6 +53,27 @@ partial void ProcessGetVoiceDetailsResponseContent(
string voiceId,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await GetVoiceDetailsAsResponseAsync(
+ voiceId: voiceId,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Get voice details
+ /// Get voice details (excluding sample)
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> GetVoiceDetailsAsResponseAsync(
+ string voiceId,
+ global::Mistral.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -82,6 +103,7 @@ partial void ProcessGetVoiceDetailsResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Mistral.PathBuilder(
path: $"/v1/audio/voices/{voiceId}",
baseUri: HttpClient.BaseAddress);
@@ -155,6 +177,8 @@ partial void ProcessGetVoiceDetailsResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -165,6 +189,11 @@ partial void ProcessGetVoiceDetailsResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -182,6 +211,8 @@ partial void ProcessGetVoiceDetailsResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -191,8 +222,7 @@ partial void ProcessGetVoiceDetailsResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -201,6 +231,11 @@ partial void ProcessGetVoiceDetailsResponseContent(
__attempt < __maxAttempts &&
global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -217,14 +252,15 @@ partial void ProcessGetVoiceDetailsResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -264,6 +300,8 @@ partial void ProcessGetVoiceDetailsResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -284,6 +322,8 @@ partial void ProcessGetVoiceDetailsResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -346,9 +386,13 @@ partial void ProcessGetVoiceDetailsResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Mistral.VoiceResponse.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Mistral.VoiceResponse.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -376,9 +420,13 @@ partial void ProcessGetVoiceDetailsResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Mistral.VoiceResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Mistral.VoiceResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Mistral/Generated/Mistral.AudioVoicesClient.GetVoiceSampleAudio.g.cs b/src/libs/Mistral/Generated/Mistral.AudioVoicesClient.GetVoiceSampleAudio.g.cs
index e2055fbe..38201b86 100644
--- a/src/libs/Mistral/Generated/Mistral.AudioVoicesClient.GetVoiceSampleAudio.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.AudioVoicesClient.GetVoiceSampleAudio.g.cs
@@ -53,6 +53,27 @@ partial void ProcessGetVoiceSampleAudioResponseContent(
string voiceId,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await GetVoiceSampleAudioAsResponseAsync(
+ voiceId: voiceId,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Get voice sample audio
+ /// Get the audio sample for a voice
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> GetVoiceSampleAudioAsResponseAsync(
+ string voiceId,
+ global::Mistral.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -82,6 +103,7 @@ partial void ProcessGetVoiceSampleAudioResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Mistral.PathBuilder(
path: $"/v1/audio/voices/{voiceId}/sample",
baseUri: HttpClient.BaseAddress);
@@ -155,6 +177,8 @@ partial void ProcessGetVoiceSampleAudioResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -165,6 +189,11 @@ partial void ProcessGetVoiceSampleAudioResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -182,6 +211,8 @@ partial void ProcessGetVoiceSampleAudioResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -191,8 +222,7 @@ partial void ProcessGetVoiceSampleAudioResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -201,6 +231,11 @@ partial void ProcessGetVoiceSampleAudioResponseContent(
__attempt < __maxAttempts &&
global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -217,14 +252,15 @@ partial void ProcessGetVoiceSampleAudioResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -264,6 +300,8 @@ partial void ProcessGetVoiceSampleAudioResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -284,6 +322,8 @@ partial void ProcessGetVoiceSampleAudioResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -346,7 +386,11 @@ partial void ProcessGetVoiceSampleAudioResponseContent(
{
__response.EnsureSuccessStatusCode();
- return __content;
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __content);
}
catch (global::System.Exception __ex)
{
@@ -374,7 +418,11 @@ partial void ProcessGetVoiceSampleAudioResponseContent(
#endif
).ConfigureAwait(false);
- return __content;
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __content);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Mistral/Generated/Mistral.AudioVoicesClient.ListAllVoices.g.cs b/src/libs/Mistral/Generated/Mistral.AudioVoicesClient.ListAllVoices.g.cs
index 1008d4df..652325c2 100644
--- a/src/libs/Mistral/Generated/Mistral.AudioVoicesClient.ListAllVoices.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.AudioVoicesClient.ListAllVoices.g.cs
@@ -63,6 +63,36 @@ partial void ProcessListAllVoicesResponseContent(
int? offset = default,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await ListAllVoicesAsResponseAsync(
+ limit: limit,
+ offset: offset,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// List all voices
+ /// List all voices (excluding sample data)
+ ///
+ ///
+ /// Maximum number of voices to return
+ /// Default Value: 10
+ ///
+ ///
+ /// Offset for pagination
+ /// Default Value: 0
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> ListAllVoicesAsResponseAsync(
+ int? limit = default,
+ int? offset = default,
+ global::Mistral.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -93,12 +123,13 @@ partial void ProcessListAllVoicesResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Mistral.PathBuilder(
path: "/v1/audio/voices",
- baseUri: HttpClient.BaseAddress);
+ baseUri: HttpClient.BaseAddress);
__pathBuilder
.AddOptionalParameter("limit", limit?.ToString())
- .AddOptionalParameter("offset", offset?.ToString())
+ .AddOptionalParameter("offset", offset?.ToString())
;
var __path = __pathBuilder.ToString();
__path = global::Mistral.AutoSDKRequestOptionsSupport.AppendQueryParameters(
@@ -171,6 +202,8 @@ partial void ProcessListAllVoicesResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -181,6 +214,11 @@ partial void ProcessListAllVoicesResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -198,6 +236,8 @@ partial void ProcessListAllVoicesResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -207,8 +247,7 @@ partial void ProcessListAllVoicesResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -217,6 +256,11 @@ partial void ProcessListAllVoicesResponseContent(
__attempt < __maxAttempts &&
global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -233,14 +277,15 @@ partial void ProcessListAllVoicesResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -280,6 +325,8 @@ partial void ProcessListAllVoicesResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -300,6 +347,8 @@ partial void ProcessListAllVoicesResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -362,9 +411,13 @@ partial void ProcessListAllVoicesResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Mistral.VoiceListResponse.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Mistral.VoiceListResponse.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -392,9 +445,13 @@ partial void ProcessListAllVoicesResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Mistral.VoiceListResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Mistral.VoiceListResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Mistral/Generated/Mistral.AudioVoicesClient.UpdateVoiceMetadata.g.cs b/src/libs/Mistral/Generated/Mistral.AudioVoicesClient.UpdateVoiceMetadata.g.cs
index a7cef884..7f7c9c24 100644
--- a/src/libs/Mistral/Generated/Mistral.AudioVoicesClient.UpdateVoiceMetadata.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.AudioVoicesClient.UpdateVoiceMetadata.g.cs
@@ -55,6 +55,32 @@ partial void ProcessUpdateVoiceMetadataResponseContent(
public async global::System.Threading.Tasks.Task UpdateVoiceMetadataAsync(
global::System.Guid voiceId,
+ global::Mistral.VoiceUpdateRequest request,
+ global::Mistral.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await UpdateVoiceMetadataAsResponseAsync(
+ voiceId: voiceId,
+
+ request: request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Update voice metadata
+ /// Update voice metadata (name, gender, languages, age, tags).
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> UpdateVoiceMetadataAsResponseAsync(
+ global::System.Guid voiceId,
+
global::Mistral.VoiceUpdateRequest request,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
@@ -90,6 +116,7 @@ partial void ProcessUpdateVoiceMetadataResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Mistral.PathBuilder(
path: $"/v1/audio/voices/{voiceId}",
baseUri: HttpClient.BaseAddress);
@@ -170,6 +197,8 @@ partial void ProcessUpdateVoiceMetadataResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -180,6 +209,11 @@ partial void ProcessUpdateVoiceMetadataResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -197,6 +231,8 @@ partial void ProcessUpdateVoiceMetadataResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -206,8 +242,7 @@ partial void ProcessUpdateVoiceMetadataResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -216,6 +251,11 @@ partial void ProcessUpdateVoiceMetadataResponseContent(
__attempt < __maxAttempts &&
global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -232,14 +272,15 @@ partial void ProcessUpdateVoiceMetadataResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -279,6 +320,8 @@ partial void ProcessUpdateVoiceMetadataResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -299,6 +342,8 @@ partial void ProcessUpdateVoiceMetadataResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -361,9 +406,13 @@ partial void ProcessUpdateVoiceMetadataResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Mistral.VoiceResponse.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Mistral.VoiceResponse.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -391,9 +440,13 @@ partial void ProcessUpdateVoiceMetadataResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Mistral.VoiceResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Mistral.VoiceResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Mistral/Generated/Mistral.AudioVoicesClient.g.cs b/src/libs/Mistral/Generated/Mistral.AudioVoicesClient.g.cs
index 6fd4d46f..246447cc 100644
--- a/src/libs/Mistral/Generated/Mistral.AudioVoicesClient.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.AudioVoicesClient.g.cs
@@ -73,10 +73,10 @@ public AudioVoicesClient(
/// Client-wide request defaults such as headers, query parameters, retries, and timeout.
/// Dispose the HttpClient when the instance is disposed. True by default.
public AudioVoicesClient(
- global::System.Net.Http.HttpClient? httpClient = null,
- global::System.Uri? baseUri = null,
- global::System.Collections.Generic.List? authorizations = null,
- global::Mistral.AutoSDKClientOptions? options = null,
+ global::System.Net.Http.HttpClient? httpClient,
+ global::System.Uri? baseUri,
+ global::System.Collections.Generic.List? authorizations,
+ global::Mistral.AutoSDKClientOptions? options,
bool disposeHttpClient = true)
{
diff --git a/src/libs/Mistral/Generated/Mistral.AutoSDKHttpResponse.g.cs b/src/libs/Mistral/Generated/Mistral.AutoSDKHttpResponse.g.cs
new file mode 100644
index 00000000..72f57a85
--- /dev/null
+++ b/src/libs/Mistral/Generated/Mistral.AutoSDKHttpResponse.g.cs
@@ -0,0 +1,121 @@
+
+#nullable enable
+
+namespace Mistral
+{
+ ///
+ /// Represents a successful HTTP response with status code and headers.
+ ///
+ public partial class AutoSDKHttpResponse
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public AutoSDKHttpResponse(
+ global::System.Net.HttpStatusCode statusCode,
+ global::System.Collections.Generic.Dictionary> headers)
+ : this(
+ statusCode: statusCode,
+ headers: headers,
+ requestUri: null)
+ {
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public AutoSDKHttpResponse(
+ global::System.Net.HttpStatusCode statusCode,
+ global::System.Collections.Generic.Dictionary> headers,
+ global::System.Uri? requestUri)
+ {
+ StatusCode = statusCode;
+ Headers = headers ?? throw new global::System.ArgumentNullException(nameof(headers));
+ RequestUri = requestUri;
+ }
+
+ ///
+ /// Gets the HTTP status code.
+ ///
+ public global::System.Net.HttpStatusCode StatusCode { get; }
+ ///
+ /// Gets the response headers.
+ ///
+ public global::System.Collections.Generic.Dictionary> Headers { get; }
+ ///
+ /// Gets the final request URI associated with the response.
+ ///
+ public global::System.Uri? RequestUri { get; }
+
+ internal static global::System.Collections.Generic.Dictionary> CreateHeaders(
+ global::System.Net.Http.HttpResponseMessage response)
+ {
+ response = response ?? throw new global::System.ArgumentNullException(nameof(response));
+
+ var headers = global::System.Linq.Enumerable.ToDictionary(
+ response.Headers,
+ static header => header.Key,
+ static header => (global::System.Collections.Generic.IEnumerable)global::System.Linq.Enumerable.ToArray(header.Value),
+ global::System.StringComparer.OrdinalIgnoreCase);
+
+ if (response.Content?.Headers == null)
+ {
+ return headers;
+ }
+
+ foreach (var header in response.Content.Headers)
+ {
+ if (headers.TryGetValue(header.Key, out var existingValues))
+ {
+ headers[header.Key] = global::System.Linq.Enumerable.ToArray(
+ global::System.Linq.Enumerable.Concat(existingValues, header.Value));
+ }
+ else
+ {
+ headers[header.Key] = global::System.Linq.Enumerable.ToArray(header.Value);
+ }
+ }
+
+ return headers;
+ }
+ }
+
+ ///
+ /// Represents a successful HTTP response with status code, headers, and body.
+ ///
+ public partial class AutoSDKHttpResponse : AutoSDKHttpResponse
+ {
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public AutoSDKHttpResponse(
+ global::System.Net.HttpStatusCode statusCode,
+ global::System.Collections.Generic.Dictionary> headers,
+ T body)
+ : this(
+ statusCode: statusCode,
+ headers: headers,
+ requestUri: null,
+ body: body)
+ {
+ }
+
+ ///
+ /// Initializes a new instance of the class.
+ ///
+ public AutoSDKHttpResponse(
+ global::System.Net.HttpStatusCode statusCode,
+ global::System.Collections.Generic.Dictionary> headers,
+ global::System.Uri? requestUri,
+ T body)
+ : base(statusCode, headers, requestUri)
+ {
+ Body = body;
+ }
+
+ ///
+ /// Gets the response body.
+ ///
+ public T Body { get; }
+ }
+}
\ No newline at end of file
diff --git a/src/libs/Mistral/Generated/Mistral.BatchClient.CancelBatchJob.g.cs b/src/libs/Mistral/Generated/Mistral.BatchClient.CancelBatchJob.g.cs
index 68d993d7..4e8dc23c 100644
--- a/src/libs/Mistral/Generated/Mistral.BatchClient.CancelBatchJob.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.BatchClient.CancelBatchJob.g.cs
@@ -53,6 +53,27 @@ partial void ProcessCancelBatchJobResponseContent(
global::System.Guid jobId,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await CancelBatchJobAsResponseAsync(
+ jobId: jobId,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Cancel Batch Job
+ /// Request the cancellation of a batch job.
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> CancelBatchJobAsResponseAsync(
+ global::System.Guid jobId,
+ global::Mistral.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -82,6 +103,7 @@ partial void ProcessCancelBatchJobResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Mistral.PathBuilder(
path: $"/v1/batch/jobs/{jobId}/cancel",
baseUri: HttpClient.BaseAddress);
@@ -155,6 +177,8 @@ partial void ProcessCancelBatchJobResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -165,6 +189,11 @@ partial void ProcessCancelBatchJobResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -182,6 +211,8 @@ partial void ProcessCancelBatchJobResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -191,8 +222,7 @@ partial void ProcessCancelBatchJobResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -201,6 +231,11 @@ partial void ProcessCancelBatchJobResponseContent(
__attempt < __maxAttempts &&
global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -217,14 +252,15 @@ partial void ProcessCancelBatchJobResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -264,6 +300,8 @@ partial void ProcessCancelBatchJobResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -284,6 +322,8 @@ partial void ProcessCancelBatchJobResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -308,9 +348,13 @@ partial void ProcessCancelBatchJobResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Mistral.BatchJobOut.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Mistral.BatchJobOut.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -338,9 +382,13 @@ partial void ProcessCancelBatchJobResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Mistral.BatchJobOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Mistral.BatchJobOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Mistral/Generated/Mistral.BatchClient.CreateBatchJob.g.cs b/src/libs/Mistral/Generated/Mistral.BatchClient.CreateBatchJob.g.cs
index 63ac967d..ff0f6ce6 100644
--- a/src/libs/Mistral/Generated/Mistral.BatchClient.CreateBatchJob.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.BatchClient.CreateBatchJob.g.cs
@@ -51,6 +51,29 @@ partial void ProcessCreateBatchJobResponseContent(
///
public async global::System.Threading.Tasks.Task CreateBatchJobAsync(
+ global::Mistral.BatchJobIn request,
+ global::Mistral.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await CreateBatchJobAsResponseAsync(
+
+ request: request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Create Batch Job
+ /// Create a new batch job, it will be queued for processing.
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> CreateBatchJobAsResponseAsync(
+
global::Mistral.BatchJobIn request,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
@@ -85,6 +108,7 @@ partial void ProcessCreateBatchJobResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Mistral.PathBuilder(
path: "/v1/batch/jobs",
baseUri: HttpClient.BaseAddress);
@@ -164,6 +188,8 @@ partial void ProcessCreateBatchJobResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -174,6 +200,11 @@ partial void ProcessCreateBatchJobResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -191,6 +222,8 @@ partial void ProcessCreateBatchJobResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -200,8 +233,7 @@ partial void ProcessCreateBatchJobResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -210,6 +242,11 @@ partial void ProcessCreateBatchJobResponseContent(
__attempt < __maxAttempts &&
global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -226,14 +263,15 @@ partial void ProcessCreateBatchJobResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -273,6 +311,8 @@ partial void ProcessCreateBatchJobResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -293,6 +333,8 @@ partial void ProcessCreateBatchJobResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -317,9 +359,13 @@ partial void ProcessCreateBatchJobResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Mistral.BatchJobOut.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Mistral.BatchJobOut.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -347,9 +393,13 @@ partial void ProcessCreateBatchJobResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Mistral.BatchJobOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Mistral.BatchJobOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Mistral/Generated/Mistral.BatchClient.GetBatchJob.g.cs b/src/libs/Mistral/Generated/Mistral.BatchClient.GetBatchJob.g.cs
index 9f380d2c..eb4ee135 100644
--- a/src/libs/Mistral/Generated/Mistral.BatchClient.GetBatchJob.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.BatchClient.GetBatchJob.g.cs
@@ -59,6 +59,32 @@ partial void ProcessGetBatchJobResponseContent(
bool? inline = default,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await GetBatchJobAsResponseAsync(
+ jobId: jobId,
+ inline: inline,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Get Batch Job
+ /// Get a batch job details by its UUID.
+ /// Args:
+ /// inline: If True, return results inline in the response.
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> GetBatchJobAsResponseAsync(
+ global::System.Guid jobId,
+ bool? inline = default,
+ global::Mistral.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -89,11 +115,12 @@ partial void ProcessGetBatchJobResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Mistral.PathBuilder(
path: $"/v1/batch/jobs/{jobId}",
- baseUri: HttpClient.BaseAddress);
+ baseUri: HttpClient.BaseAddress);
__pathBuilder
- .AddOptionalParameter("inline", inline?.ToString().ToLowerInvariant())
+ .AddOptionalParameter("inline", inline?.ToString().ToLowerInvariant())
;
var __path = __pathBuilder.ToString();
__path = global::Mistral.AutoSDKRequestOptionsSupport.AppendQueryParameters(
@@ -166,6 +193,8 @@ partial void ProcessGetBatchJobResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -176,6 +205,11 @@ partial void ProcessGetBatchJobResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -193,6 +227,8 @@ partial void ProcessGetBatchJobResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -202,8 +238,7 @@ partial void ProcessGetBatchJobResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -212,6 +247,11 @@ partial void ProcessGetBatchJobResponseContent(
__attempt < __maxAttempts &&
global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -228,14 +268,15 @@ partial void ProcessGetBatchJobResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -275,6 +316,8 @@ partial void ProcessGetBatchJobResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -295,6 +338,8 @@ partial void ProcessGetBatchJobResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -319,9 +364,13 @@ partial void ProcessGetBatchJobResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Mistral.BatchJobOut.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Mistral.BatchJobOut.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -349,9 +398,13 @@ partial void ProcessGetBatchJobResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Mistral.BatchJobOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Mistral.BatchJobOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Mistral/Generated/Mistral.BatchClient.GetBatchJobs.g.cs b/src/libs/Mistral/Generated/Mistral.BatchClient.GetBatchJobs.g.cs
index 7e93e18f..e2795f5c 100644
--- a/src/libs/Mistral/Generated/Mistral.BatchClient.GetBatchJobs.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.BatchClient.GetBatchJobs.g.cs
@@ -93,6 +93,59 @@ partial void ProcessGetBatchJobsResponseContent(
global::Mistral.JobsApiRoutesBatchGetBatchJobsOrderBy? orderBy = default,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await GetBatchJobsAsResponseAsync(
+ page: page,
+ pageSize: pageSize,
+ model: model,
+ agentId: agentId,
+ metadata: metadata,
+ createdAfter: createdAfter,
+ createdByMe: createdByMe,
+ status: status,
+ orderBy: orderBy,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Get Batch Jobs
+ /// Get a list of batch jobs for your organization and user.
+ ///
+ ///
+ /// Default Value: 0
+ ///
+ ///
+ /// Default Value: 100
+ ///
+ ///
+ ///
+ ///
+ ///
+ ///
+ /// Default Value: false
+ ///
+ ///
+ ///
+ /// Default Value: -created
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> GetBatchJobsAsResponseAsync(
+ int? page = default,
+ int? pageSize = default,
+ string? model = default,
+ string? agentId = default,
+ object? metadata = default,
+ global::System.DateTime? createdAfter = default,
+ bool? createdByMe = default,
+ global::System.Collections.Generic.IList? status = default,
+ global::Mistral.JobsApiRoutesBatchGetBatchJobsOrderBy? orderBy = default,
+ global::Mistral.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -130,9 +183,10 @@ partial void ProcessGetBatchJobsResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Mistral.PathBuilder(
path: "/v1/batch/jobs",
- baseUri: HttpClient.BaseAddress);
+ baseUri: HttpClient.BaseAddress);
__pathBuilder
.AddOptionalParameter("page", page?.ToString())
.AddOptionalParameter("page_size", pageSize?.ToString())
@@ -142,7 +196,7 @@ partial void ProcessGetBatchJobsResponseContent(
.AddOptionalParameter("created_after", createdAfter?.ToString())
.AddOptionalParameter("created_by_me", createdByMe?.ToString().ToLowerInvariant())
.AddOptionalParameter("status", status?.ToString())
- .AddOptionalParameter("order_by", orderBy?.ToValueString())
+ .AddOptionalParameter("order_by", orderBy?.ToValueString())
;
var __path = __pathBuilder.ToString();
__path = global::Mistral.AutoSDKRequestOptionsSupport.AppendQueryParameters(
@@ -222,6 +276,8 @@ partial void ProcessGetBatchJobsResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -232,6 +288,11 @@ partial void ProcessGetBatchJobsResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -249,6 +310,8 @@ partial void ProcessGetBatchJobsResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -258,8 +321,7 @@ partial void ProcessGetBatchJobsResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -268,6 +330,11 @@ partial void ProcessGetBatchJobsResponseContent(
__attempt < __maxAttempts &&
global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -284,14 +351,15 @@ partial void ProcessGetBatchJobsResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -331,6 +399,8 @@ partial void ProcessGetBatchJobsResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -351,6 +421,8 @@ partial void ProcessGetBatchJobsResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -375,9 +447,13 @@ partial void ProcessGetBatchJobsResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Mistral.BatchJobsOut.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Mistral.BatchJobsOut.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -405,9 +481,13 @@ partial void ProcessGetBatchJobsResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Mistral.BatchJobsOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Mistral.BatchJobsOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Mistral/Generated/Mistral.BatchClient.g.cs b/src/libs/Mistral/Generated/Mistral.BatchClient.g.cs
index 120f9797..d295bf58 100644
--- a/src/libs/Mistral/Generated/Mistral.BatchClient.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.BatchClient.g.cs
@@ -73,10 +73,10 @@ public BatchClient(
/// Client-wide request defaults such as headers, query parameters, retries, and timeout.
/// Dispose the HttpClient when the instance is disposed. True by default.
public BatchClient(
- global::System.Net.Http.HttpClient? httpClient = null,
- global::System.Uri? baseUri = null,
- global::System.Collections.Generic.List? authorizations = null,
- global::Mistral.AutoSDKClientOptions? options = null,
+ global::System.Net.Http.HttpClient? httpClient,
+ global::System.Uri? baseUri,
+ global::System.Collections.Generic.List? authorizations,
+ global::Mistral.AutoSDKClientOptions? options,
bool disposeHttpClient = true)
{
diff --git a/src/libs/Mistral/Generated/Mistral.BetaAgentsClient.CreateAAgentThatCanBeUsedWithinAConversation.g.cs b/src/libs/Mistral/Generated/Mistral.BetaAgentsClient.CreateAAgentThatCanBeUsedWithinAConversation.g.cs
index f078289c..bad85f27 100644
--- a/src/libs/Mistral/Generated/Mistral.BetaAgentsClient.CreateAAgentThatCanBeUsedWithinAConversation.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.BetaAgentsClient.CreateAAgentThatCanBeUsedWithinAConversation.g.cs
@@ -51,6 +51,29 @@ partial void ProcessCreateAAgentThatCanBeUsedWithinAConversationResponseContent(
///
public async global::System.Threading.Tasks.Task CreateAAgentThatCanBeUsedWithinAConversationAsync(
+ global::Mistral.AgentCreationRequest request,
+ global::Mistral.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await CreateAAgentThatCanBeUsedWithinAConversationAsResponseAsync(
+
+ request: request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Create a agent that can be used within a conversation.
+ /// Create a new agent giving it instructions, tools, description. The agent is then available to be used as a regular assistant in a conversation or as part of an agent pool from which it can be used.
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> CreateAAgentThatCanBeUsedWithinAConversationAsResponseAsync(
+
global::Mistral.AgentCreationRequest request,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
@@ -85,6 +108,7 @@ partial void ProcessCreateAAgentThatCanBeUsedWithinAConversationResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Mistral.PathBuilder(
path: "/v1/agents",
baseUri: HttpClient.BaseAddress);
@@ -164,6 +188,8 @@ partial void ProcessCreateAAgentThatCanBeUsedWithinAConversationResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -174,6 +200,11 @@ partial void ProcessCreateAAgentThatCanBeUsedWithinAConversationResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -191,6 +222,8 @@ partial void ProcessCreateAAgentThatCanBeUsedWithinAConversationResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -200,8 +233,7 @@ partial void ProcessCreateAAgentThatCanBeUsedWithinAConversationResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -210,6 +242,11 @@ partial void ProcessCreateAAgentThatCanBeUsedWithinAConversationResponseContent(
__attempt < __maxAttempts &&
global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -226,14 +263,15 @@ partial void ProcessCreateAAgentThatCanBeUsedWithinAConversationResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -273,6 +311,8 @@ partial void ProcessCreateAAgentThatCanBeUsedWithinAConversationResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -293,6 +333,8 @@ partial void ProcessCreateAAgentThatCanBeUsedWithinAConversationResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -355,9 +397,13 @@ partial void ProcessCreateAAgentThatCanBeUsedWithinAConversationResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Mistral.Agent.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Mistral.Agent.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -385,9 +431,13 @@ partial void ProcessCreateAAgentThatCanBeUsedWithinAConversationResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Mistral.Agent.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Mistral.Agent.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Mistral/Generated/Mistral.BetaAgentsClient.CreateOrUpdateAnAgentVersionAlias.g.cs b/src/libs/Mistral/Generated/Mistral.BetaAgentsClient.CreateOrUpdateAnAgentVersionAlias.g.cs
index 7155abcc..212c767c 100644
--- a/src/libs/Mistral/Generated/Mistral.BetaAgentsClient.CreateOrUpdateAnAgentVersionAlias.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.BetaAgentsClient.CreateOrUpdateAnAgentVersionAlias.g.cs
@@ -61,6 +61,33 @@ partial void ProcessCreateOrUpdateAnAgentVersionAliasResponseContent(
int version,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await CreateOrUpdateAnAgentVersionAliasAsResponseAsync(
+ agentId: agentId,
+ alias: alias,
+ version: version,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Create or update an agent version alias.
+ /// Create a new alias or update an existing alias to point to a specific version. Aliases are unique per agent and can be reassigned to different versions.
+ ///
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> CreateOrUpdateAnAgentVersionAliasAsResponseAsync(
+ string agentId,
+ string alias,
+ int version,
+ global::Mistral.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -92,12 +119,13 @@ partial void ProcessCreateOrUpdateAnAgentVersionAliasResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Mistral.PathBuilder(
path: $"/v1/agents/{agentId}/aliases",
- baseUri: HttpClient.BaseAddress);
+ baseUri: HttpClient.BaseAddress);
__pathBuilder
.AddRequiredParameter("alias", alias)
- .AddRequiredParameter("version", version.ToString()!)
+ .AddRequiredParameter("version", version.ToString()!)
;
var __path = __pathBuilder.ToString();
__path = global::Mistral.AutoSDKRequestOptionsSupport.AppendQueryParameters(
@@ -171,6 +199,8 @@ partial void ProcessCreateOrUpdateAnAgentVersionAliasResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -181,6 +211,11 @@ partial void ProcessCreateOrUpdateAnAgentVersionAliasResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -198,6 +233,8 @@ partial void ProcessCreateOrUpdateAnAgentVersionAliasResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -207,8 +244,7 @@ partial void ProcessCreateOrUpdateAnAgentVersionAliasResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -217,6 +253,11 @@ partial void ProcessCreateOrUpdateAnAgentVersionAliasResponseContent(
__attempt < __maxAttempts &&
global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -233,14 +274,15 @@ partial void ProcessCreateOrUpdateAnAgentVersionAliasResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -280,6 +322,8 @@ partial void ProcessCreateOrUpdateAnAgentVersionAliasResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -300,6 +344,8 @@ partial void ProcessCreateOrUpdateAnAgentVersionAliasResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -362,9 +408,13 @@ partial void ProcessCreateOrUpdateAnAgentVersionAliasResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Mistral.AgentAliasResponse.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Mistral.AgentAliasResponse.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -392,9 +442,13 @@ partial void ProcessCreateOrUpdateAnAgentVersionAliasResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Mistral.AgentAliasResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Mistral.AgentAliasResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Mistral/Generated/Mistral.BetaAgentsClient.DeleteAnAgentEntity.g.cs b/src/libs/Mistral/Generated/Mistral.BetaAgentsClient.DeleteAnAgentEntity.g.cs
index c25748b2..e388a270 100644
--- a/src/libs/Mistral/Generated/Mistral.BetaAgentsClient.DeleteAnAgentEntity.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.BetaAgentsClient.DeleteAnAgentEntity.g.cs
@@ -47,6 +47,24 @@ partial void ProcessDeleteAnAgentEntityResponse(
string agentId,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ await DeleteAnAgentEntityAsResponseAsync(
+ agentId: agentId,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+ }
+ ///
+ /// Delete an agent entity.
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task DeleteAnAgentEntityAsResponseAsync(
+ string agentId,
+ global::Mistral.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -76,6 +94,7 @@ partial void ProcessDeleteAnAgentEntityResponse(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Mistral.PathBuilder(
path: $"/v1/agents/{agentId}",
baseUri: HttpClient.BaseAddress);
@@ -149,6 +168,8 @@ partial void ProcessDeleteAnAgentEntityResponse(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -159,6 +180,11 @@ partial void ProcessDeleteAnAgentEntityResponse(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -176,6 +202,8 @@ partial void ProcessDeleteAnAgentEntityResponse(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -185,8 +213,7 @@ partial void ProcessDeleteAnAgentEntityResponse(
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -195,6 +222,11 @@ partial void ProcessDeleteAnAgentEntityResponse(
__attempt < __maxAttempts &&
global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -211,14 +243,15 @@ partial void ProcessDeleteAnAgentEntityResponse(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -258,6 +291,8 @@ partial void ProcessDeleteAnAgentEntityResponse(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -278,6 +313,8 @@ partial void ProcessDeleteAnAgentEntityResponse(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -336,6 +373,10 @@ partial void ProcessDeleteAnAgentEntityResponse(
{
__response.EnsureSuccessStatusCode();
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri);
}
catch (global::System.Exception __ex)
{
@@ -357,6 +398,10 @@ partial void ProcessDeleteAnAgentEntityResponse(
try
{
__response.EnsureSuccessStatusCode();
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Mistral/Generated/Mistral.BetaAgentsClient.DeleteAnAgentVersionAlias.g.cs b/src/libs/Mistral/Generated/Mistral.BetaAgentsClient.DeleteAnAgentVersionAlias.g.cs
index 12a1b316..0768421b 100644
--- a/src/libs/Mistral/Generated/Mistral.BetaAgentsClient.DeleteAnAgentVersionAlias.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.BetaAgentsClient.DeleteAnAgentVersionAlias.g.cs
@@ -52,6 +52,28 @@ partial void ProcessDeleteAnAgentVersionAliasResponse(
string alias,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ await DeleteAnAgentVersionAliasAsResponseAsync(
+ agentId: agentId,
+ alias: alias,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+ }
+ ///
+ /// Delete an agent version alias.
+ /// Delete an existing alias for an agent.
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task DeleteAnAgentVersionAliasAsResponseAsync(
+ string agentId,
+ string alias,
+ global::Mistral.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -82,11 +104,12 @@ partial void ProcessDeleteAnAgentVersionAliasResponse(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Mistral.PathBuilder(
path: $"/v1/agents/{agentId}/aliases",
- baseUri: HttpClient.BaseAddress);
+ baseUri: HttpClient.BaseAddress);
__pathBuilder
- .AddRequiredParameter("alias", alias)
+ .AddRequiredParameter("alias", alias)
;
var __path = __pathBuilder.ToString();
__path = global::Mistral.AutoSDKRequestOptionsSupport.AppendQueryParameters(
@@ -159,6 +182,8 @@ partial void ProcessDeleteAnAgentVersionAliasResponse(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -169,6 +194,11 @@ partial void ProcessDeleteAnAgentVersionAliasResponse(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -186,6 +216,8 @@ partial void ProcessDeleteAnAgentVersionAliasResponse(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -195,8 +227,7 @@ partial void ProcessDeleteAnAgentVersionAliasResponse(
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -205,6 +236,11 @@ partial void ProcessDeleteAnAgentVersionAliasResponse(
__attempt < __maxAttempts &&
global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -221,14 +257,15 @@ partial void ProcessDeleteAnAgentVersionAliasResponse(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -268,6 +305,8 @@ partial void ProcessDeleteAnAgentVersionAliasResponse(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -288,6 +327,8 @@ partial void ProcessDeleteAnAgentVersionAliasResponse(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -346,6 +387,10 @@ partial void ProcessDeleteAnAgentVersionAliasResponse(
{
__response.EnsureSuccessStatusCode();
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri);
}
catch (global::System.Exception __ex)
{
@@ -367,6 +412,10 @@ partial void ProcessDeleteAnAgentVersionAliasResponse(
try
{
__response.EnsureSuccessStatusCode();
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Mistral/Generated/Mistral.BetaAgentsClient.ListAgentEntities.g.cs b/src/libs/Mistral/Generated/Mistral.BetaAgentsClient.ListAgentEntities.g.cs
index eb398f65..5622f968 100644
--- a/src/libs/Mistral/Generated/Mistral.BetaAgentsClient.ListAgentEntities.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.BetaAgentsClient.ListAgentEntities.g.cs
@@ -91,6 +91,58 @@ partial void ProcessListAgentEntitiesResponseContent(
object? metadata = default,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await ListAgentEntitiesAsResponseAsync(
+ page: page,
+ pageSize: pageSize,
+ deploymentChat: deploymentChat,
+ sources: sources,
+ name: name,
+ search: search,
+ id: id,
+ metadata: metadata,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// List agent entities.
+ /// Retrieve a list of agent entities sorted by creation time.
+ ///
+ ///
+ /// Page number (0-indexed)
+ /// Default Value: 0
+ ///
+ ///
+ /// Number of agents per page
+ /// Default Value: 20
+ ///
+ ///
+ ///
+ ///
+ /// Filter by agent name
+ ///
+ ///
+ /// Search agents by name or ID
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task>> ListAgentEntitiesAsResponseAsync(
+ int? page = default,
+ int? pageSize = default,
+ bool? deploymentChat = default,
+ global::System.Collections.Generic.IList? sources = default,
+ string? name = default,
+ string? search = default,
+ string? id = default,
+ object? metadata = default,
+ global::Mistral.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -127,9 +179,10 @@ partial void ProcessListAgentEntitiesResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Mistral.PathBuilder(
path: "/v1/agents",
- baseUri: HttpClient.BaseAddress);
+ baseUri: HttpClient.BaseAddress);
__pathBuilder
.AddOptionalParameter("page", page?.ToString())
.AddOptionalParameter("page_size", pageSize?.ToString())
@@ -138,7 +191,7 @@ partial void ProcessListAgentEntitiesResponseContent(
.AddOptionalParameter("name", name)
.AddOptionalParameter("search", search)
.AddOptionalParameter("id", id)
- .AddOptionalParameter("metadata", metadata?.ToString())
+ .AddOptionalParameter("metadata", metadata?.ToString())
;
var __path = __pathBuilder.ToString();
__path = global::Mistral.AutoSDKRequestOptionsSupport.AppendQueryParameters(
@@ -217,6 +270,8 @@ partial void ProcessListAgentEntitiesResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -227,6 +282,11 @@ partial void ProcessListAgentEntitiesResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -244,6 +304,8 @@ partial void ProcessListAgentEntitiesResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -253,8 +315,7 @@ partial void ProcessListAgentEntitiesResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -263,6 +324,11 @@ partial void ProcessListAgentEntitiesResponseContent(
__attempt < __maxAttempts &&
global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -279,14 +345,15 @@ partial void ProcessListAgentEntitiesResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -326,6 +393,8 @@ partial void ProcessListAgentEntitiesResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -346,6 +415,8 @@ partial void ProcessListAgentEntitiesResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -408,9 +479,13 @@ partial void ProcessListAgentEntitiesResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ??
+ var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Mistral.AutoSDKHttpResponse>(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -438,9 +513,13 @@ partial void ProcessListAgentEntitiesResponseContent(
#endif
).ConfigureAwait(false);
- return
- (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Mistral.AutoSDKHttpResponse>(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Mistral/Generated/Mistral.BetaAgentsClient.ListAllAliasesForAnAgent.g.cs b/src/libs/Mistral/Generated/Mistral.BetaAgentsClient.ListAllAliasesForAnAgent.g.cs
index 89e1ee58..c5abe597 100644
--- a/src/libs/Mistral/Generated/Mistral.BetaAgentsClient.ListAllAliasesForAnAgent.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.BetaAgentsClient.ListAllAliasesForAnAgent.g.cs
@@ -53,6 +53,27 @@ partial void ProcessListAllAliasesForAnAgentResponseContent(
string agentId,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await ListAllAliasesForAnAgentAsResponseAsync(
+ agentId: agentId,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// List all aliases for an agent.
+ /// Retrieve all version aliases for a specific agent.
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task>> ListAllAliasesForAnAgentAsResponseAsync(
+ string agentId,
+ global::Mistral.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -82,6 +103,7 @@ partial void ProcessListAllAliasesForAnAgentResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Mistral.PathBuilder(
path: $"/v1/agents/{agentId}/aliases",
baseUri: HttpClient.BaseAddress);
@@ -155,6 +177,8 @@ partial void ProcessListAllAliasesForAnAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -165,6 +189,11 @@ partial void ProcessListAllAliasesForAnAgentResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -182,6 +211,8 @@ partial void ProcessListAllAliasesForAnAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -191,8 +222,7 @@ partial void ProcessListAllAliasesForAnAgentResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -201,6 +231,11 @@ partial void ProcessListAllAliasesForAnAgentResponseContent(
__attempt < __maxAttempts &&
global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -217,14 +252,15 @@ partial void ProcessListAllAliasesForAnAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -264,6 +300,8 @@ partial void ProcessListAllAliasesForAnAgentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -284,6 +322,8 @@ partial void ProcessListAllAliasesForAnAgentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -346,9 +386,13 @@ partial void ProcessListAllAliasesForAnAgentResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ??
+ var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Mistral.AutoSDKHttpResponse>(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -376,9 +420,13 @@ partial void ProcessListAllAliasesForAnAgentResponseContent(
#endif
).ConfigureAwait(false);
- return
- (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Mistral.AutoSDKHttpResponse>(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Mistral/Generated/Mistral.BetaAgentsClient.ListAllVersionsOfAnAgent.g.cs b/src/libs/Mistral/Generated/Mistral.BetaAgentsClient.ListAllVersionsOfAnAgent.g.cs
index 2fbc6817..135ae2c9 100644
--- a/src/libs/Mistral/Generated/Mistral.BetaAgentsClient.ListAllVersionsOfAnAgent.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.BetaAgentsClient.ListAllVersionsOfAnAgent.g.cs
@@ -67,6 +67,39 @@ partial void ProcessListAllVersionsOfAnAgentResponseContent(
int? pageSize = default,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await ListAllVersionsOfAnAgentAsResponseAsync(
+ agentId: agentId,
+ page: page,
+ pageSize: pageSize,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// List all versions of an agent.
+ /// Retrieve all versions for a specific agent with full agent context. Supports pagination.
+ ///
+ ///
+ ///
+ /// Page number (0-indexed)
+ /// Default Value: 0
+ ///
+ ///
+ /// Number of versions per page
+ /// Default Value: 20
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task>> ListAllVersionsOfAnAgentAsResponseAsync(
+ string agentId,
+ int? page = default,
+ int? pageSize = default,
+ global::Mistral.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -98,12 +131,13 @@ partial void ProcessListAllVersionsOfAnAgentResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Mistral.PathBuilder(
path: $"/v1/agents/{agentId}/versions",
- baseUri: HttpClient.BaseAddress);
+ baseUri: HttpClient.BaseAddress);
__pathBuilder
.AddOptionalParameter("page", page?.ToString())
- .AddOptionalParameter("page_size", pageSize?.ToString())
+ .AddOptionalParameter("page_size", pageSize?.ToString())
;
var __path = __pathBuilder.ToString();
__path = global::Mistral.AutoSDKRequestOptionsSupport.AppendQueryParameters(
@@ -177,6 +211,8 @@ partial void ProcessListAllVersionsOfAnAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -187,6 +223,11 @@ partial void ProcessListAllVersionsOfAnAgentResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -204,6 +245,8 @@ partial void ProcessListAllVersionsOfAnAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -213,8 +256,7 @@ partial void ProcessListAllVersionsOfAnAgentResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -223,6 +265,11 @@ partial void ProcessListAllVersionsOfAnAgentResponseContent(
__attempt < __maxAttempts &&
global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -239,14 +286,15 @@ partial void ProcessListAllVersionsOfAnAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -286,6 +334,8 @@ partial void ProcessListAllVersionsOfAnAgentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -306,6 +356,8 @@ partial void ProcessListAllVersionsOfAnAgentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -368,9 +420,13 @@ partial void ProcessListAllVersionsOfAnAgentResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ??
+ var __value = (global::System.Collections.Generic.IList?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Mistral.AutoSDKHttpResponse>(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -398,9 +454,13 @@ partial void ProcessListAllVersionsOfAnAgentResponseContent(
#endif
).ConfigureAwait(false);
- return
- (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = (global::System.Collections.Generic.IList?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList), JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Mistral.AutoSDKHttpResponse>(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Mistral/Generated/Mistral.BetaAgentsClient.RetrieveASpecificVersionOfAnAgent.g.cs b/src/libs/Mistral/Generated/Mistral.BetaAgentsClient.RetrieveASpecificVersionOfAnAgent.g.cs
index ea1a10c1..8d96b38a 100644
--- a/src/libs/Mistral/Generated/Mistral.BetaAgentsClient.RetrieveASpecificVersionOfAnAgent.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.BetaAgentsClient.RetrieveASpecificVersionOfAnAgent.g.cs
@@ -57,6 +57,30 @@ partial void ProcessRetrieveASpecificVersionOfAnAgentResponseContent(
string version,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await RetrieveASpecificVersionOfAnAgentAsResponseAsync(
+ agentId: agentId,
+ version: version,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Retrieve a specific version of an agent.
+ /// Get a specific agent version by version number.
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> RetrieveASpecificVersionOfAnAgentAsResponseAsync(
+ string agentId,
+ string version,
+ global::Mistral.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -87,6 +111,7 @@ partial void ProcessRetrieveASpecificVersionOfAnAgentResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Mistral.PathBuilder(
path: $"/v1/agents/{agentId}/versions/{version}",
baseUri: HttpClient.BaseAddress);
@@ -161,6 +186,8 @@ partial void ProcessRetrieveASpecificVersionOfAnAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -171,6 +198,11 @@ partial void ProcessRetrieveASpecificVersionOfAnAgentResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -188,6 +220,8 @@ partial void ProcessRetrieveASpecificVersionOfAnAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -197,8 +231,7 @@ partial void ProcessRetrieveASpecificVersionOfAnAgentResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -207,6 +240,11 @@ partial void ProcessRetrieveASpecificVersionOfAnAgentResponseContent(
__attempt < __maxAttempts &&
global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -223,14 +261,15 @@ partial void ProcessRetrieveASpecificVersionOfAnAgentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -270,6 +309,8 @@ partial void ProcessRetrieveASpecificVersionOfAnAgentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -290,6 +331,8 @@ partial void ProcessRetrieveASpecificVersionOfAnAgentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -352,9 +395,13 @@ partial void ProcessRetrieveASpecificVersionOfAnAgentResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Mistral.Agent.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Mistral.Agent.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -382,9 +429,13 @@ partial void ProcessRetrieveASpecificVersionOfAnAgentResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Mistral.Agent.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Mistral.Agent.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Mistral/Generated/Mistral.BetaAgentsClient.RetrieveAnAgentEntity.g.cs b/src/libs/Mistral/Generated/Mistral.BetaAgentsClient.RetrieveAnAgentEntity.g.cs
index ee354770..86ce71af 100644
--- a/src/libs/Mistral/Generated/Mistral.BetaAgentsClient.RetrieveAnAgentEntity.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.BetaAgentsClient.RetrieveAnAgentEntity.g.cs
@@ -57,6 +57,30 @@ partial void ProcessRetrieveAnAgentEntityResponseContent(
global::Mistral.AnyOf? agentVersion = default,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await RetrieveAnAgentEntityAsResponseAsync(
+ agentId: agentId,
+ agentVersion: agentVersion,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Retrieve an agent entity.
+ /// Given an agent, retrieve an agent entity with its attributes. The agent_version parameter can be an integer version number or a string alias.
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> RetrieveAnAgentEntityAsResponseAsync(
+ string agentId,
+ global::Mistral.AnyOf? agentVersion = default,
+ global::Mistral.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -87,11 +111,12 @@ partial void ProcessRetrieveAnAgentEntityResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Mistral.PathBuilder(
path: $"/v1/agents/{agentId}",
- baseUri: HttpClient.BaseAddress);
+ baseUri: HttpClient.BaseAddress);
__pathBuilder
- .AddOptionalParameter("agent_version", agentVersion?.ToString())
+ .AddOptionalParameter("agent_version", agentVersion?.ToString())
;
var __path = __pathBuilder.ToString();
__path = global::Mistral.AutoSDKRequestOptionsSupport.AppendQueryParameters(
@@ -164,6 +189,8 @@ partial void ProcessRetrieveAnAgentEntityResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -174,6 +201,11 @@ partial void ProcessRetrieveAnAgentEntityResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -191,6 +223,8 @@ partial void ProcessRetrieveAnAgentEntityResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -200,8 +234,7 @@ partial void ProcessRetrieveAnAgentEntityResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -210,6 +243,11 @@ partial void ProcessRetrieveAnAgentEntityResponseContent(
__attempt < __maxAttempts &&
global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -226,14 +264,15 @@ partial void ProcessRetrieveAnAgentEntityResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -273,6 +312,8 @@ partial void ProcessRetrieveAnAgentEntityResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -293,6 +334,8 @@ partial void ProcessRetrieveAnAgentEntityResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -355,9 +398,13 @@ partial void ProcessRetrieveAnAgentEntityResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Mistral.Agent.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Mistral.Agent.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -385,9 +432,13 @@ partial void ProcessRetrieveAnAgentEntityResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Mistral.Agent.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Mistral.Agent.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Mistral/Generated/Mistral.BetaAgentsClient.UpdateAnAgentEntity.g.cs b/src/libs/Mistral/Generated/Mistral.BetaAgentsClient.UpdateAnAgentEntity.g.cs
index cfd2110d..0aaf85a4 100644
--- a/src/libs/Mistral/Generated/Mistral.BetaAgentsClient.UpdateAnAgentEntity.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.BetaAgentsClient.UpdateAnAgentEntity.g.cs
@@ -55,6 +55,32 @@ partial void ProcessUpdateAnAgentEntityResponseContent(
public async global::System.Threading.Tasks.Task UpdateAnAgentEntityAsync(
string agentId,
+ global::Mistral.AgentUpdateRequest request,
+ global::Mistral.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await UpdateAnAgentEntityAsResponseAsync(
+ agentId: agentId,
+
+ request: request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Update an agent entity.
+ /// Update an agent attributes and create a new version.
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> UpdateAnAgentEntityAsResponseAsync(
+ string agentId,
+
global::Mistral.AgentUpdateRequest request,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
@@ -90,6 +116,7 @@ partial void ProcessUpdateAnAgentEntityResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Mistral.PathBuilder(
path: $"/v1/agents/{agentId}",
baseUri: HttpClient.BaseAddress);
@@ -170,6 +197,8 @@ partial void ProcessUpdateAnAgentEntityResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -180,6 +209,11 @@ partial void ProcessUpdateAnAgentEntityResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -197,6 +231,8 @@ partial void ProcessUpdateAnAgentEntityResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -206,8 +242,7 @@ partial void ProcessUpdateAnAgentEntityResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -216,6 +251,11 @@ partial void ProcessUpdateAnAgentEntityResponseContent(
__attempt < __maxAttempts &&
global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -232,14 +272,15 @@ partial void ProcessUpdateAnAgentEntityResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -279,6 +320,8 @@ partial void ProcessUpdateAnAgentEntityResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -299,6 +342,8 @@ partial void ProcessUpdateAnAgentEntityResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -361,9 +406,13 @@ partial void ProcessUpdateAnAgentEntityResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Mistral.Agent.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Mistral.Agent.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -391,9 +440,13 @@ partial void ProcessUpdateAnAgentEntityResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Mistral.Agent.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Mistral.Agent.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Mistral/Generated/Mistral.BetaAgentsClient.UpdateAnAgentVersion.g.cs b/src/libs/Mistral/Generated/Mistral.BetaAgentsClient.UpdateAnAgentVersion.g.cs
index 848d857f..5b2aa0dd 100644
--- a/src/libs/Mistral/Generated/Mistral.BetaAgentsClient.UpdateAnAgentVersion.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.BetaAgentsClient.UpdateAnAgentVersion.g.cs
@@ -57,6 +57,30 @@ partial void ProcessUpdateAnAgentVersionResponseContent(
int version,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await UpdateAnAgentVersionAsResponseAsync(
+ agentId: agentId,
+ version: version,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Update an agent version.
+ /// Switch the version of an agent.
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> UpdateAnAgentVersionAsResponseAsync(
+ string agentId,
+ int version,
+ global::Mistral.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -87,11 +111,12 @@ partial void ProcessUpdateAnAgentVersionResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Mistral.PathBuilder(
path: $"/v1/agents/{agentId}/version",
- baseUri: HttpClient.BaseAddress);
+ baseUri: HttpClient.BaseAddress);
__pathBuilder
- .AddRequiredParameter("version", version.ToString()!)
+ .AddRequiredParameter("version", version.ToString()!)
;
var __path = __pathBuilder.ToString();
__path = global::Mistral.AutoSDKRequestOptionsSupport.AppendQueryParameters(
@@ -164,6 +189,8 @@ partial void ProcessUpdateAnAgentVersionResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -174,6 +201,11 @@ partial void ProcessUpdateAnAgentVersionResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -191,6 +223,8 @@ partial void ProcessUpdateAnAgentVersionResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -200,8 +234,7 @@ partial void ProcessUpdateAnAgentVersionResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -210,6 +243,11 @@ partial void ProcessUpdateAnAgentVersionResponseContent(
__attempt < __maxAttempts &&
global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -226,14 +264,15 @@ partial void ProcessUpdateAnAgentVersionResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -273,6 +312,8 @@ partial void ProcessUpdateAnAgentVersionResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -293,6 +334,8 @@ partial void ProcessUpdateAnAgentVersionResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -355,9 +398,13 @@ partial void ProcessUpdateAnAgentVersionResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Mistral.Agent.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Mistral.Agent.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -385,9 +432,13 @@ partial void ProcessUpdateAnAgentVersionResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Mistral.Agent.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Mistral.Agent.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Mistral/Generated/Mistral.BetaAgentsClient.g.cs b/src/libs/Mistral/Generated/Mistral.BetaAgentsClient.g.cs
index e812e2db..3c414d2c 100644
--- a/src/libs/Mistral/Generated/Mistral.BetaAgentsClient.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.BetaAgentsClient.g.cs
@@ -73,10 +73,10 @@ public BetaAgentsClient(
/// Client-wide request defaults such as headers, query parameters, retries, and timeout.
/// Dispose the HttpClient when the instance is disposed. True by default.
public BetaAgentsClient(
- global::System.Net.Http.HttpClient? httpClient = null,
- global::System.Uri? baseUri = null,
- global::System.Collections.Generic.List? authorizations = null,
- global::Mistral.AutoSDKClientOptions? options = null,
+ global::System.Net.Http.HttpClient? httpClient,
+ global::System.Uri? baseUri,
+ global::System.Collections.Generic.List? authorizations,
+ global::Mistral.AutoSDKClientOptions? options,
bool disposeHttpClient = true)
{
diff --git a/src/libs/Mistral/Generated/Mistral.BetaConversationsClient.AppendNewEntriesToAnExistingConversation.g.cs b/src/libs/Mistral/Generated/Mistral.BetaConversationsClient.AppendNewEntriesToAnExistingConversation.g.cs
index 0de50742..499d19ed 100644
--- a/src/libs/Mistral/Generated/Mistral.BetaConversationsClient.AppendNewEntriesToAnExistingConversation.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.BetaConversationsClient.AppendNewEntriesToAnExistingConversation.g.cs
@@ -57,6 +57,34 @@ partial void ProcessAppendNewEntriesToAnExistingConversationResponseContent(
public async global::System.Threading.Tasks.Task AppendNewEntriesToAnExistingConversationAsync(
string conversationId,
+ global::Mistral.ConversationAppendRequest request,
+ global::Mistral.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await AppendNewEntriesToAnExistingConversationAsResponseAsync(
+ conversationId: conversationId,
+
+ request: request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Append new entries to an existing conversation.
+ /// Run completion on the history of the conversation and the user entries. Return the new created entries.
+ ///
+ ///
+ /// ID of the conversation to which we append entries.
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> AppendNewEntriesToAnExistingConversationAsResponseAsync(
+ string conversationId,
+
global::Mistral.ConversationAppendRequest request,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
@@ -90,6 +118,7 @@ partial void ProcessAppendNewEntriesToAnExistingConversationResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Mistral.PathBuilder(
path: $"/v1/conversations/{conversationId}",
baseUri: HttpClient.BaseAddress);
@@ -170,6 +199,8 @@ partial void ProcessAppendNewEntriesToAnExistingConversationResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -180,6 +211,11 @@ partial void ProcessAppendNewEntriesToAnExistingConversationResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -197,6 +233,8 @@ partial void ProcessAppendNewEntriesToAnExistingConversationResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -206,8 +244,7 @@ partial void ProcessAppendNewEntriesToAnExistingConversationResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -216,6 +253,11 @@ partial void ProcessAppendNewEntriesToAnExistingConversationResponseContent(
__attempt < __maxAttempts &&
global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -232,14 +274,15 @@ partial void ProcessAppendNewEntriesToAnExistingConversationResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -279,6 +322,8 @@ partial void ProcessAppendNewEntriesToAnExistingConversationResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -299,6 +344,8 @@ partial void ProcessAppendNewEntriesToAnExistingConversationResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -361,9 +408,13 @@ partial void ProcessAppendNewEntriesToAnExistingConversationResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Mistral.ConversationResponse.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Mistral.ConversationResponse.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -391,9 +442,13 @@ partial void ProcessAppendNewEntriesToAnExistingConversationResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Mistral.ConversationResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Mistral.ConversationResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Mistral/Generated/Mistral.BetaConversationsClient.AppendNewEntriesToAnExistingConversation2.g.cs b/src/libs/Mistral/Generated/Mistral.BetaConversationsClient.AppendNewEntriesToAnExistingConversation2.g.cs
index 0dcd7610..d618b6c5 100644
--- a/src/libs/Mistral/Generated/Mistral.BetaConversationsClient.AppendNewEntriesToAnExistingConversation2.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.BetaConversationsClient.AppendNewEntriesToAnExistingConversation2.g.cs
@@ -85,6 +85,7 @@ partial void ProcessAppendNewEntriesToAnExistingConversation2Response(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Mistral.PathBuilder(
path: $"/v1/conversations/{conversationId}#stream",
baseUri: HttpClient.BaseAddress);
@@ -165,6 +166,8 @@ partial void ProcessAppendNewEntriesToAnExistingConversation2Response(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -175,6 +178,11 @@ partial void ProcessAppendNewEntriesToAnExistingConversation2Response(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -192,6 +200,8 @@ partial void ProcessAppendNewEntriesToAnExistingConversation2Response(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -201,8 +211,7 @@ partial void ProcessAppendNewEntriesToAnExistingConversation2Response(
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -211,6 +220,11 @@ partial void ProcessAppendNewEntriesToAnExistingConversation2Response(
__attempt < __maxAttempts &&
global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -227,14 +241,15 @@ partial void ProcessAppendNewEntriesToAnExistingConversation2Response(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -274,6 +289,8 @@ partial void ProcessAppendNewEntriesToAnExistingConversation2Response(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -294,6 +311,8 @@ partial void ProcessAppendNewEntriesToAnExistingConversation2Response(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
diff --git a/src/libs/Mistral/Generated/Mistral.BetaConversationsClient.CreateAConversationAndAppendEntriesToIt.g.cs b/src/libs/Mistral/Generated/Mistral.BetaConversationsClient.CreateAConversationAndAppendEntriesToIt.g.cs
index c3c4e7de..91fae821 100644
--- a/src/libs/Mistral/Generated/Mistral.BetaConversationsClient.CreateAConversationAndAppendEntriesToIt.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.BetaConversationsClient.CreateAConversationAndAppendEntriesToIt.g.cs
@@ -51,6 +51,29 @@ partial void ProcessCreateAConversationAndAppendEntriesToItResponseContent(
///
public async global::System.Threading.Tasks.Task CreateAConversationAndAppendEntriesToItAsync(
+ global::Mistral.ConversationRequest request,
+ global::Mistral.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await CreateAConversationAndAppendEntriesToItAsResponseAsync(
+
+ request: request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Create a conversation and append entries to it.
+ /// Create a new conversation, using a base model or an agent and append entries. Completion and tool executions are run and the response is appended to the conversation.Use the returned conversation_id to continue the conversation.
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> CreateAConversationAndAppendEntriesToItAsResponseAsync(
+
global::Mistral.ConversationRequest request,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
@@ -83,6 +106,7 @@ partial void ProcessCreateAConversationAndAppendEntriesToItResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Mistral.PathBuilder(
path: "/v1/conversations",
baseUri: HttpClient.BaseAddress);
@@ -162,6 +186,8 @@ partial void ProcessCreateAConversationAndAppendEntriesToItResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -172,6 +198,11 @@ partial void ProcessCreateAConversationAndAppendEntriesToItResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -189,6 +220,8 @@ partial void ProcessCreateAConversationAndAppendEntriesToItResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -198,8 +231,7 @@ partial void ProcessCreateAConversationAndAppendEntriesToItResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -208,6 +240,11 @@ partial void ProcessCreateAConversationAndAppendEntriesToItResponseContent(
__attempt < __maxAttempts &&
global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -224,14 +261,15 @@ partial void ProcessCreateAConversationAndAppendEntriesToItResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -271,6 +309,8 @@ partial void ProcessCreateAConversationAndAppendEntriesToItResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -291,6 +331,8 @@ partial void ProcessCreateAConversationAndAppendEntriesToItResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -353,9 +395,13 @@ partial void ProcessCreateAConversationAndAppendEntriesToItResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Mistral.ConversationResponse.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Mistral.ConversationResponse.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -383,9 +429,13 @@ partial void ProcessCreateAConversationAndAppendEntriesToItResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Mistral.ConversationResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Mistral.ConversationResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Mistral/Generated/Mistral.BetaConversationsClient.CreateAConversationAndAppendEntriesToIt2.g.cs b/src/libs/Mistral/Generated/Mistral.BetaConversationsClient.CreateAConversationAndAppendEntriesToIt2.g.cs
index 164c87c1..efac53d9 100644
--- a/src/libs/Mistral/Generated/Mistral.BetaConversationsClient.CreateAConversationAndAppendEntriesToIt2.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.BetaConversationsClient.CreateAConversationAndAppendEntriesToIt2.g.cs
@@ -78,6 +78,7 @@ partial void ProcessCreateAConversationAndAppendEntriesToIt2Response(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Mistral.PathBuilder(
path: "/v1/conversations#stream",
baseUri: HttpClient.BaseAddress);
@@ -157,6 +158,8 @@ partial void ProcessCreateAConversationAndAppendEntriesToIt2Response(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -167,6 +170,11 @@ partial void ProcessCreateAConversationAndAppendEntriesToIt2Response(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -184,6 +192,8 @@ partial void ProcessCreateAConversationAndAppendEntriesToIt2Response(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -193,8 +203,7 @@ partial void ProcessCreateAConversationAndAppendEntriesToIt2Response(
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -203,6 +212,11 @@ partial void ProcessCreateAConversationAndAppendEntriesToIt2Response(
__attempt < __maxAttempts &&
global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -219,14 +233,15 @@ partial void ProcessCreateAConversationAndAppendEntriesToIt2Response(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -266,6 +281,8 @@ partial void ProcessCreateAConversationAndAppendEntriesToIt2Response(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -286,6 +303,8 @@ partial void ProcessCreateAConversationAndAppendEntriesToIt2Response(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
diff --git a/src/libs/Mistral/Generated/Mistral.BetaConversationsClient.DeleteAConversation.g.cs b/src/libs/Mistral/Generated/Mistral.BetaConversationsClient.DeleteAConversation.g.cs
index 88501173..f67b467c 100644
--- a/src/libs/Mistral/Generated/Mistral.BetaConversationsClient.DeleteAConversation.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.BetaConversationsClient.DeleteAConversation.g.cs
@@ -50,6 +50,27 @@ partial void ProcessDeleteAConversationResponse(
string conversationId,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ await DeleteAConversationAsResponseAsync(
+ conversationId: conversationId,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+ }
+ ///
+ /// Delete a conversation.
+ /// Delete a conversation given a conversation_id.
+ ///
+ ///
+ /// ID of the conversation from which we are fetching metadata.
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task DeleteAConversationAsResponseAsync(
+ string conversationId,
+ global::Mistral.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -79,6 +100,7 @@ partial void ProcessDeleteAConversationResponse(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Mistral.PathBuilder(
path: $"/v1/conversations/{conversationId}",
baseUri: HttpClient.BaseAddress);
@@ -152,6 +174,8 @@ partial void ProcessDeleteAConversationResponse(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -162,6 +186,11 @@ partial void ProcessDeleteAConversationResponse(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -179,6 +208,8 @@ partial void ProcessDeleteAConversationResponse(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -188,8 +219,7 @@ partial void ProcessDeleteAConversationResponse(
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -198,6 +228,11 @@ partial void ProcessDeleteAConversationResponse(
__attempt < __maxAttempts &&
global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -214,14 +249,15 @@ partial void ProcessDeleteAConversationResponse(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -261,6 +297,8 @@ partial void ProcessDeleteAConversationResponse(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -281,6 +319,8 @@ partial void ProcessDeleteAConversationResponse(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -339,6 +379,10 @@ partial void ProcessDeleteAConversationResponse(
{
__response.EnsureSuccessStatusCode();
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri);
}
catch (global::System.Exception __ex)
{
@@ -360,6 +404,10 @@ partial void ProcessDeleteAConversationResponse(
try
{
__response.EnsureSuccessStatusCode();
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Mistral/Generated/Mistral.BetaConversationsClient.ListAllCreatedConversations.g.cs b/src/libs/Mistral/Generated/Mistral.BetaConversationsClient.ListAllCreatedConversations.g.cs
index 85904dbb..fa4c375c 100644
--- a/src/libs/Mistral/Generated/Mistral.BetaConversationsClient.ListAllCreatedConversations.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.BetaConversationsClient.ListAllCreatedConversations.g.cs
@@ -65,6 +65,37 @@ partial void ProcessListAllCreatedConversationsResponseContent(
object? metadata = default,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await ListAllCreatedConversationsAsResponseAsync(
+ page: page,
+ pageSize: pageSize,
+ metadata: metadata,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// List all created conversations.
+ /// Retrieve a list of conversation entities sorted by creation time.
+ ///
+ ///
+ /// Default Value: 0
+ ///
+ ///
+ /// Default Value: 100
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task>>> ListAllCreatedConversationsAsResponseAsync(
+ int? page = default,
+ int? pageSize = default,
+ object? metadata = default,
+ global::Mistral.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -96,13 +127,14 @@ partial void ProcessListAllCreatedConversationsResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Mistral.PathBuilder(
path: "/v1/conversations",
- baseUri: HttpClient.BaseAddress);
+ baseUri: HttpClient.BaseAddress);
__pathBuilder
.AddOptionalParameter("page", page?.ToString())
.AddOptionalParameter("page_size", pageSize?.ToString())
- .AddOptionalParameter("metadata", metadata?.ToString())
+ .AddOptionalParameter("metadata", metadata?.ToString())
;
var __path = __pathBuilder.ToString();
__path = global::Mistral.AutoSDKRequestOptionsSupport.AppendQueryParameters(
@@ -176,6 +208,8 @@ partial void ProcessListAllCreatedConversationsResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -186,6 +220,11 @@ partial void ProcessListAllCreatedConversationsResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -203,6 +242,8 @@ partial void ProcessListAllCreatedConversationsResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -212,8 +253,7 @@ partial void ProcessListAllCreatedConversationsResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -222,6 +262,11 @@ partial void ProcessListAllCreatedConversationsResponseContent(
__attempt < __maxAttempts &&
global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -238,14 +283,15 @@ partial void ProcessListAllCreatedConversationsResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -285,6 +331,8 @@ partial void ProcessListAllCreatedConversationsResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -305,6 +353,8 @@ partial void ProcessListAllCreatedConversationsResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -367,9 +417,13 @@ partial void ProcessListAllCreatedConversationsResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- (global::System.Collections.Generic.IList>?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList>), JsonSerializerContext) ??
+ var __value = (global::System.Collections.Generic.IList>?)global::System.Text.Json.JsonSerializer.Deserialize(__content, typeof(global::System.Collections.Generic.IList>), JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Mistral.AutoSDKHttpResponse>>(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -397,9 +451,13 @@ partial void ProcessListAllCreatedConversationsResponseContent(
#endif
).ConfigureAwait(false);
- return
- (global::System.Collections.Generic.IList>?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList>), JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = (global::System.Collections.Generic.IList>?)await global::System.Text.Json.JsonSerializer.DeserializeAsync(__content, typeof(global::System.Collections.Generic.IList>), JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Mistral.AutoSDKHttpResponse>>(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Mistral/Generated/Mistral.BetaConversationsClient.RestartAConversationStartingFromAGivenEntry.g.cs b/src/libs/Mistral/Generated/Mistral.BetaConversationsClient.RestartAConversationStartingFromAGivenEntry.g.cs
index 79e412f2..8302b9bd 100644
--- a/src/libs/Mistral/Generated/Mistral.BetaConversationsClient.RestartAConversationStartingFromAGivenEntry.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.BetaConversationsClient.RestartAConversationStartingFromAGivenEntry.g.cs
@@ -57,6 +57,34 @@ partial void ProcessRestartAConversationStartingFromAGivenEntryResponseContent(
public async global::System.Threading.Tasks.Task RestartAConversationStartingFromAGivenEntryAsync(
string conversationId,
+ global::Mistral.ConversationRestartRequest request,
+ global::Mistral.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await RestartAConversationStartingFromAGivenEntryAsResponseAsync(
+ conversationId: conversationId,
+
+ request: request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Restart a conversation starting from a given entry.
+ /// Given a conversation_id and an id, recreate a conversation from this point and run completion. A new conversation is returned with the new entries returned.
+ ///
+ ///
+ /// ID of the original conversation which is being restarted.
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> RestartAConversationStartingFromAGivenEntryAsResponseAsync(
+ string conversationId,
+
global::Mistral.ConversationRestartRequest request,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
@@ -90,6 +118,7 @@ partial void ProcessRestartAConversationStartingFromAGivenEntryResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Mistral.PathBuilder(
path: $"/v1/conversations/{conversationId}/restart",
baseUri: HttpClient.BaseAddress);
@@ -170,6 +199,8 @@ partial void ProcessRestartAConversationStartingFromAGivenEntryResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -180,6 +211,11 @@ partial void ProcessRestartAConversationStartingFromAGivenEntryResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -197,6 +233,8 @@ partial void ProcessRestartAConversationStartingFromAGivenEntryResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -206,8 +244,7 @@ partial void ProcessRestartAConversationStartingFromAGivenEntryResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -216,6 +253,11 @@ partial void ProcessRestartAConversationStartingFromAGivenEntryResponseContent(
__attempt < __maxAttempts &&
global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -232,14 +274,15 @@ partial void ProcessRestartAConversationStartingFromAGivenEntryResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -279,6 +322,8 @@ partial void ProcessRestartAConversationStartingFromAGivenEntryResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -299,6 +344,8 @@ partial void ProcessRestartAConversationStartingFromAGivenEntryResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -361,9 +408,13 @@ partial void ProcessRestartAConversationStartingFromAGivenEntryResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Mistral.ConversationResponse.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Mistral.ConversationResponse.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -391,9 +442,13 @@ partial void ProcessRestartAConversationStartingFromAGivenEntryResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Mistral.ConversationResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Mistral.ConversationResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Mistral/Generated/Mistral.BetaConversationsClient.RestartAConversationStartingFromAGivenEntry2.g.cs b/src/libs/Mistral/Generated/Mistral.BetaConversationsClient.RestartAConversationStartingFromAGivenEntry2.g.cs
index d87f8c75..c0dee106 100644
--- a/src/libs/Mistral/Generated/Mistral.BetaConversationsClient.RestartAConversationStartingFromAGivenEntry2.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.BetaConversationsClient.RestartAConversationStartingFromAGivenEntry2.g.cs
@@ -85,6 +85,7 @@ partial void ProcessRestartAConversationStartingFromAGivenEntry2Response(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Mistral.PathBuilder(
path: $"/v1/conversations/{conversationId}/restart#stream",
baseUri: HttpClient.BaseAddress);
@@ -165,6 +166,8 @@ partial void ProcessRestartAConversationStartingFromAGivenEntry2Response(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -175,6 +178,11 @@ partial void ProcessRestartAConversationStartingFromAGivenEntry2Response(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -192,6 +200,8 @@ partial void ProcessRestartAConversationStartingFromAGivenEntry2Response(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -201,8 +211,7 @@ partial void ProcessRestartAConversationStartingFromAGivenEntry2Response(
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -211,6 +220,11 @@ partial void ProcessRestartAConversationStartingFromAGivenEntry2Response(
__attempt < __maxAttempts &&
global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -227,14 +241,15 @@ partial void ProcessRestartAConversationStartingFromAGivenEntry2Response(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -274,6 +289,8 @@ partial void ProcessRestartAConversationStartingFromAGivenEntry2Response(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -294,6 +311,8 @@ partial void ProcessRestartAConversationStartingFromAGivenEntry2Response(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
diff --git a/src/libs/Mistral/Generated/Mistral.BetaConversationsClient.RetrieveAConversationInformation.g.cs b/src/libs/Mistral/Generated/Mistral.BetaConversationsClient.RetrieveAConversationInformation.g.cs
index 1b3e65ac..ae956f24 100644
--- a/src/libs/Mistral/Generated/Mistral.BetaConversationsClient.RetrieveAConversationInformation.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.BetaConversationsClient.RetrieveAConversationInformation.g.cs
@@ -55,6 +55,29 @@ partial void ProcessRetrieveAConversationInformationResponseContent(
string conversationId,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await RetrieveAConversationInformationAsResponseAsync(
+ conversationId: conversationId,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Retrieve a conversation information.
+ /// Given a conversation_id retrieve a conversation entity with its attributes.
+ ///
+ ///
+ /// ID of the conversation from which we are fetching metadata.
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task>> RetrieveAConversationInformationAsResponseAsync(
+ string conversationId,
+ global::Mistral.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -84,6 +107,7 @@ partial void ProcessRetrieveAConversationInformationResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Mistral.PathBuilder(
path: $"/v1/conversations/{conversationId}",
baseUri: HttpClient.BaseAddress);
@@ -157,6 +181,8 @@ partial void ProcessRetrieveAConversationInformationResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -167,6 +193,11 @@ partial void ProcessRetrieveAConversationInformationResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -184,6 +215,8 @@ partial void ProcessRetrieveAConversationInformationResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -193,8 +226,7 @@ partial void ProcessRetrieveAConversationInformationResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -203,6 +235,11 @@ partial void ProcessRetrieveAConversationInformationResponseContent(
__attempt < __maxAttempts &&
global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -219,14 +256,15 @@ partial void ProcessRetrieveAConversationInformationResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -266,6 +304,8 @@ partial void ProcessRetrieveAConversationInformationResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -286,6 +326,8 @@ partial void ProcessRetrieveAConversationInformationResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -348,9 +390,13 @@ partial void ProcessRetrieveAConversationInformationResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Mistral.AnyOf.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Mistral.AnyOf.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Mistral.AutoSDKHttpResponse>(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -378,9 +424,13 @@ partial void ProcessRetrieveAConversationInformationResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Mistral.AnyOf.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Mistral.AnyOf.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Mistral.AutoSDKHttpResponse>(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Mistral/Generated/Mistral.BetaConversationsClient.RetrieveAllEntriesInAConversation.g.cs b/src/libs/Mistral/Generated/Mistral.BetaConversationsClient.RetrieveAllEntriesInAConversation.g.cs
index 6e2d59cf..1999a74b 100644
--- a/src/libs/Mistral/Generated/Mistral.BetaConversationsClient.RetrieveAllEntriesInAConversation.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.BetaConversationsClient.RetrieveAllEntriesInAConversation.g.cs
@@ -55,6 +55,29 @@ partial void ProcessRetrieveAllEntriesInAConversationResponseContent(
string conversationId,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await RetrieveAllEntriesInAConversationAsResponseAsync(
+ conversationId: conversationId,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Retrieve all entries in a conversation.
+ /// Given a conversation_id retrieve all the entries belonging to that conversation. The entries are sorted in the order they were appended, those can be messages, connectors or function_call.
+ ///
+ ///
+ /// ID of the conversation from which we are fetching entries.
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> RetrieveAllEntriesInAConversationAsResponseAsync(
+ string conversationId,
+ global::Mistral.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -84,6 +107,7 @@ partial void ProcessRetrieveAllEntriesInAConversationResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Mistral.PathBuilder(
path: $"/v1/conversations/{conversationId}/history",
baseUri: HttpClient.BaseAddress);
@@ -157,6 +181,8 @@ partial void ProcessRetrieveAllEntriesInAConversationResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -167,6 +193,11 @@ partial void ProcessRetrieveAllEntriesInAConversationResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -184,6 +215,8 @@ partial void ProcessRetrieveAllEntriesInAConversationResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -193,8 +226,7 @@ partial void ProcessRetrieveAllEntriesInAConversationResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -203,6 +235,11 @@ partial void ProcessRetrieveAllEntriesInAConversationResponseContent(
__attempt < __maxAttempts &&
global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -219,14 +256,15 @@ partial void ProcessRetrieveAllEntriesInAConversationResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -266,6 +304,8 @@ partial void ProcessRetrieveAllEntriesInAConversationResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -286,6 +326,8 @@ partial void ProcessRetrieveAllEntriesInAConversationResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -348,9 +390,13 @@ partial void ProcessRetrieveAllEntriesInAConversationResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Mistral.ConversationHistory.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Mistral.ConversationHistory.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -378,9 +424,13 @@ partial void ProcessRetrieveAllEntriesInAConversationResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Mistral.ConversationHistory.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Mistral.ConversationHistory.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Mistral/Generated/Mistral.BetaConversationsClient.RetrieveAllMessagesInAConversation.g.cs b/src/libs/Mistral/Generated/Mistral.BetaConversationsClient.RetrieveAllMessagesInAConversation.g.cs
index b8ff6d6e..aa817dc3 100644
--- a/src/libs/Mistral/Generated/Mistral.BetaConversationsClient.RetrieveAllMessagesInAConversation.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.BetaConversationsClient.RetrieveAllMessagesInAConversation.g.cs
@@ -55,6 +55,29 @@ partial void ProcessRetrieveAllMessagesInAConversationResponseContent(
string conversationId,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await RetrieveAllMessagesInAConversationAsResponseAsync(
+ conversationId: conversationId,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Retrieve all messages in a conversation.
+ /// Given a conversation_id retrieve all the messages belonging to that conversation. This is similar to retrieving all entries except we filter the messages only.
+ ///
+ ///
+ /// ID of the conversation from which we are fetching messages.
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> RetrieveAllMessagesInAConversationAsResponseAsync(
+ string conversationId,
+ global::Mistral.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -84,6 +107,7 @@ partial void ProcessRetrieveAllMessagesInAConversationResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Mistral.PathBuilder(
path: $"/v1/conversations/{conversationId}/messages",
baseUri: HttpClient.BaseAddress);
@@ -157,6 +181,8 @@ partial void ProcessRetrieveAllMessagesInAConversationResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -167,6 +193,11 @@ partial void ProcessRetrieveAllMessagesInAConversationResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -184,6 +215,8 @@ partial void ProcessRetrieveAllMessagesInAConversationResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -193,8 +226,7 @@ partial void ProcessRetrieveAllMessagesInAConversationResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -203,6 +235,11 @@ partial void ProcessRetrieveAllMessagesInAConversationResponseContent(
__attempt < __maxAttempts &&
global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -219,14 +256,15 @@ partial void ProcessRetrieveAllMessagesInAConversationResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -266,6 +304,8 @@ partial void ProcessRetrieveAllMessagesInAConversationResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -286,6 +326,8 @@ partial void ProcessRetrieveAllMessagesInAConversationResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -348,9 +390,13 @@ partial void ProcessRetrieveAllMessagesInAConversationResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Mistral.ConversationMessages.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Mistral.ConversationMessages.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -378,9 +424,13 @@ partial void ProcessRetrieveAllMessagesInAConversationResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Mistral.ConversationMessages.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Mistral.ConversationMessages.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Mistral/Generated/Mistral.BetaConversationsClient.g.cs b/src/libs/Mistral/Generated/Mistral.BetaConversationsClient.g.cs
index 7a6cc97d..7b53a488 100644
--- a/src/libs/Mistral/Generated/Mistral.BetaConversationsClient.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.BetaConversationsClient.g.cs
@@ -73,10 +73,10 @@ public BetaConversationsClient(
/// Client-wide request defaults such as headers, query parameters, retries, and timeout.
/// Dispose the HttpClient when the instance is disposed. True by default.
public BetaConversationsClient(
- global::System.Net.Http.HttpClient? httpClient = null,
- global::System.Uri? baseUri = null,
- global::System.Collections.Generic.List? authorizations = null,
- global::Mistral.AutoSDKClientOptions? options = null,
+ global::System.Net.Http.HttpClient? httpClient,
+ global::System.Uri? baseUri,
+ global::System.Collections.Generic.List? authorizations,
+ global::Mistral.AutoSDKClientOptions? options,
bool disposeHttpClient = true)
{
diff --git a/src/libs/Mistral/Generated/Mistral.BetaLibrariesAccessesClient.CreateOrUpdateAnAccessLevel.g.cs b/src/libs/Mistral/Generated/Mistral.BetaLibrariesAccessesClient.CreateOrUpdateAnAccessLevel.g.cs
index 2ec0555d..031c79a9 100644
--- a/src/libs/Mistral/Generated/Mistral.BetaLibrariesAccessesClient.CreateOrUpdateAnAccessLevel.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.BetaLibrariesAccessesClient.CreateOrUpdateAnAccessLevel.g.cs
@@ -55,6 +55,32 @@ partial void ProcessCreateOrUpdateAnAccessLevelResponseContent(
public async global::System.Threading.Tasks.Task CreateOrUpdateAnAccessLevelAsync(
global::System.Guid libraryId,
+ global::Mistral.SharingIn request,
+ global::Mistral.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await CreateOrUpdateAnAccessLevelAsResponseAsync(
+ libraryId: libraryId,
+
+ request: request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Create or update an access level.
+ /// Given a library id, you can create or update the access level of an entity. You have to be owner of the library to share a library. An owner cannot change their own role. A library cannot be shared outside of the organization.
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> CreateOrUpdateAnAccessLevelAsResponseAsync(
+ global::System.Guid libraryId,
+
global::Mistral.SharingIn request,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
@@ -90,6 +116,7 @@ partial void ProcessCreateOrUpdateAnAccessLevelResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Mistral.PathBuilder(
path: $"/v1/libraries/{libraryId}/share",
baseUri: HttpClient.BaseAddress);
@@ -170,6 +197,8 @@ partial void ProcessCreateOrUpdateAnAccessLevelResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -180,6 +209,11 @@ partial void ProcessCreateOrUpdateAnAccessLevelResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -197,6 +231,8 @@ partial void ProcessCreateOrUpdateAnAccessLevelResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -206,8 +242,7 @@ partial void ProcessCreateOrUpdateAnAccessLevelResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -216,6 +251,11 @@ partial void ProcessCreateOrUpdateAnAccessLevelResponseContent(
__attempt < __maxAttempts &&
global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -232,14 +272,15 @@ partial void ProcessCreateOrUpdateAnAccessLevelResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -279,6 +320,8 @@ partial void ProcessCreateOrUpdateAnAccessLevelResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -299,6 +342,8 @@ partial void ProcessCreateOrUpdateAnAccessLevelResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -361,9 +406,13 @@ partial void ProcessCreateOrUpdateAnAccessLevelResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Mistral.SharingOut.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Mistral.SharingOut.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -391,9 +440,13 @@ partial void ProcessCreateOrUpdateAnAccessLevelResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Mistral.SharingOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Mistral.SharingOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Mistral/Generated/Mistral.BetaLibrariesAccessesClient.DeleteAnAccessLevel.g.cs b/src/libs/Mistral/Generated/Mistral.BetaLibrariesAccessesClient.DeleteAnAccessLevel.g.cs
index 93bef260..3e0717f2 100644
--- a/src/libs/Mistral/Generated/Mistral.BetaLibrariesAccessesClient.DeleteAnAccessLevel.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.BetaLibrariesAccessesClient.DeleteAnAccessLevel.g.cs
@@ -55,6 +55,32 @@ partial void ProcessDeleteAnAccessLevelResponseContent(
public async global::System.Threading.Tasks.Task DeleteAnAccessLevelAsync(
global::System.Guid libraryId,
+ global::Mistral.SharingDelete request,
+ global::Mistral.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await DeleteAnAccessLevelAsResponseAsync(
+ libraryId: libraryId,
+
+ request: request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Delete an access level.
+ /// Given a library id, you can delete the access level of an entity. An owner cannot delete it's own access. You have to be the owner of the library to delete an acces other than yours.
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> DeleteAnAccessLevelAsResponseAsync(
+ global::System.Guid libraryId,
+
global::Mistral.SharingDelete request,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
@@ -90,6 +116,7 @@ partial void ProcessDeleteAnAccessLevelResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Mistral.PathBuilder(
path: $"/v1/libraries/{libraryId}/share",
baseUri: HttpClient.BaseAddress);
@@ -170,6 +197,8 @@ partial void ProcessDeleteAnAccessLevelResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -180,6 +209,11 @@ partial void ProcessDeleteAnAccessLevelResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -197,6 +231,8 @@ partial void ProcessDeleteAnAccessLevelResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -206,8 +242,7 @@ partial void ProcessDeleteAnAccessLevelResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -216,6 +251,11 @@ partial void ProcessDeleteAnAccessLevelResponseContent(
__attempt < __maxAttempts &&
global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -232,14 +272,15 @@ partial void ProcessDeleteAnAccessLevelResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -279,6 +320,8 @@ partial void ProcessDeleteAnAccessLevelResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -299,6 +342,8 @@ partial void ProcessDeleteAnAccessLevelResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -361,9 +406,13 @@ partial void ProcessDeleteAnAccessLevelResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Mistral.SharingOut.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Mistral.SharingOut.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -391,9 +440,13 @@ partial void ProcessDeleteAnAccessLevelResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Mistral.SharingOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Mistral.SharingOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Mistral/Generated/Mistral.BetaLibrariesAccessesClient.ListAllOfTheAccessToThisLibrary.g.cs b/src/libs/Mistral/Generated/Mistral.BetaLibrariesAccessesClient.ListAllOfTheAccessToThisLibrary.g.cs
index a2b18c67..ca9d6af6 100644
--- a/src/libs/Mistral/Generated/Mistral.BetaLibrariesAccessesClient.ListAllOfTheAccessToThisLibrary.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.BetaLibrariesAccessesClient.ListAllOfTheAccessToThisLibrary.g.cs
@@ -53,6 +53,27 @@ partial void ProcessListAllOfTheAccessToThisLibraryResponseContent(
global::System.Guid libraryId,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await ListAllOfTheAccessToThisLibraryAsResponseAsync(
+ libraryId: libraryId,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// List all of the access to this library.
+ /// Given a library, list all of the Entity that have access and to what level.
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> ListAllOfTheAccessToThisLibraryAsResponseAsync(
+ global::System.Guid libraryId,
+ global::Mistral.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -82,6 +103,7 @@ partial void ProcessListAllOfTheAccessToThisLibraryResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Mistral.PathBuilder(
path: $"/v1/libraries/{libraryId}/share",
baseUri: HttpClient.BaseAddress);
@@ -155,6 +177,8 @@ partial void ProcessListAllOfTheAccessToThisLibraryResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -165,6 +189,11 @@ partial void ProcessListAllOfTheAccessToThisLibraryResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -182,6 +211,8 @@ partial void ProcessListAllOfTheAccessToThisLibraryResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -191,8 +222,7 @@ partial void ProcessListAllOfTheAccessToThisLibraryResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -201,6 +231,11 @@ partial void ProcessListAllOfTheAccessToThisLibraryResponseContent(
__attempt < __maxAttempts &&
global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -217,14 +252,15 @@ partial void ProcessListAllOfTheAccessToThisLibraryResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -264,6 +300,8 @@ partial void ProcessListAllOfTheAccessToThisLibraryResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -284,6 +322,8 @@ partial void ProcessListAllOfTheAccessToThisLibraryResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -346,9 +386,13 @@ partial void ProcessListAllOfTheAccessToThisLibraryResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Mistral.ListSharingOut.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Mistral.ListSharingOut.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -376,9 +420,13 @@ partial void ProcessListAllOfTheAccessToThisLibraryResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Mistral.ListSharingOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Mistral.ListSharingOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Mistral/Generated/Mistral.BetaLibrariesAccessesClient.g.cs b/src/libs/Mistral/Generated/Mistral.BetaLibrariesAccessesClient.g.cs
index 63693d39..56f7c794 100644
--- a/src/libs/Mistral/Generated/Mistral.BetaLibrariesAccessesClient.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.BetaLibrariesAccessesClient.g.cs
@@ -73,10 +73,10 @@ public BetaLibrariesAccessesClient(
/// Client-wide request defaults such as headers, query parameters, retries, and timeout.
/// Dispose the HttpClient when the instance is disposed. True by default.
public BetaLibrariesAccessesClient(
- global::System.Net.Http.HttpClient? httpClient = null,
- global::System.Uri? baseUri = null,
- global::System.Collections.Generic.List? authorizations = null,
- global::Mistral.AutoSDKClientOptions? options = null,
+ global::System.Net.Http.HttpClient? httpClient,
+ global::System.Uri? baseUri,
+ global::System.Collections.Generic.List? authorizations,
+ global::Mistral.AutoSDKClientOptions? options,
bool disposeHttpClient = true)
{
diff --git a/src/libs/Mistral/Generated/Mistral.BetaLibrariesClient.CreateANewLibrary.g.cs b/src/libs/Mistral/Generated/Mistral.BetaLibrariesClient.CreateANewLibrary.g.cs
index 9eeb7079..6c60a504 100644
--- a/src/libs/Mistral/Generated/Mistral.BetaLibrariesClient.CreateANewLibrary.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.BetaLibrariesClient.CreateANewLibrary.g.cs
@@ -51,6 +51,29 @@ partial void ProcessCreateANewLibraryResponseContent(
///
public async global::System.Threading.Tasks.Task CreateANewLibraryAsync(
+ global::Mistral.LibraryIn request,
+ global::Mistral.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await CreateANewLibraryAsResponseAsync(
+
+ request: request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Create a new Library.
+ /// Create a new Library, you will be marked as the owner and only you will have the possibility to share it with others. When first created this will only be accessible by you.
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> CreateANewLibraryAsResponseAsync(
+
global::Mistral.LibraryIn request,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
@@ -85,6 +108,7 @@ partial void ProcessCreateANewLibraryResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Mistral.PathBuilder(
path: "/v1/libraries",
baseUri: HttpClient.BaseAddress);
@@ -164,6 +188,8 @@ partial void ProcessCreateANewLibraryResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -174,6 +200,11 @@ partial void ProcessCreateANewLibraryResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -191,6 +222,8 @@ partial void ProcessCreateANewLibraryResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -200,8 +233,7 @@ partial void ProcessCreateANewLibraryResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -210,6 +242,11 @@ partial void ProcessCreateANewLibraryResponseContent(
__attempt < __maxAttempts &&
global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -226,14 +263,15 @@ partial void ProcessCreateANewLibraryResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -273,6 +311,8 @@ partial void ProcessCreateANewLibraryResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -293,6 +333,8 @@ partial void ProcessCreateANewLibraryResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -355,9 +397,13 @@ partial void ProcessCreateANewLibraryResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Mistral.LibraryOut.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Mistral.LibraryOut.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -385,9 +431,13 @@ partial void ProcessCreateANewLibraryResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Mistral.LibraryOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Mistral.LibraryOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Mistral/Generated/Mistral.BetaLibrariesClient.DeleteALibraryAndAllOfItsDocument.g.cs b/src/libs/Mistral/Generated/Mistral.BetaLibrariesClient.DeleteALibraryAndAllOfItsDocument.g.cs
index 30cf0042..8f481a1b 100644
--- a/src/libs/Mistral/Generated/Mistral.BetaLibrariesClient.DeleteALibraryAndAllOfItsDocument.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.BetaLibrariesClient.DeleteALibraryAndAllOfItsDocument.g.cs
@@ -53,6 +53,27 @@ partial void ProcessDeleteALibraryAndAllOfItsDocumentResponseContent(
global::System.Guid libraryId,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await DeleteALibraryAndAllOfItsDocumentAsResponseAsync(
+ libraryId: libraryId,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Delete a library and all of it's document.
+ /// Given a library id, deletes it together with all documents that have been uploaded to that library.
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> DeleteALibraryAndAllOfItsDocumentAsResponseAsync(
+ global::System.Guid libraryId,
+ global::Mistral.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -82,6 +103,7 @@ partial void ProcessDeleteALibraryAndAllOfItsDocumentResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Mistral.PathBuilder(
path: $"/v1/libraries/{libraryId}",
baseUri: HttpClient.BaseAddress);
@@ -155,6 +177,8 @@ partial void ProcessDeleteALibraryAndAllOfItsDocumentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -165,6 +189,11 @@ partial void ProcessDeleteALibraryAndAllOfItsDocumentResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -182,6 +211,8 @@ partial void ProcessDeleteALibraryAndAllOfItsDocumentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -191,8 +222,7 @@ partial void ProcessDeleteALibraryAndAllOfItsDocumentResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -201,6 +231,11 @@ partial void ProcessDeleteALibraryAndAllOfItsDocumentResponseContent(
__attempt < __maxAttempts &&
global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -217,14 +252,15 @@ partial void ProcessDeleteALibraryAndAllOfItsDocumentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -264,6 +300,8 @@ partial void ProcessDeleteALibraryAndAllOfItsDocumentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -284,6 +322,8 @@ partial void ProcessDeleteALibraryAndAllOfItsDocumentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -346,9 +386,13 @@ partial void ProcessDeleteALibraryAndAllOfItsDocumentResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Mistral.LibraryOut.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Mistral.LibraryOut.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -376,9 +420,13 @@ partial void ProcessDeleteALibraryAndAllOfItsDocumentResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Mistral.LibraryOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Mistral.LibraryOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Mistral/Generated/Mistral.BetaLibrariesClient.DetailedInformationAboutASpecificLibrary.g.cs b/src/libs/Mistral/Generated/Mistral.BetaLibrariesClient.DetailedInformationAboutASpecificLibrary.g.cs
index 27be3cc3..089bd3d0 100644
--- a/src/libs/Mistral/Generated/Mistral.BetaLibrariesClient.DetailedInformationAboutASpecificLibrary.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.BetaLibrariesClient.DetailedInformationAboutASpecificLibrary.g.cs
@@ -53,6 +53,27 @@ partial void ProcessDetailedInformationAboutASpecificLibraryResponseContent(
global::System.Guid libraryId,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await DetailedInformationAboutASpecificLibraryAsResponseAsync(
+ libraryId: libraryId,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Detailed information about a specific Library.
+ /// Given a library id, details information about that Library.
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> DetailedInformationAboutASpecificLibraryAsResponseAsync(
+ global::System.Guid libraryId,
+ global::Mistral.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -82,6 +103,7 @@ partial void ProcessDetailedInformationAboutASpecificLibraryResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Mistral.PathBuilder(
path: $"/v1/libraries/{libraryId}",
baseUri: HttpClient.BaseAddress);
@@ -155,6 +177,8 @@ partial void ProcessDetailedInformationAboutASpecificLibraryResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -165,6 +189,11 @@ partial void ProcessDetailedInformationAboutASpecificLibraryResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -182,6 +211,8 @@ partial void ProcessDetailedInformationAboutASpecificLibraryResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -191,8 +222,7 @@ partial void ProcessDetailedInformationAboutASpecificLibraryResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -201,6 +231,11 @@ partial void ProcessDetailedInformationAboutASpecificLibraryResponseContent(
__attempt < __maxAttempts &&
global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -217,14 +252,15 @@ partial void ProcessDetailedInformationAboutASpecificLibraryResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -264,6 +300,8 @@ partial void ProcessDetailedInformationAboutASpecificLibraryResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -284,6 +322,8 @@ partial void ProcessDetailedInformationAboutASpecificLibraryResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -346,9 +386,13 @@ partial void ProcessDetailedInformationAboutASpecificLibraryResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Mistral.LibraryOut.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Mistral.LibraryOut.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -376,9 +420,13 @@ partial void ProcessDetailedInformationAboutASpecificLibraryResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Mistral.LibraryOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Mistral.LibraryOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Mistral/Generated/Mistral.BetaLibrariesClient.ListAllLibrariesYouHaveAccessTo.g.cs b/src/libs/Mistral/Generated/Mistral.BetaLibrariesClient.ListAllLibrariesYouHaveAccessTo.g.cs
index 3f073544..0b32ccf3 100644
--- a/src/libs/Mistral/Generated/Mistral.BetaLibrariesClient.ListAllLibrariesYouHaveAccessTo.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.BetaLibrariesClient.ListAllLibrariesYouHaveAccessTo.g.cs
@@ -49,6 +49,24 @@ partial void ProcessListAllLibrariesYouHaveAccessToResponseContent(
public async global::System.Threading.Tasks.Task ListAllLibrariesYouHaveAccessToAsync(
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await ListAllLibrariesYouHaveAccessToAsResponseAsync(
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// List all libraries you have access to.
+ /// List all libraries that you have created or have been shared with you.
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> ListAllLibrariesYouHaveAccessToAsResponseAsync(
+ global::Mistral.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -77,6 +95,7 @@ partial void ProcessListAllLibrariesYouHaveAccessToResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Mistral.PathBuilder(
path: "/v1/libraries",
baseUri: HttpClient.BaseAddress);
@@ -149,6 +168,8 @@ partial void ProcessListAllLibrariesYouHaveAccessToResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -159,6 +180,11 @@ partial void ProcessListAllLibrariesYouHaveAccessToResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -176,6 +202,8 @@ partial void ProcessListAllLibrariesYouHaveAccessToResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -185,8 +213,7 @@ partial void ProcessListAllLibrariesYouHaveAccessToResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -195,6 +222,11 @@ partial void ProcessListAllLibrariesYouHaveAccessToResponseContent(
__attempt < __maxAttempts &&
global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -211,14 +243,15 @@ partial void ProcessListAllLibrariesYouHaveAccessToResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -258,6 +291,8 @@ partial void ProcessListAllLibrariesYouHaveAccessToResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -278,6 +313,8 @@ partial void ProcessListAllLibrariesYouHaveAccessToResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
@@ -302,9 +339,13 @@ partial void ProcessListAllLibrariesYouHaveAccessToResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Mistral.ListLibraryOut.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Mistral.ListLibraryOut.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -332,9 +373,13 @@ partial void ProcessListAllLibrariesYouHaveAccessToResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Mistral.ListLibraryOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Mistral.ListLibraryOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Mistral/Generated/Mistral.BetaLibrariesClient.UpdateALibrary.g.cs b/src/libs/Mistral/Generated/Mistral.BetaLibrariesClient.UpdateALibrary.g.cs
index dcd2e7ce..a529fb03 100644
--- a/src/libs/Mistral/Generated/Mistral.BetaLibrariesClient.UpdateALibrary.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.BetaLibrariesClient.UpdateALibrary.g.cs
@@ -55,6 +55,32 @@ partial void ProcessUpdateALibraryResponseContent(
public async global::System.Threading.Tasks.Task UpdateALibraryAsync(
global::System.Guid libraryId,
+ global::Mistral.LibraryInUpdate request,
+ global::Mistral.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await UpdateALibraryAsResponseAsync(
+ libraryId: libraryId,
+
+ request: request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Update a library.
+ /// Given a library id, you can update the name and description.
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> UpdateALibraryAsResponseAsync(
+ global::System.Guid libraryId,
+
global::Mistral.LibraryInUpdate request,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
@@ -90,6 +116,7 @@ partial void ProcessUpdateALibraryResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Mistral.PathBuilder(
path: $"/v1/libraries/{libraryId}",
baseUri: HttpClient.BaseAddress);
@@ -170,6 +197,8 @@ partial void ProcessUpdateALibraryResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -180,6 +209,11 @@ partial void ProcessUpdateALibraryResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -197,6 +231,8 @@ partial void ProcessUpdateALibraryResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -206,8 +242,7 @@ partial void ProcessUpdateALibraryResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -216,6 +251,11 @@ partial void ProcessUpdateALibraryResponseContent(
__attempt < __maxAttempts &&
global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -232,14 +272,15 @@ partial void ProcessUpdateALibraryResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -279,6 +320,8 @@ partial void ProcessUpdateALibraryResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -299,6 +342,8 @@ partial void ProcessUpdateALibraryResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -361,9 +406,13 @@ partial void ProcessUpdateALibraryResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Mistral.LibraryOut.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Mistral.LibraryOut.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -391,9 +440,13 @@ partial void ProcessUpdateALibraryResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Mistral.LibraryOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Mistral.LibraryOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Mistral/Generated/Mistral.BetaLibrariesClient.g.cs b/src/libs/Mistral/Generated/Mistral.BetaLibrariesClient.g.cs
index 8983e056..ff1573bb 100644
--- a/src/libs/Mistral/Generated/Mistral.BetaLibrariesClient.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.BetaLibrariesClient.g.cs
@@ -73,10 +73,10 @@ public BetaLibrariesClient(
/// Client-wide request defaults such as headers, query parameters, retries, and timeout.
/// Dispose the HttpClient when the instance is disposed. True by default.
public BetaLibrariesClient(
- global::System.Net.Http.HttpClient? httpClient = null,
- global::System.Uri? baseUri = null,
- global::System.Collections.Generic.List? authorizations = null,
- global::Mistral.AutoSDKClientOptions? options = null,
+ global::System.Net.Http.HttpClient? httpClient,
+ global::System.Uri? baseUri,
+ global::System.Collections.Generic.List? authorizations,
+ global::Mistral.AutoSDKClientOptions? options,
bool disposeHttpClient = true)
{
diff --git a/src/libs/Mistral/Generated/Mistral.BetaLibrariesDocumentsClient.DeleteADocument.g.cs b/src/libs/Mistral/Generated/Mistral.BetaLibrariesDocumentsClient.DeleteADocument.g.cs
index 06e4d641..ad3bf0d0 100644
--- a/src/libs/Mistral/Generated/Mistral.BetaLibrariesDocumentsClient.DeleteADocument.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.BetaLibrariesDocumentsClient.DeleteADocument.g.cs
@@ -52,6 +52,28 @@ partial void ProcessDeleteADocumentResponse(
global::System.Guid documentId,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ await DeleteADocumentAsResponseAsync(
+ libraryId: libraryId,
+ documentId: documentId,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+ }
+ ///
+ /// Delete a document.
+ /// Given a library and a document in that library, delete that document. The document will be deleted from the library and the search index.
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task DeleteADocumentAsResponseAsync(
+ global::System.Guid libraryId,
+ global::System.Guid documentId,
+ global::Mistral.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -82,6 +104,7 @@ partial void ProcessDeleteADocumentResponse(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Mistral.PathBuilder(
path: $"/v1/libraries/{libraryId}/documents/{documentId}",
baseUri: HttpClient.BaseAddress);
@@ -156,6 +179,8 @@ partial void ProcessDeleteADocumentResponse(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -166,6 +191,11 @@ partial void ProcessDeleteADocumentResponse(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -183,6 +213,8 @@ partial void ProcessDeleteADocumentResponse(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -192,8 +224,7 @@ partial void ProcessDeleteADocumentResponse(
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -202,6 +233,11 @@ partial void ProcessDeleteADocumentResponse(
__attempt < __maxAttempts &&
global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -218,14 +254,15 @@ partial void ProcessDeleteADocumentResponse(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -265,6 +302,8 @@ partial void ProcessDeleteADocumentResponse(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -285,6 +324,8 @@ partial void ProcessDeleteADocumentResponse(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -343,6 +384,10 @@ partial void ProcessDeleteADocumentResponse(
{
__response.EnsureSuccessStatusCode();
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri);
}
catch (global::System.Exception __ex)
{
@@ -364,6 +409,10 @@ partial void ProcessDeleteADocumentResponse(
try
{
__response.EnsureSuccessStatusCode();
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Mistral/Generated/Mistral.BetaLibrariesDocumentsClient.ListDocumentsInAGivenLibrary.g.cs b/src/libs/Mistral/Generated/Mistral.BetaLibrariesDocumentsClient.ListDocumentsInAGivenLibrary.g.cs
index 40c4342d..da386dc3 100644
--- a/src/libs/Mistral/Generated/Mistral.BetaLibrariesDocumentsClient.ListDocumentsInAGivenLibrary.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.BetaLibrariesDocumentsClient.ListDocumentsInAGivenLibrary.g.cs
@@ -85,6 +85,53 @@ partial void ProcessListDocumentsInAGivenLibraryResponseContent(
string? sortOrder = default,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await ListDocumentsInAGivenLibraryAsResponseAsync(
+ libraryId: libraryId,
+ search: search,
+ pageSize: pageSize,
+ page: page,
+ filtersAttributes: filtersAttributes,
+ sortBy: sortBy,
+ sortOrder: sortOrder,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// List documents in a given library.
+ /// Given a library, lists the document that have been uploaded to that library.
+ ///
+ ///
+ ///
+ ///
+ /// Default Value: 100
+ ///
+ ///
+ /// Default Value: 0
+ ///
+ ///
+ ///
+ /// Default Value: created_at
+ ///
+ ///
+ /// Default Value: desc
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> ListDocumentsInAGivenLibraryAsResponseAsync(
+ global::System.Guid libraryId,
+ string? search = default,
+ int? pageSize = default,
+ int? page = default,
+ string? filtersAttributes = default,
+ string? sortBy = default,
+ string? sortOrder = default,
+ global::Mistral.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -120,16 +167,17 @@ partial void ProcessListDocumentsInAGivenLibraryResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Mistral.PathBuilder(
path: $"/v1/libraries/{libraryId}/documents",
- baseUri: HttpClient.BaseAddress);
+ baseUri: HttpClient.BaseAddress);
__pathBuilder
.AddOptionalParameter("search", search)
.AddOptionalParameter("page_size", pageSize?.ToString())
.AddOptionalParameter("page", page?.ToString())
.AddOptionalParameter("filters_attributes", filtersAttributes)
.AddOptionalParameter("sort_by", sortBy)
- .AddOptionalParameter("sort_order", sortOrder)
+ .AddOptionalParameter("sort_order", sortOrder)
;
var __path = __pathBuilder.ToString();
__path = global::Mistral.AutoSDKRequestOptionsSupport.AppendQueryParameters(
@@ -207,6 +255,8 @@ partial void ProcessListDocumentsInAGivenLibraryResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -217,6 +267,11 @@ partial void ProcessListDocumentsInAGivenLibraryResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -234,6 +289,8 @@ partial void ProcessListDocumentsInAGivenLibraryResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -243,8 +300,7 @@ partial void ProcessListDocumentsInAGivenLibraryResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -253,6 +309,11 @@ partial void ProcessListDocumentsInAGivenLibraryResponseContent(
__attempt < __maxAttempts &&
global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -269,14 +330,15 @@ partial void ProcessListDocumentsInAGivenLibraryResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -316,6 +378,8 @@ partial void ProcessListDocumentsInAGivenLibraryResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -336,6 +400,8 @@ partial void ProcessListDocumentsInAGivenLibraryResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -398,9 +464,13 @@ partial void ProcessListDocumentsInAGivenLibraryResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Mistral.ListDocumentOut.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Mistral.ListDocumentOut.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -428,9 +498,13 @@ partial void ProcessListDocumentsInAGivenLibraryResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Mistral.ListDocumentOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Mistral.ListDocumentOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Mistral/Generated/Mistral.BetaLibrariesDocumentsClient.ReprocessADocument.g.cs b/src/libs/Mistral/Generated/Mistral.BetaLibrariesDocumentsClient.ReprocessADocument.g.cs
index d61480e8..023a4b71 100644
--- a/src/libs/Mistral/Generated/Mistral.BetaLibrariesDocumentsClient.ReprocessADocument.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.BetaLibrariesDocumentsClient.ReprocessADocument.g.cs
@@ -52,6 +52,28 @@ partial void ProcessReprocessADocumentResponse(
global::System.Guid documentId,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ await ReprocessADocumentAsResponseAsync(
+ libraryId: libraryId,
+ documentId: documentId,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+ }
+ ///
+ /// Reprocess a document.
+ /// Given a library and a document in that library, reprocess that document, it will be billed again.
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task ReprocessADocumentAsResponseAsync(
+ global::System.Guid libraryId,
+ global::System.Guid documentId,
+ global::Mistral.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -82,6 +104,7 @@ partial void ProcessReprocessADocumentResponse(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Mistral.PathBuilder(
path: $"/v1/libraries/{libraryId}/documents/{documentId}/reprocess",
baseUri: HttpClient.BaseAddress);
@@ -156,6 +179,8 @@ partial void ProcessReprocessADocumentResponse(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -166,6 +191,11 @@ partial void ProcessReprocessADocumentResponse(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -183,6 +213,8 @@ partial void ProcessReprocessADocumentResponse(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -192,8 +224,7 @@ partial void ProcessReprocessADocumentResponse(
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -202,6 +233,11 @@ partial void ProcessReprocessADocumentResponse(
__attempt < __maxAttempts &&
global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -218,14 +254,15 @@ partial void ProcessReprocessADocumentResponse(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -265,6 +302,8 @@ partial void ProcessReprocessADocumentResponse(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -285,6 +324,8 @@ partial void ProcessReprocessADocumentResponse(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -343,6 +384,10 @@ partial void ProcessReprocessADocumentResponse(
{
__response.EnsureSuccessStatusCode();
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri);
}
catch (global::System.Exception __ex)
{
@@ -364,6 +409,10 @@ partial void ProcessReprocessADocumentResponse(
try
{
__response.EnsureSuccessStatusCode();
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Mistral/Generated/Mistral.BetaLibrariesDocumentsClient.RetrieveTheMetadataOfASpecificDocument.g.cs b/src/libs/Mistral/Generated/Mistral.BetaLibrariesDocumentsClient.RetrieveTheMetadataOfASpecificDocument.g.cs
index 706ac9d3..14cebcf6 100644
--- a/src/libs/Mistral/Generated/Mistral.BetaLibrariesDocumentsClient.RetrieveTheMetadataOfASpecificDocument.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.BetaLibrariesDocumentsClient.RetrieveTheMetadataOfASpecificDocument.g.cs
@@ -57,6 +57,30 @@ partial void ProcessRetrieveTheMetadataOfASpecificDocumentResponseContent(
global::System.Guid documentId,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await RetrieveTheMetadataOfASpecificDocumentAsResponseAsync(
+ libraryId: libraryId,
+ documentId: documentId,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Retrieve the metadata of a specific document.
+ /// Given a library and a document in this library, you can retrieve the metadata of that document.
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> RetrieveTheMetadataOfASpecificDocumentAsResponseAsync(
+ global::System.Guid libraryId,
+ global::System.Guid documentId,
+ global::Mistral.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -87,6 +111,7 @@ partial void ProcessRetrieveTheMetadataOfASpecificDocumentResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Mistral.PathBuilder(
path: $"/v1/libraries/{libraryId}/documents/{documentId}",
baseUri: HttpClient.BaseAddress);
@@ -161,6 +186,8 @@ partial void ProcessRetrieveTheMetadataOfASpecificDocumentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -171,6 +198,11 @@ partial void ProcessRetrieveTheMetadataOfASpecificDocumentResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -188,6 +220,8 @@ partial void ProcessRetrieveTheMetadataOfASpecificDocumentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -197,8 +231,7 @@ partial void ProcessRetrieveTheMetadataOfASpecificDocumentResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -207,6 +240,11 @@ partial void ProcessRetrieveTheMetadataOfASpecificDocumentResponseContent(
__attempt < __maxAttempts &&
global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -223,14 +261,15 @@ partial void ProcessRetrieveTheMetadataOfASpecificDocumentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -270,6 +309,8 @@ partial void ProcessRetrieveTheMetadataOfASpecificDocumentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -290,6 +331,8 @@ partial void ProcessRetrieveTheMetadataOfASpecificDocumentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -352,9 +395,13 @@ partial void ProcessRetrieveTheMetadataOfASpecificDocumentResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Mistral.DocumentOut.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Mistral.DocumentOut.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -382,9 +429,13 @@ partial void ProcessRetrieveTheMetadataOfASpecificDocumentResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Mistral.DocumentOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Mistral.DocumentOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Mistral/Generated/Mistral.BetaLibrariesDocumentsClient.RetrieveTheProcessingStatusOfASpecificDocument.g.cs b/src/libs/Mistral/Generated/Mistral.BetaLibrariesDocumentsClient.RetrieveTheProcessingStatusOfASpecificDocument.g.cs
index b4adb229..d3f33a34 100644
--- a/src/libs/Mistral/Generated/Mistral.BetaLibrariesDocumentsClient.RetrieveTheProcessingStatusOfASpecificDocument.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.BetaLibrariesDocumentsClient.RetrieveTheProcessingStatusOfASpecificDocument.g.cs
@@ -57,6 +57,30 @@ partial void ProcessRetrieveTheProcessingStatusOfASpecificDocumentResponseConten
global::System.Guid documentId,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await RetrieveTheProcessingStatusOfASpecificDocumentAsResponseAsync(
+ libraryId: libraryId,
+ documentId: documentId,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Retrieve the processing status of a specific document.
+ /// Given a library and a document in that library, retrieve the processing status of that document.
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> RetrieveTheProcessingStatusOfASpecificDocumentAsResponseAsync(
+ global::System.Guid libraryId,
+ global::System.Guid documentId,
+ global::Mistral.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -87,6 +111,7 @@ partial void ProcessRetrieveTheProcessingStatusOfASpecificDocumentResponseConten
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Mistral.PathBuilder(
path: $"/v1/libraries/{libraryId}/documents/{documentId}/status",
baseUri: HttpClient.BaseAddress);
@@ -161,6 +186,8 @@ partial void ProcessRetrieveTheProcessingStatusOfASpecificDocumentResponseConten
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -171,6 +198,11 @@ partial void ProcessRetrieveTheProcessingStatusOfASpecificDocumentResponseConten
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -188,6 +220,8 @@ partial void ProcessRetrieveTheProcessingStatusOfASpecificDocumentResponseConten
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -197,8 +231,7 @@ partial void ProcessRetrieveTheProcessingStatusOfASpecificDocumentResponseConten
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -207,6 +240,11 @@ partial void ProcessRetrieveTheProcessingStatusOfASpecificDocumentResponseConten
__attempt < __maxAttempts &&
global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -223,14 +261,15 @@ partial void ProcessRetrieveTheProcessingStatusOfASpecificDocumentResponseConten
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -270,6 +309,8 @@ partial void ProcessRetrieveTheProcessingStatusOfASpecificDocumentResponseConten
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -290,6 +331,8 @@ partial void ProcessRetrieveTheProcessingStatusOfASpecificDocumentResponseConten
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -352,9 +395,13 @@ partial void ProcessRetrieveTheProcessingStatusOfASpecificDocumentResponseConten
{
__response.EnsureSuccessStatusCode();
- return
- global::Mistral.ProcessingStatusOut.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Mistral.ProcessingStatusOut.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -382,9 +429,13 @@ partial void ProcessRetrieveTheProcessingStatusOfASpecificDocumentResponseConten
#endif
).ConfigureAwait(false);
- return
- await global::Mistral.ProcessingStatusOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Mistral.ProcessingStatusOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Mistral/Generated/Mistral.BetaLibrariesDocumentsClient.RetrieveTheSignedUrlOfASpecificDocument.g.cs b/src/libs/Mistral/Generated/Mistral.BetaLibrariesDocumentsClient.RetrieveTheSignedUrlOfASpecificDocument.g.cs
index 1185c575..30d29513 100644
--- a/src/libs/Mistral/Generated/Mistral.BetaLibrariesDocumentsClient.RetrieveTheSignedUrlOfASpecificDocument.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.BetaLibrariesDocumentsClient.RetrieveTheSignedUrlOfASpecificDocument.g.cs
@@ -57,6 +57,30 @@ partial void ProcessRetrieveTheSignedUrlOfASpecificDocumentResponseContent(
global::System.Guid documentId,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await RetrieveTheSignedUrlOfASpecificDocumentAsResponseAsync(
+ libraryId: libraryId,
+ documentId: documentId,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Retrieve the signed URL of a specific document.
+ /// Given a library and a document in that library, retrieve the signed URL of a specific document.The url will expire after 30 minutes and can be accessed by anyone with the link.
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> RetrieveTheSignedUrlOfASpecificDocumentAsResponseAsync(
+ global::System.Guid libraryId,
+ global::System.Guid documentId,
+ global::Mistral.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -87,6 +111,7 @@ partial void ProcessRetrieveTheSignedUrlOfASpecificDocumentResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Mistral.PathBuilder(
path: $"/v1/libraries/{libraryId}/documents/{documentId}/signed-url",
baseUri: HttpClient.BaseAddress);
@@ -161,6 +186,8 @@ partial void ProcessRetrieveTheSignedUrlOfASpecificDocumentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -171,6 +198,11 @@ partial void ProcessRetrieveTheSignedUrlOfASpecificDocumentResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -188,6 +220,8 @@ partial void ProcessRetrieveTheSignedUrlOfASpecificDocumentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -197,8 +231,7 @@ partial void ProcessRetrieveTheSignedUrlOfASpecificDocumentResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -207,6 +240,11 @@ partial void ProcessRetrieveTheSignedUrlOfASpecificDocumentResponseContent(
__attempt < __maxAttempts &&
global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -223,14 +261,15 @@ partial void ProcessRetrieveTheSignedUrlOfASpecificDocumentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -270,6 +309,8 @@ partial void ProcessRetrieveTheSignedUrlOfASpecificDocumentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -290,6 +331,8 @@ partial void ProcessRetrieveTheSignedUrlOfASpecificDocumentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -352,7 +395,11 @@ partial void ProcessRetrieveTheSignedUrlOfASpecificDocumentResponseContent(
{
__response.EnsureSuccessStatusCode();
- return __content;
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __content);
}
catch (global::System.Exception __ex)
{
@@ -380,7 +427,11 @@ partial void ProcessRetrieveTheSignedUrlOfASpecificDocumentResponseContent(
#endif
).ConfigureAwait(false);
- return __content;
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __content);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Mistral/Generated/Mistral.BetaLibrariesDocumentsClient.RetrieveTheSignedUrlOfTextExtractedFromAGivenDocument.g.cs b/src/libs/Mistral/Generated/Mistral.BetaLibrariesDocumentsClient.RetrieveTheSignedUrlOfTextExtractedFromAGivenDocument.g.cs
index ab9e7c39..71f1da86 100644
--- a/src/libs/Mistral/Generated/Mistral.BetaLibrariesDocumentsClient.RetrieveTheSignedUrlOfTextExtractedFromAGivenDocument.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.BetaLibrariesDocumentsClient.RetrieveTheSignedUrlOfTextExtractedFromAGivenDocument.g.cs
@@ -57,6 +57,30 @@ partial void ProcessRetrieveTheSignedUrlOfTextExtractedFromAGivenDocumentRespons
global::System.Guid documentId,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await RetrieveTheSignedUrlOfTextExtractedFromAGivenDocumentAsResponseAsync(
+ libraryId: libraryId,
+ documentId: documentId,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Retrieve the signed URL of text extracted from a given document.
+ /// Given a library and a document in that library, retrieve the signed URL of text extracted. For documents that are sent to the OCR this returns the result of the OCR queries.
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> RetrieveTheSignedUrlOfTextExtractedFromAGivenDocumentAsResponseAsync(
+ global::System.Guid libraryId,
+ global::System.Guid documentId,
+ global::Mistral.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -87,6 +111,7 @@ partial void ProcessRetrieveTheSignedUrlOfTextExtractedFromAGivenDocumentRespons
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Mistral.PathBuilder(
path: $"/v1/libraries/{libraryId}/documents/{documentId}/extracted-text-signed-url",
baseUri: HttpClient.BaseAddress);
@@ -161,6 +186,8 @@ partial void ProcessRetrieveTheSignedUrlOfTextExtractedFromAGivenDocumentRespons
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -171,6 +198,11 @@ partial void ProcessRetrieveTheSignedUrlOfTextExtractedFromAGivenDocumentRespons
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -188,6 +220,8 @@ partial void ProcessRetrieveTheSignedUrlOfTextExtractedFromAGivenDocumentRespons
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -197,8 +231,7 @@ partial void ProcessRetrieveTheSignedUrlOfTextExtractedFromAGivenDocumentRespons
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -207,6 +240,11 @@ partial void ProcessRetrieveTheSignedUrlOfTextExtractedFromAGivenDocumentRespons
__attempt < __maxAttempts &&
global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -223,14 +261,15 @@ partial void ProcessRetrieveTheSignedUrlOfTextExtractedFromAGivenDocumentRespons
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -270,6 +309,8 @@ partial void ProcessRetrieveTheSignedUrlOfTextExtractedFromAGivenDocumentRespons
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -290,6 +331,8 @@ partial void ProcessRetrieveTheSignedUrlOfTextExtractedFromAGivenDocumentRespons
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -352,7 +395,11 @@ partial void ProcessRetrieveTheSignedUrlOfTextExtractedFromAGivenDocumentRespons
{
__response.EnsureSuccessStatusCode();
- return __content;
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __content);
}
catch (global::System.Exception __ex)
{
@@ -380,7 +427,11 @@ partial void ProcessRetrieveTheSignedUrlOfTextExtractedFromAGivenDocumentRespons
#endif
).ConfigureAwait(false);
- return __content;
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __content);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Mistral/Generated/Mistral.BetaLibrariesDocumentsClient.RetrieveTheTextContentOfASpecificDocument.g.cs b/src/libs/Mistral/Generated/Mistral.BetaLibrariesDocumentsClient.RetrieveTheTextContentOfASpecificDocument.g.cs
index 46a29bc3..bdeef3de 100644
--- a/src/libs/Mistral/Generated/Mistral.BetaLibrariesDocumentsClient.RetrieveTheTextContentOfASpecificDocument.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.BetaLibrariesDocumentsClient.RetrieveTheTextContentOfASpecificDocument.g.cs
@@ -57,6 +57,30 @@ partial void ProcessRetrieveTheTextContentOfASpecificDocumentResponseContent(
global::System.Guid documentId,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await RetrieveTheTextContentOfASpecificDocumentAsResponseAsync(
+ libraryId: libraryId,
+ documentId: documentId,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Retrieve the text content of a specific document.
+ /// Given a library and a document in that library, you can retrieve the text content of that document if it exists. For documents like pdf, docx and pptx the text content results from our processing using Mistral OCR.
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> RetrieveTheTextContentOfASpecificDocumentAsResponseAsync(
+ global::System.Guid libraryId,
+ global::System.Guid documentId,
+ global::Mistral.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -87,6 +111,7 @@ partial void ProcessRetrieveTheTextContentOfASpecificDocumentResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Mistral.PathBuilder(
path: $"/v1/libraries/{libraryId}/documents/{documentId}/text_content",
baseUri: HttpClient.BaseAddress);
@@ -161,6 +186,8 @@ partial void ProcessRetrieveTheTextContentOfASpecificDocumentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -171,6 +198,11 @@ partial void ProcessRetrieveTheTextContentOfASpecificDocumentResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -188,6 +220,8 @@ partial void ProcessRetrieveTheTextContentOfASpecificDocumentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -197,8 +231,7 @@ partial void ProcessRetrieveTheTextContentOfASpecificDocumentResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -207,6 +240,11 @@ partial void ProcessRetrieveTheTextContentOfASpecificDocumentResponseContent(
__attempt < __maxAttempts &&
global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -223,14 +261,15 @@ partial void ProcessRetrieveTheTextContentOfASpecificDocumentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -270,6 +309,8 @@ partial void ProcessRetrieveTheTextContentOfASpecificDocumentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -290,6 +331,8 @@ partial void ProcessRetrieveTheTextContentOfASpecificDocumentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -352,9 +395,13 @@ partial void ProcessRetrieveTheTextContentOfASpecificDocumentResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Mistral.DocumentTextContent.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Mistral.DocumentTextContent.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -382,9 +429,13 @@ partial void ProcessRetrieveTheTextContentOfASpecificDocumentResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Mistral.DocumentTextContent.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Mistral.DocumentTextContent.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Mistral/Generated/Mistral.BetaLibrariesDocumentsClient.UpdateTheMetadataOfASpecificDocument.g.cs b/src/libs/Mistral/Generated/Mistral.BetaLibrariesDocumentsClient.UpdateTheMetadataOfASpecificDocument.g.cs
index d63376bc..95191d39 100644
--- a/src/libs/Mistral/Generated/Mistral.BetaLibrariesDocumentsClient.UpdateTheMetadataOfASpecificDocument.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.BetaLibrariesDocumentsClient.UpdateTheMetadataOfASpecificDocument.g.cs
@@ -59,6 +59,35 @@ partial void ProcessUpdateTheMetadataOfASpecificDocumentResponseContent(
global::System.Guid libraryId,
global::System.Guid documentId,
+ global::Mistral.DocumentUpdateIn request,
+ global::Mistral.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await UpdateTheMetadataOfASpecificDocumentAsResponseAsync(
+ libraryId: libraryId,
+ documentId: documentId,
+
+ request: request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Update the metadata of a specific document.
+ /// Given a library and a document in that library, update the name of that document.
+ ///
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> UpdateTheMetadataOfASpecificDocumentAsResponseAsync(
+ global::System.Guid libraryId,
+ global::System.Guid documentId,
+
global::Mistral.DocumentUpdateIn request,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
@@ -95,6 +124,7 @@ partial void ProcessUpdateTheMetadataOfASpecificDocumentResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Mistral.PathBuilder(
path: $"/v1/libraries/{libraryId}/documents/{documentId}",
baseUri: HttpClient.BaseAddress);
@@ -176,6 +206,8 @@ partial void ProcessUpdateTheMetadataOfASpecificDocumentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -186,6 +218,11 @@ partial void ProcessUpdateTheMetadataOfASpecificDocumentResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -203,6 +240,8 @@ partial void ProcessUpdateTheMetadataOfASpecificDocumentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -212,8 +251,7 @@ partial void ProcessUpdateTheMetadataOfASpecificDocumentResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -222,6 +260,11 @@ partial void ProcessUpdateTheMetadataOfASpecificDocumentResponseContent(
__attempt < __maxAttempts &&
global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -238,14 +281,15 @@ partial void ProcessUpdateTheMetadataOfASpecificDocumentResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -285,6 +329,8 @@ partial void ProcessUpdateTheMetadataOfASpecificDocumentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -305,6 +351,8 @@ partial void ProcessUpdateTheMetadataOfASpecificDocumentResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -367,9 +415,13 @@ partial void ProcessUpdateTheMetadataOfASpecificDocumentResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Mistral.DocumentOut.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Mistral.DocumentOut.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -397,9 +449,13 @@ partial void ProcessUpdateTheMetadataOfASpecificDocumentResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Mistral.DocumentOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Mistral.DocumentOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Mistral/Generated/Mistral.BetaLibrariesDocumentsClient.UploadANewDocument.g.cs b/src/libs/Mistral/Generated/Mistral.BetaLibrariesDocumentsClient.UploadANewDocument.g.cs
index 30399608..f6bce00d 100644
--- a/src/libs/Mistral/Generated/Mistral.BetaLibrariesDocumentsClient.UploadANewDocument.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.BetaLibrariesDocumentsClient.UploadANewDocument.g.cs
@@ -55,6 +55,32 @@ partial void ProcessUploadANewDocumentResponseContent(
public async global::System.Threading.Tasks.Task UploadANewDocumentAsync(
global::System.Guid libraryId,
+ global::Mistral.LibrariesDocumentsUploadV1Request request,
+ global::Mistral.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await UploadANewDocumentAsResponseAsync(
+ libraryId: libraryId,
+
+ request: request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Upload a new document.
+ /// Given a library, upload a new document to that library. It is queued for processing, it status will change it has been processed. The processing has to be completed in order be discoverable for the library search
+ ///
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> UploadANewDocumentAsResponseAsync(
+ global::System.Guid libraryId,
+
global::Mistral.LibrariesDocumentsUploadV1Request request,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
@@ -86,10 +112,11 @@ partial void ProcessUploadANewDocumentResponseContent(
var __maxAttempts = global::Mistral.AutoSDKRequestOptionsSupport.GetMaxAttempts(
clientOptions: Options,
requestOptions: requestOptions,
- supportsRetry: true);
+ supportsRetry: false);
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Mistral.PathBuilder(
path: $"/v1/libraries/{libraryId}/documents",
baseUri: HttpClient.BaseAddress);
@@ -122,10 +149,12 @@ partial void ProcessUploadANewDocumentResponseContent(
__httpRequest.Headers.Add(__authorization.Name, __authorization.Value);
}
}
+
var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent();
__httpRequestContent.Add(
content: new global::System.Net.Http.StringContent(libraryId.ToString() ?? string.Empty),
name: "\"library_id\"");
+
var __contentFile = new global::System.Net.Http.ByteArrayContent(request.File ?? global::System.Array.Empty());
__contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue(
request.Filename is null
@@ -163,7 +192,9 @@ request.Filename is null
{
__contentFile.Headers.ContentDisposition.FileNameStar = null;
}
+
__httpRequest.Content = __httpRequestContent;
+
global::Mistral.AutoSDKRequestOptionsSupport.ApplyHeaders(
request: __httpRequest,
clientHeaders: Options.Headers,
@@ -206,6 +237,8 @@ request.Filename is null
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -216,6 +249,11 @@ request.Filename is null
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -233,6 +271,8 @@ request.Filename is null
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -242,8 +282,7 @@ request.Filename is null
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -252,6 +291,11 @@ request.Filename is null
__attempt < __maxAttempts &&
global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -268,14 +312,15 @@ request.Filename is null
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -315,6 +360,8 @@ request.Filename is null
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -335,6 +382,8 @@ request.Filename is null
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Validation Error
@@ -397,9 +446,13 @@ request.Filename is null
{
__response.EnsureSuccessStatusCode();
- return
- global::Mistral.DocumentOut.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Mistral.DocumentOut.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -427,9 +480,13 @@ request.Filename is null
#endif
).ConfigureAwait(false);
- return
- await global::Mistral.DocumentOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Mistral.DocumentOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -516,5 +573,960 @@ request.Filename is null
requestOptions: requestOptions,
cancellationToken: cancellationToken).ConfigureAwait(false);
}
+
+ ///
+ /// Upload a new document.
+ /// Given a library, upload a new document to that library. It is queued for processing, it status will change it has been processed. The processing has to be completed in order be discoverable for the library search
+ ///
+ ///
+ ///
+ /// The File object (not file name) to be uploaded.
+ /// To upload a file and specify a custom file name you should format your request as such:
+ /// ```bash
+ /// file=@path/to/your/file.jsonl;filename=custom_name.jsonl
+ /// ```
+ /// Otherwise, you can just keep the original file name:
+ /// ```bash
+ /// file=@path/to/your/file.jsonl
+ /// ```
+ ///
+ ///
+ /// The File object (not file name) to be uploaded.
+ /// To upload a file and specify a custom file name you should format your request as such:
+ /// ```bash
+ /// file=@path/to/your/file.jsonl;filename=custom_name.jsonl
+ /// ```
+ /// Otherwise, you can just keep the original file name:
+ /// ```bash
+ /// file=@path/to/your/file.jsonl
+ /// ```
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task UploadANewDocumentAsync(
+ global::System.Guid libraryId,
+ global::System.IO.Stream file,
+ string filename,
+ global::Mistral.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+
+ file = file ?? throw new global::System.ArgumentNullException(nameof(file));
+ var request = new global::Mistral.LibrariesDocumentsUploadV1Request
+ {
+ File = global::System.Array.Empty(),
+ Filename = filename,
+ };
+ PrepareArguments(
+ client: HttpClient);
+ PrepareUploadANewDocumentArguments(
+ httpClient: HttpClient,
+ libraryId: ref libraryId,
+ request: request);
+
+
+ var __authorizations = global::Mistral.EndPointSecurityResolver.ResolveAuthorizations(
+ availableAuthorizations: Authorizations,
+ securityRequirements: s_UploadANewDocumentSecurityRequirements,
+ operationName: "UploadANewDocumentAsync");
+
+ using var __timeoutCancellationTokenSource = global::Mistral.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken);
+ var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
+ var __effectiveReadResponseAsString = global::Mistral.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ fallbackValue: ReadResponseAsString);
+ var __maxAttempts = global::Mistral.AutoSDKRequestOptionsSupport.GetMaxAttempts(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ supportsRetry: false);
+
+ global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
+ {
+
+ var __pathBuilder = new global::Mistral.PathBuilder(
+ path: $"/v1/libraries/{libraryId}/documents",
+ baseUri: HttpClient.BaseAddress);
+ var __path = __pathBuilder.ToString();
+ __path = global::Mistral.AutoSDKRequestOptionsSupport.AppendQueryParameters(
+ path: __path,
+ clientParameters: Options.QueryParameters,
+ requestParameters: requestOptions?.QueryParameters);
+ var __httpRequest = new global::System.Net.Http.HttpRequestMessage(
+ method: global::System.Net.Http.HttpMethod.Post,
+ requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute));
+#if NET6_0_OR_GREATER
+ __httpRequest.Version = global::System.Net.HttpVersion.Version11;
+ __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher;
+#endif
+
+ foreach (var __authorization in __authorizations)
+ {
+ if (__authorization.Type == "Http" ||
+ __authorization.Type == "OAuth2" ||
+ __authorization.Type == "OpenIdConnect")
+ {
+ __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue(
+ scheme: __authorization.Name,
+ parameter: __authorization.Value);
+ }
+ else if (__authorization.Type == "ApiKey" &&
+ __authorization.Location == "Header")
+ {
+ __httpRequest.Headers.Add(__authorization.Name, __authorization.Value);
+ }
+ }
+
+ var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent();
+ __httpRequestContent.Add(
+ content: new global::System.Net.Http.StringContent(libraryId.ToString() ?? string.Empty),
+ name: "\"library_id\"");
+
+ var __contentFile = new global::System.Net.Http.StreamContent(file);
+ __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue(
+ request.Filename is null
+ ? "application/octet-stream"
+ : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch
+ {
+ ".aac" => "audio/aac",
+ ".flac" => "audio/flac",
+ ".gif" => "image/gif",
+ ".jpeg" => "image/jpeg",
+ ".jpg" => "image/jpeg",
+ ".json" => "application/json",
+ ".m4a" => "audio/mp4",
+ ".mp3" => "audio/mpeg",
+ ".mp4" => "video/mp4",
+ ".mpeg" => "audio/mpeg",
+ ".mpga" => "audio/mpeg",
+ ".oga" => "audio/ogg",
+ ".ogg" => "audio/ogg",
+ ".opus" => "audio/ogg",
+ ".pdf" => "application/pdf",
+ ".png" => "image/png",
+ ".txt" => "text/plain",
+ ".wav" => "audio/wav",
+ ".weba" => "audio/webm",
+ ".webm" => "video/webm",
+ ".webp" => "image/webp",
+ _ => "application/octet-stream",
+ });
+ __httpRequestContent.Add(
+ content: __contentFile,
+ name: "\"file\"",
+ fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty);
+ if (__contentFile.Headers.ContentDisposition != null)
+ {
+ __contentFile.Headers.ContentDisposition.FileNameStar = null;
+ }
+
+ __httpRequest.Content = __httpRequestContent;
+
+ global::Mistral.AutoSDKRequestOptionsSupport.ApplyHeaders(
+ request: __httpRequest,
+ clientHeaders: Options.Headers,
+ requestHeaders: requestOptions?.Headers);
+
+ PrepareRequest(
+ client: HttpClient,
+ request: __httpRequest);
+ PrepareUploadANewDocumentRequest(
+ httpClient: HttpClient,
+ httpRequestMessage: __httpRequest,
+ libraryId: libraryId!,
+ request: request);
+
+ return __httpRequest;
+ }
+
+ global::System.Net.Http.HttpRequestMessage? __httpRequest = null;
+ global::System.Net.Http.HttpResponseMessage? __response = null;
+ var __attemptNumber = 0;
+ try
+ {
+ for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++)
+ {
+ __attemptNumber = __attempt;
+ __httpRequest = __CreateHttpRequest();
+ await global::Mistral.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
+ clientOptions: Options,
+ context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "UploadANewDocument",
+ methodName: "UploadANewDocumentAsync",
+ pathTemplate: "$\"/v1/libraries/{libraryId}/documents\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ try
+ {
+ __response = await HttpClient.SendAsync(
+ request: __httpRequest,
+ completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ }
+ catch (global::System.Net.Http.HttpRequestException __exception)
+ {
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
+ var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
+ await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "UploadANewDocument",
+ methodName: "UploadANewDocumentAsync",
+ pathTemplate: "$\"/v1/libraries/{libraryId}/documents\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: __exception,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ if (!__willRetry)
+ {
+ throw;
+ }
+
+ __httpRequest.Dispose();
+ __httpRequest = null;
+ await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ if (__response != null &&
+ __attempt < __maxAttempts &&
+ global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
+ {
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
+ await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "UploadANewDocument",
+ methodName: "UploadANewDocumentAsync",
+ pathTemplate: "$\"/v1/libraries/{libraryId}/documents\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ __response.Dispose();
+ __response = null;
+ __httpRequest.Dispose();
+ __httpRequest = null;
+ await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ break;
+ }
+
+ if (__response == null)
+ {
+ throw new global::System.InvalidOperationException("No response received.");
+ }
+
+ using (__response)
+ {
+
+ ProcessResponse(
+ client: HttpClient,
+ response: __response);
+ ProcessUploadANewDocumentResponse(
+ httpClient: HttpClient,
+ httpResponseMessage: __response);
+ if (__response.IsSuccessStatusCode)
+ {
+ await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
+ clientOptions: Options,
+ context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "UploadANewDocument",
+ methodName: "UploadANewDocumentAsync",
+ pathTemplate: "$\"/v1/libraries/{libraryId}/documents\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ else
+ {
+ await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "UploadANewDocument",
+ methodName: "UploadANewDocumentAsync",
+ pathTemplate: "$\"/v1/libraries/{libraryId}/documents\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ // Validation Error
+ if ((int)__response.StatusCode == 422)
+ {
+ string? __content_422 = null;
+ global::System.Exception? __exception_422 = null;
+ global::Mistral.HTTPValidationError? __value_422 = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_422 = global::Mistral.HTTPValidationError.FromJson(__content_422, JsonSerializerContext);
+ }
+ else
+ {
+ __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_422 = global::Mistral.HTTPValidationError.FromJson(__content_422, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_422 = __ex;
+ }
+
+ throw new global::Mistral.ApiException(
+ message: __content_422 ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_422,
+ statusCode: __response.StatusCode)
+ {
+ ResponseBody = __content_422,
+ ResponseObject = __value_422,
+ ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value),
+ };
+ }
+
+ if (__effectiveReadResponseAsString)
+ {
+ var __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ ProcessResponseContent(
+ client: HttpClient,
+ response: __response,
+ content: ref __content);
+ ProcessUploadANewDocumentResponseContent(
+ httpClient: HttpClient,
+ httpResponseMessage: __response,
+ content: ref __content);
+
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+
+ return
+ global::Mistral.DocumentOut.FromJson(__content, JsonSerializerContext) ??
+ throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ }
+ catch (global::System.Exception __ex)
+ {
+ throw new global::Mistral.ApiException(
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ statusCode: __response.StatusCode)
+ {
+ ResponseBody = __content,
+ ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value),
+ };
+ }
+ }
+ else
+ {
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+ using var __content = await __response.Content.ReadAsStreamAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ return
+ await global::Mistral.DocumentOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ throw new global::System.InvalidOperationException("Response deserialization failed.");
+ }
+ catch (global::System.Exception __ex)
+ {
+ string? __content = null;
+ try
+ {
+ __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+ }
+ catch (global::System.Exception)
+ {
+ }
+
+ throw new global::Mistral.ApiException(
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ statusCode: __response.StatusCode)
+ {
+ ResponseBody = __content,
+ ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value),
+ };
+ }
+ }
+
+ }
+ }
+ finally
+ {
+ __httpRequest?.Dispose();
+ }
+ }
+ ///
+ /// Upload a new document.
+ /// Given a library, upload a new document to that library. It is queued for processing, it status will change it has been processed. The processing has to be completed in order be discoverable for the library search
+ ///
+ ///
+ ///
+ /// The File object (not file name) to be uploaded.
+ /// To upload a file and specify a custom file name you should format your request as such:
+ /// ```bash
+ /// file=@path/to/your/file.jsonl;filename=custom_name.jsonl
+ /// ```
+ /// Otherwise, you can just keep the original file name:
+ /// ```bash
+ /// file=@path/to/your/file.jsonl
+ /// ```
+ ///
+ ///
+ /// The File object (not file name) to be uploaded.
+ /// To upload a file and specify a custom file name you should format your request as such:
+ /// ```bash
+ /// file=@path/to/your/file.jsonl;filename=custom_name.jsonl
+ /// ```
+ /// Otherwise, you can just keep the original file name:
+ /// ```bash
+ /// file=@path/to/your/file.jsonl
+ /// ```
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> UploadANewDocumentAsResponseAsync(
+ global::System.Guid libraryId,
+ global::System.IO.Stream file,
+ string filename,
+ global::Mistral.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+
+ file = file ?? throw new global::System.ArgumentNullException(nameof(file));
+ var request = new global::Mistral.LibrariesDocumentsUploadV1Request
+ {
+ File = global::System.Array.Empty(),
+ Filename = filename,
+ };
+ PrepareArguments(
+ client: HttpClient);
+ PrepareUploadANewDocumentArguments(
+ httpClient: HttpClient,
+ libraryId: ref libraryId,
+ request: request);
+
+
+ var __authorizations = global::Mistral.EndPointSecurityResolver.ResolveAuthorizations(
+ availableAuthorizations: Authorizations,
+ securityRequirements: s_UploadANewDocumentSecurityRequirements,
+ operationName: "UploadANewDocumentAsync");
+
+ using var __timeoutCancellationTokenSource = global::Mistral.AutoSDKRequestOptionsSupport.CreateTimeoutCancellationTokenSource(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken);
+ var __effectiveCancellationToken = __timeoutCancellationTokenSource?.Token ?? cancellationToken;
+ var __effectiveReadResponseAsString = global::Mistral.AutoSDKRequestOptionsSupport.GetReadResponseAsString(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ fallbackValue: ReadResponseAsString);
+ var __maxAttempts = global::Mistral.AutoSDKRequestOptionsSupport.GetMaxAttempts(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ supportsRetry: false);
+
+ global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
+ {
+
+ var __pathBuilder = new global::Mistral.PathBuilder(
+ path: $"/v1/libraries/{libraryId}/documents",
+ baseUri: HttpClient.BaseAddress);
+ var __path = __pathBuilder.ToString();
+ __path = global::Mistral.AutoSDKRequestOptionsSupport.AppendQueryParameters(
+ path: __path,
+ clientParameters: Options.QueryParameters,
+ requestParameters: requestOptions?.QueryParameters);
+ var __httpRequest = new global::System.Net.Http.HttpRequestMessage(
+ method: global::System.Net.Http.HttpMethod.Post,
+ requestUri: new global::System.Uri(__path, global::System.UriKind.RelativeOrAbsolute));
+#if NET6_0_OR_GREATER
+ __httpRequest.Version = global::System.Net.HttpVersion.Version11;
+ __httpRequest.VersionPolicy = global::System.Net.Http.HttpVersionPolicy.RequestVersionOrHigher;
+#endif
+
+ foreach (var __authorization in __authorizations)
+ {
+ if (__authorization.Type == "Http" ||
+ __authorization.Type == "OAuth2" ||
+ __authorization.Type == "OpenIdConnect")
+ {
+ __httpRequest.Headers.Authorization = new global::System.Net.Http.Headers.AuthenticationHeaderValue(
+ scheme: __authorization.Name,
+ parameter: __authorization.Value);
+ }
+ else if (__authorization.Type == "ApiKey" &&
+ __authorization.Location == "Header")
+ {
+ __httpRequest.Headers.Add(__authorization.Name, __authorization.Value);
+ }
+ }
+
+ var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent();
+ __httpRequestContent.Add(
+ content: new global::System.Net.Http.StringContent(libraryId.ToString() ?? string.Empty),
+ name: "\"library_id\"");
+
+ var __contentFile = new global::System.Net.Http.StreamContent(file);
+ __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue(
+ request.Filename is null
+ ? "application/octet-stream"
+ : (global::System.IO.Path.GetExtension(request.Filename) ?? string.Empty).ToLowerInvariant() switch
+ {
+ ".aac" => "audio/aac",
+ ".flac" => "audio/flac",
+ ".gif" => "image/gif",
+ ".jpeg" => "image/jpeg",
+ ".jpg" => "image/jpeg",
+ ".json" => "application/json",
+ ".m4a" => "audio/mp4",
+ ".mp3" => "audio/mpeg",
+ ".mp4" => "video/mp4",
+ ".mpeg" => "audio/mpeg",
+ ".mpga" => "audio/mpeg",
+ ".oga" => "audio/ogg",
+ ".ogg" => "audio/ogg",
+ ".opus" => "audio/ogg",
+ ".pdf" => "application/pdf",
+ ".png" => "image/png",
+ ".txt" => "text/plain",
+ ".wav" => "audio/wav",
+ ".weba" => "audio/webm",
+ ".webm" => "video/webm",
+ ".webp" => "image/webp",
+ _ => "application/octet-stream",
+ });
+ __httpRequestContent.Add(
+ content: __contentFile,
+ name: "\"file\"",
+ fileName: request.Filename != null ? $"\"{request.Filename}\"" : string.Empty);
+ if (__contentFile.Headers.ContentDisposition != null)
+ {
+ __contentFile.Headers.ContentDisposition.FileNameStar = null;
+ }
+
+ __httpRequest.Content = __httpRequestContent;
+
+ global::Mistral.AutoSDKRequestOptionsSupport.ApplyHeaders(
+ request: __httpRequest,
+ clientHeaders: Options.Headers,
+ requestHeaders: requestOptions?.Headers);
+
+ PrepareRequest(
+ client: HttpClient,
+ request: __httpRequest);
+ PrepareUploadANewDocumentRequest(
+ httpClient: HttpClient,
+ httpRequestMessage: __httpRequest,
+ libraryId: libraryId!,
+ request: request);
+
+ return __httpRequest;
+ }
+
+ global::System.Net.Http.HttpRequestMessage? __httpRequest = null;
+ global::System.Net.Http.HttpResponseMessage? __response = null;
+ var __attemptNumber = 0;
+ try
+ {
+ for (var __attempt = 1; __attempt <= __maxAttempts; __attempt++)
+ {
+ __attemptNumber = __attempt;
+ __httpRequest = __CreateHttpRequest();
+ await global::Mistral.AutoSDKRequestOptionsSupport.OnBeforeRequestAsync(
+ clientOptions: Options,
+ context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "UploadANewDocument",
+ methodName: "UploadANewDocumentAsync",
+ pathTemplate: "$\"/v1/libraries/{libraryId}/documents\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ try
+ {
+ __response = await HttpClient.SendAsync(
+ request: __httpRequest,
+ completionOption: global::System.Net.Http.HttpCompletionOption.ResponseContentRead,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ }
+ catch (global::System.Net.Http.HttpRequestException __exception)
+ {
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
+ var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
+ await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "UploadANewDocument",
+ methodName: "UploadANewDocumentAsync",
+ pathTemplate: "$\"/v1/libraries/{libraryId}/documents\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: null,
+ exception: __exception,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ if (!__willRetry)
+ {
+ throw;
+ }
+
+ __httpRequest.Dispose();
+ __httpRequest = null;
+ await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ if (__response != null &&
+ __attempt < __maxAttempts &&
+ global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
+ {
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
+ await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "UploadANewDocument",
+ methodName: "UploadANewDocumentAsync",
+ pathTemplate: "$\"/v1/libraries/{libraryId}/documents\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attempt,
+ maxAttempts: __maxAttempts,
+ willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ __response.Dispose();
+ __response = null;
+ __httpRequest.Dispose();
+ __httpRequest = null;
+ await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
+ retryDelay: __retryDelay,
+ cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
+ continue;
+ }
+
+ break;
+ }
+
+ if (__response == null)
+ {
+ throw new global::System.InvalidOperationException("No response received.");
+ }
+
+ using (__response)
+ {
+
+ ProcessResponse(
+ client: HttpClient,
+ response: __response);
+ ProcessUploadANewDocumentResponse(
+ httpClient: HttpClient,
+ httpResponseMessage: __response);
+ if (__response.IsSuccessStatusCode)
+ {
+ await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync(
+ clientOptions: Options,
+ context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "UploadANewDocument",
+ methodName: "UploadANewDocumentAsync",
+ pathTemplate: "$\"/v1/libraries/{libraryId}/documents\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ else
+ {
+ await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
+ clientOptions: Options,
+ context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
+ operationId: "UploadANewDocument",
+ methodName: "UploadANewDocumentAsync",
+ pathTemplate: "$\"/v1/libraries/{libraryId}/documents\"",
+ httpMethod: "POST",
+ baseUri: BaseUri,
+ request: __httpRequest!,
+ response: __response,
+ exception: null,
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ attempt: __attemptNumber,
+ maxAttempts: __maxAttempts,
+ willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
+ cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
+ }
+ // Validation Error
+ if ((int)__response.StatusCode == 422)
+ {
+ string? __content_422 = null;
+ global::System.Exception? __exception_422 = null;
+ global::Mistral.HTTPValidationError? __value_422 = null;
+ try
+ {
+ if (__effectiveReadResponseAsString)
+ {
+ __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+ __value_422 = global::Mistral.HTTPValidationError.FromJson(__content_422, JsonSerializerContext);
+ }
+ else
+ {
+ __content_422 = await __response.Content.ReadAsStringAsync(__effectiveCancellationToken).ConfigureAwait(false);
+
+ __value_422 = global::Mistral.HTTPValidationError.FromJson(__content_422, JsonSerializerContext);
+ }
+ }
+ catch (global::System.Exception __ex)
+ {
+ __exception_422 = __ex;
+ }
+
+ throw new global::Mistral.ApiException(
+ message: __content_422 ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __exception_422,
+ statusCode: __response.StatusCode)
+ {
+ ResponseBody = __content_422,
+ ResponseObject = __value_422,
+ ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value),
+ };
+ }
+
+ if (__effectiveReadResponseAsString)
+ {
+ var __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ ProcessResponseContent(
+ client: HttpClient,
+ response: __response,
+ content: ref __content);
+ ProcessUploadANewDocumentResponseContent(
+ httpClient: HttpClient,
+ httpResponseMessage: __response,
+ content: ref __content);
+
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+
+ var __value = global::Mistral.DocumentOut.FromJson(__content, JsonSerializerContext) ??
+ throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ throw new global::Mistral.ApiException(
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ statusCode: __response.StatusCode)
+ {
+ ResponseBody = __content,
+ ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value),
+ };
+ }
+ }
+ else
+ {
+ try
+ {
+ __response.EnsureSuccessStatusCode();
+ using var __content = await __response.Content.ReadAsStreamAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+
+ var __value = await global::Mistral.DocumentOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
+ }
+ catch (global::System.Exception __ex)
+ {
+ string? __content = null;
+ try
+ {
+ __content = await __response.Content.ReadAsStringAsync(
+ #if NET5_0_OR_GREATER
+ __effectiveCancellationToken
+ #endif
+ ).ConfigureAwait(false);
+ }
+ catch (global::System.Exception)
+ {
+ }
+
+ throw new global::Mistral.ApiException(
+ message: __content ?? __response.ReasonPhrase ?? string.Empty,
+ innerException: __ex,
+ statusCode: __response.StatusCode)
+ {
+ ResponseBody = __content,
+ ResponseHeaders = global::System.Linq.Enumerable.ToDictionary(
+ __response.Headers,
+ h => h.Key,
+ h => h.Value),
+ };
+ }
+ }
+
+ }
+ }
+ finally
+ {
+ __httpRequest?.Dispose();
+ }
+ }
}
}
\ No newline at end of file
diff --git a/src/libs/Mistral/Generated/Mistral.BetaLibrariesDocumentsClient.g.cs b/src/libs/Mistral/Generated/Mistral.BetaLibrariesDocumentsClient.g.cs
index ce492711..1232fe85 100644
--- a/src/libs/Mistral/Generated/Mistral.BetaLibrariesDocumentsClient.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.BetaLibrariesDocumentsClient.g.cs
@@ -73,10 +73,10 @@ public BetaLibrariesDocumentsClient(
/// Client-wide request defaults such as headers, query parameters, retries, and timeout.
/// Dispose the HttpClient when the instance is disposed. True by default.
public BetaLibrariesDocumentsClient(
- global::System.Net.Http.HttpClient? httpClient = null,
- global::System.Uri? baseUri = null,
- global::System.Collections.Generic.List? authorizations = null,
- global::Mistral.AutoSDKClientOptions? options = null,
+ global::System.Net.Http.HttpClient? httpClient,
+ global::System.Uri? baseUri,
+ global::System.Collections.Generic.List? authorizations,
+ global::Mistral.AutoSDKClientOptions? options,
bool disposeHttpClient = true)
{
diff --git a/src/libs/Mistral/Generated/Mistral.BetaObservabilityCampaignsClient.CreateAndStartANewCampaign.g.cs b/src/libs/Mistral/Generated/Mistral.BetaObservabilityCampaignsClient.CreateAndStartANewCampaign.g.cs
index 908ed5a8..245be8f2 100644
--- a/src/libs/Mistral/Generated/Mistral.BetaObservabilityCampaignsClient.CreateAndStartANewCampaign.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.BetaObservabilityCampaignsClient.CreateAndStartANewCampaign.g.cs
@@ -50,6 +50,28 @@ partial void ProcessCreateAndStartANewCampaignResponseContent(
///
public async global::System.Threading.Tasks.Task CreateAndStartANewCampaignAsync(
+ global::Mistral.PostCampaignInSchema request,
+ global::Mistral.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await CreateAndStartANewCampaignAsResponseAsync(
+
+ request: request,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Create and start a new campaign
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> CreateAndStartANewCampaignAsResponseAsync(
+
global::Mistral.PostCampaignInSchema request,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
@@ -84,6 +106,7 @@ partial void ProcessCreateAndStartANewCampaignResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Mistral.PathBuilder(
path: "/v1/observability/campaigns",
baseUri: HttpClient.BaseAddress);
@@ -163,6 +186,8 @@ partial void ProcessCreateAndStartANewCampaignResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -173,6 +198,11 @@ partial void ProcessCreateAndStartANewCampaignResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -190,6 +220,8 @@ partial void ProcessCreateAndStartANewCampaignResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -199,8 +231,7 @@ partial void ProcessCreateAndStartANewCampaignResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -209,6 +240,11 @@ partial void ProcessCreateAndStartANewCampaignResponseContent(
__attempt < __maxAttempts &&
global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -225,14 +261,15 @@ partial void ProcessCreateAndStartANewCampaignResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -272,6 +309,8 @@ partial void ProcessCreateAndStartANewCampaignResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -292,6 +331,8 @@ partial void ProcessCreateAndStartANewCampaignResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Bad Request - Invalid request parameters or data
@@ -506,9 +547,13 @@ partial void ProcessCreateAndStartANewCampaignResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Mistral.CampaignPreview.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Mistral.CampaignPreview.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -536,9 +581,13 @@ partial void ProcessCreateAndStartANewCampaignResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Mistral.CampaignPreview.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Mistral.CampaignPreview.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Mistral/Generated/Mistral.BetaObservabilityCampaignsClient.DeleteACampaign.g.cs b/src/libs/Mistral/Generated/Mistral.BetaObservabilityCampaignsClient.DeleteACampaign.g.cs
index 187d2b87..d48379a4 100644
--- a/src/libs/Mistral/Generated/Mistral.BetaObservabilityCampaignsClient.DeleteACampaign.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.BetaObservabilityCampaignsClient.DeleteACampaign.g.cs
@@ -47,6 +47,24 @@ partial void ProcessDeleteACampaignResponse(
global::System.Guid campaignId,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ await DeleteACampaignAsResponseAsync(
+ campaignId: campaignId,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+ }
+ ///
+ /// Delete a campaign
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task DeleteACampaignAsResponseAsync(
+ global::System.Guid campaignId,
+ global::Mistral.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -76,6 +94,7 @@ partial void ProcessDeleteACampaignResponse(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Mistral.PathBuilder(
path: $"/v1/observability/campaigns/{campaignId}",
baseUri: HttpClient.BaseAddress);
@@ -149,6 +168,8 @@ partial void ProcessDeleteACampaignResponse(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -159,6 +180,11 @@ partial void ProcessDeleteACampaignResponse(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -176,6 +202,8 @@ partial void ProcessDeleteACampaignResponse(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -185,8 +213,7 @@ partial void ProcessDeleteACampaignResponse(
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -195,6 +222,11 @@ partial void ProcessDeleteACampaignResponse(
__attempt < __maxAttempts &&
global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -211,14 +243,15 @@ partial void ProcessDeleteACampaignResponse(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -258,6 +291,8 @@ partial void ProcessDeleteACampaignResponse(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -278,6 +313,8 @@ partial void ProcessDeleteACampaignResponse(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Bad Request - Invalid request parameters or data
@@ -488,6 +525,10 @@ partial void ProcessDeleteACampaignResponse(
{
__response.EnsureSuccessStatusCode();
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri);
}
catch (global::System.Exception __ex)
{
@@ -509,6 +550,10 @@ partial void ProcessDeleteACampaignResponse(
try
{
__response.EnsureSuccessStatusCode();
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Mistral/Generated/Mistral.BetaObservabilityCampaignsClient.GetAllCampaigns.g.cs b/src/libs/Mistral/Generated/Mistral.BetaObservabilityCampaignsClient.GetAllCampaigns.g.cs
index 2ee55826..908ae1ba 100644
--- a/src/libs/Mistral/Generated/Mistral.BetaObservabilityCampaignsClient.GetAllCampaigns.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.BetaObservabilityCampaignsClient.GetAllCampaigns.g.cs
@@ -64,6 +64,36 @@ partial void ProcessGetAllCampaignsResponseContent(
string? q = default,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await GetAllCampaignsAsResponseAsync(
+ pageSize: pageSize,
+ page: page,
+ q: q,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Get all campaigns
+ ///
+ ///
+ /// Default Value: 50
+ ///
+ ///
+ /// Default Value: 1
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> GetAllCampaignsAsResponseAsync(
+ int? pageSize = default,
+ int? page = default,
+ string? q = default,
+ global::Mistral.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -95,13 +125,14 @@ partial void ProcessGetAllCampaignsResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Mistral.PathBuilder(
path: "/v1/observability/campaigns",
- baseUri: HttpClient.BaseAddress);
+ baseUri: HttpClient.BaseAddress);
__pathBuilder
.AddOptionalParameter("page_size", pageSize?.ToString())
.AddOptionalParameter("page", page?.ToString())
- .AddOptionalParameter("q", q)
+ .AddOptionalParameter("q", q)
;
var __path = __pathBuilder.ToString();
__path = global::Mistral.AutoSDKRequestOptionsSupport.AppendQueryParameters(
@@ -175,6 +206,8 @@ partial void ProcessGetAllCampaignsResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -185,6 +218,11 @@ partial void ProcessGetAllCampaignsResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -202,6 +240,8 @@ partial void ProcessGetAllCampaignsResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -211,8 +251,7 @@ partial void ProcessGetAllCampaignsResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -221,6 +260,11 @@ partial void ProcessGetAllCampaignsResponseContent(
__attempt < __maxAttempts &&
global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -237,14 +281,15 @@ partial void ProcessGetAllCampaignsResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -284,6 +329,8 @@ partial void ProcessGetAllCampaignsResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -304,6 +351,8 @@ partial void ProcessGetAllCampaignsResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Bad Request - Invalid request parameters or data
@@ -518,9 +567,13 @@ partial void ProcessGetAllCampaignsResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Mistral.CampaignPreviews.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Mistral.CampaignPreviews.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -548,9 +601,13 @@ partial void ProcessGetAllCampaignsResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Mistral.CampaignPreviews.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Mistral.CampaignPreviews.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Mistral/Generated/Mistral.BetaObservabilityCampaignsClient.GetCampaignById.g.cs b/src/libs/Mistral/Generated/Mistral.BetaObservabilityCampaignsClient.GetCampaignById.g.cs
index 9d24d507..aae44114 100644
--- a/src/libs/Mistral/Generated/Mistral.BetaObservabilityCampaignsClient.GetCampaignById.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.BetaObservabilityCampaignsClient.GetCampaignById.g.cs
@@ -52,6 +52,26 @@ partial void ProcessGetCampaignByIdResponseContent(
global::System.Guid campaignId,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await GetCampaignByIdAsResponseAsync(
+ campaignId: campaignId,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Get campaign by id
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> GetCampaignByIdAsResponseAsync(
+ global::System.Guid campaignId,
+ global::Mistral.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -81,6 +101,7 @@ partial void ProcessGetCampaignByIdResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Mistral.PathBuilder(
path: $"/v1/observability/campaigns/{campaignId}",
baseUri: HttpClient.BaseAddress);
@@ -154,6 +175,8 @@ partial void ProcessGetCampaignByIdResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -164,6 +187,11 @@ partial void ProcessGetCampaignByIdResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -181,6 +209,8 @@ partial void ProcessGetCampaignByIdResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -190,8 +220,7 @@ partial void ProcessGetCampaignByIdResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -200,6 +229,11 @@ partial void ProcessGetCampaignByIdResponseContent(
__attempt < __maxAttempts &&
global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -216,14 +250,15 @@ partial void ProcessGetCampaignByIdResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -263,6 +298,8 @@ partial void ProcessGetCampaignByIdResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -283,6 +320,8 @@ partial void ProcessGetCampaignByIdResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Bad Request - Invalid request parameters or data
@@ -497,9 +536,13 @@ partial void ProcessGetCampaignByIdResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Mistral.CampaignPreview.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Mistral.CampaignPreview.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
@@ -527,9 +570,13 @@ partial void ProcessGetCampaignByIdResponseContent(
#endif
).ConfigureAwait(false);
- return
- await global::Mistral.CampaignPreview.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
+ var __value = await global::Mistral.CampaignPreview.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ??
throw new global::System.InvalidOperationException("Response deserialization failed.");
+ return new global::Mistral.AutoSDKHttpResponse(
+ statusCode: __response.StatusCode,
+ headers: global::Mistral.AutoSDKHttpResponse.CreateHeaders(__response),
+ requestUri: __response.RequestMessage?.RequestUri,
+ body: __value);
}
catch (global::System.Exception __ex)
{
diff --git a/src/libs/Mistral/Generated/Mistral.BetaObservabilityCampaignsClient.GetCampaignStatusByCampaignId.g.cs b/src/libs/Mistral/Generated/Mistral.BetaObservabilityCampaignsClient.GetCampaignStatusByCampaignId.g.cs
index bfe0896a..d173aacb 100644
--- a/src/libs/Mistral/Generated/Mistral.BetaObservabilityCampaignsClient.GetCampaignStatusByCampaignId.g.cs
+++ b/src/libs/Mistral/Generated/Mistral.BetaObservabilityCampaignsClient.GetCampaignStatusByCampaignId.g.cs
@@ -52,6 +52,26 @@ partial void ProcessGetCampaignStatusByCampaignIdResponseContent(
global::System.Guid campaignId,
global::Mistral.AutoSDKRequestOptions? requestOptions = default,
global::System.Threading.CancellationToken cancellationToken = default)
+ {
+ var __response = await GetCampaignStatusByCampaignIdAsResponseAsync(
+ campaignId: campaignId,
+ requestOptions: requestOptions,
+ cancellationToken: cancellationToken
+ ).ConfigureAwait(false);
+
+ return __response.Body;
+ }
+ ///
+ /// Get campaign status by campaign id
+ ///
+ ///
+ /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering.
+ /// The token to cancel the operation with
+ ///
+ public async global::System.Threading.Tasks.Task> GetCampaignStatusByCampaignIdAsResponseAsync(
+ global::System.Guid campaignId,
+ global::Mistral.AutoSDKRequestOptions? requestOptions = default,
+ global::System.Threading.CancellationToken cancellationToken = default)
{
PrepareArguments(
client: HttpClient);
@@ -81,6 +101,7 @@ partial void ProcessGetCampaignStatusByCampaignIdResponseContent(
global::System.Net.Http.HttpRequestMessage __CreateHttpRequest()
{
+
var __pathBuilder = new global::Mistral.PathBuilder(
path: $"/v1/observability/campaigns/{campaignId}/status",
baseUri: HttpClient.BaseAddress);
@@ -154,6 +175,8 @@ partial void ProcessGetCampaignStatusByCampaignIdResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
try
{
@@ -164,6 +187,11 @@ partial void ProcessGetCampaignStatusByCampaignIdResponseContent(
}
catch (global::System.Net.Http.HttpRequestException __exception)
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: null,
+ attempt: __attempt);
var __willRetry = __attempt < __maxAttempts && !__effectiveCancellationToken.IsCancellationRequested;
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
@@ -181,6 +209,8 @@ partial void ProcessGetCampaignStatusByCampaignIdResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: __willRetry,
+ retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null,
+ retryReason: "exception",
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
if (!__willRetry)
{
@@ -190,8 +220,7 @@ partial void ProcessGetCampaignStatusByCampaignIdResponseContent(
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -200,6 +229,11 @@ partial void ProcessGetCampaignStatusByCampaignIdResponseContent(
__attempt < __maxAttempts &&
global::Mistral.AutoSDKRequestOptionsSupport.ShouldRetryStatusCode(__response.StatusCode))
{
+ var __retryDelay = global::Mistral.AutoSDKRequestOptionsSupport.GetRetryDelay(
+ clientOptions: Options,
+ requestOptions: requestOptions,
+ response: __response,
+ attempt: __attempt);
await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterErrorAsync(
clientOptions: Options,
context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext(
@@ -216,14 +250,15 @@ partial void ProcessGetCampaignStatusByCampaignIdResponseContent(
attempt: __attempt,
maxAttempts: __maxAttempts,
willRetry: true,
+ retryDelay: __retryDelay,
+ retryReason: "status:" + ((int)__response.StatusCode).ToString(global::System.Globalization.CultureInfo.InvariantCulture),
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
__response.Dispose();
__response = null;
__httpRequest.Dispose();
__httpRequest = null;
await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync(
- clientOptions: Options,
- requestOptions: requestOptions,
+ retryDelay: __retryDelay,
cancellationToken: __effectiveCancellationToken).ConfigureAwait(false);
continue;
}
@@ -263,6 +298,8 @@ partial void ProcessGetCampaignStatusByCampaignIdResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
else
@@ -283,6 +320,8 @@ partial void ProcessGetCampaignStatusByCampaignIdResponseContent(
attempt: __attemptNumber,
maxAttempts: __maxAttempts,
willRetry: false,
+ retryDelay: null,
+ retryReason: global::System.String.Empty,
cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false);
}
// Bad Request - Invalid request parameters or data
@@ -497,9 +536,13 @@ partial void ProcessGetCampaignStatusByCampaignIdResponseContent(
{
__response.EnsureSuccessStatusCode();
- return
- global::Mistral.CampaignStatus.FromJson(__content, JsonSerializerContext) ??
+ var __value = global::Mistral.CampaignStatus.FromJson(__content, JsonSerializerContext) ??
throw new global::System.InvalidOperationException($"Response deserialization failed for \"{__content}\" ");
+ return new global::Mistral.AutoSDKHttpResponse