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( + 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 ProcessGetCampaignStatusByCampaignIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.CampaignStatus.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.CampaignStatus.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.GetEventIdsThatWereSelectedByTheGivenCampaign.g.cs b/src/libs/Mistral/Generated/Mistral.BetaObservabilityCampaignsClient.GetEventIdsThatWereSelectedByTheGivenCampaign.g.cs index 6b52bb91..6edafd42 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaObservabilityCampaignsClient.GetEventIdsThatWereSelectedByTheGivenCampaign.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaObservabilityCampaignsClient.GetEventIdsThatWereSelectedByTheGivenCampaign.g.cs @@ -64,6 +64,36 @@ partial void ProcessGetEventIdsThatWereSelectedByTheGivenCampaignResponseContent int? page = default, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetEventIdsThatWereSelectedByTheGivenCampaignAsResponseAsync( + campaignId: campaignId, + pageSize: pageSize, + page: page, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get event ids that were selected by the given campaign + /// + /// + /// + /// 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> GetEventIdsThatWereSelectedByTheGivenCampaignAsResponseAsync( + global::System.Guid campaignId, + int? pageSize = default, + int? page = default, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -95,12 +125,13 @@ partial void ProcessGetEventIdsThatWereSelectedByTheGivenCampaignResponseContent global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/observability/campaigns/{campaignId}/selected-events", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("page_size", pageSize?.ToString()) - .AddOptionalParameter("page", page?.ToString()) + .AddOptionalParameter("page", page?.ToString()) ; var __path = __pathBuilder.ToString(); __path = global::Mistral.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -174,6 +205,8 @@ partial void ProcessGetEventIdsThatWereSelectedByTheGivenCampaignResponseContent attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -184,6 +217,11 @@ partial void ProcessGetEventIdsThatWereSelectedByTheGivenCampaignResponseContent } 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, @@ -201,6 +239,8 @@ partial void ProcessGetEventIdsThatWereSelectedByTheGivenCampaignResponseContent attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -210,8 +250,7 @@ partial void ProcessGetEventIdsThatWereSelectedByTheGivenCampaignResponseContent __httpRequest.Dispose(); __httpRequest = null; await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -220,6 +259,11 @@ partial void ProcessGetEventIdsThatWereSelectedByTheGivenCampaignResponseContent __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( @@ -236,14 +280,15 @@ partial void ProcessGetEventIdsThatWereSelectedByTheGivenCampaignResponseContent 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; } @@ -283,6 +328,8 @@ partial void ProcessGetEventIdsThatWereSelectedByTheGivenCampaignResponseContent attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -303,6 +350,8 @@ partial void ProcessGetEventIdsThatWereSelectedByTheGivenCampaignResponseContent attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Bad Request - Invalid request parameters or data @@ -517,9 +566,13 @@ partial void ProcessGetEventIdsThatWereSelectedByTheGivenCampaignResponseContent { __response.EnsureSuccessStatusCode(); - return - global::Mistral.CampaignSelectedEvents.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.CampaignSelectedEvents.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) { @@ -547,9 +600,13 @@ partial void ProcessGetEventIdsThatWereSelectedByTheGivenCampaignResponseContent #endif ).ConfigureAwait(false); - return - await global::Mistral.CampaignSelectedEvents.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.CampaignSelectedEvents.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.g.cs b/src/libs/Mistral/Generated/Mistral.BetaObservabilityCampaignsClient.g.cs index 0193b5dc..914db498 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaObservabilityCampaignsClient.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaObservabilityCampaignsClient.g.cs @@ -73,10 +73,10 @@ public BetaObservabilityCampaignsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public BetaObservabilityCampaignsClient( - 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.BetaObservabilityChatCompletionEventsClient.AlternativeToSearchThatReturnsOnlyTheIDsAndThatCanReturnManyIDsAtOnce.g.cs b/src/libs/Mistral/Generated/Mistral.BetaObservabilityChatCompletionEventsClient.AlternativeToSearchThatReturnsOnlyTheIDsAndThatCanReturnManyIDsAtOnce.g.cs index c0fb8c19..7fc6fb1e 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaObservabilityChatCompletionEventsClient.AlternativeToSearchThatReturnsOnlyTheIDsAndThatCanReturnManyIDsAtOnce.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaObservabilityChatCompletionEventsClient.AlternativeToSearchThatReturnsOnlyTheIDsAndThatCanReturnManyIDsAtOnce.g.cs @@ -50,6 +50,28 @@ partial void ProcessAlternativeToSearchThatReturnsOnlyTheIDsAndThatCanReturnMany /// public async global::System.Threading.Tasks.Task AlternativeToSearchThatReturnsOnlyTheIDsAndThatCanReturnManyIDsAtOnceAsync( + global::Mistral.GetChatCompletionEventIdsInSchema request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AlternativeToSearchThatReturnsOnlyTheIDsAndThatCanReturnManyIDsAtOnceAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Alternative to /search that returns only the IDs and that can return many IDs at once + /// + /// + /// 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> AlternativeToSearchThatReturnsOnlyTheIDsAndThatCanReturnManyIDsAtOnceAsResponseAsync( + global::Mistral.GetChatCompletionEventIdsInSchema request, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -84,6 +106,7 @@ partial void ProcessAlternativeToSearchThatReturnsOnlyTheIDsAndThatCanReturnMany global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: "/v1/observability/chat-completion-events/search-ids", baseUri: HttpClient.BaseAddress); @@ -163,6 +186,8 @@ partial void ProcessAlternativeToSearchThatReturnsOnlyTheIDsAndThatCanReturnMany attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -173,6 +198,11 @@ partial void ProcessAlternativeToSearchThatReturnsOnlyTheIDsAndThatCanReturnMany } 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 ProcessAlternativeToSearchThatReturnsOnlyTheIDsAndThatCanReturnMany 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 ProcessAlternativeToSearchThatReturnsOnlyTheIDsAndThatCanReturnMany __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 ProcessAlternativeToSearchThatReturnsOnlyTheIDsAndThatCanReturnMany __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 ProcessAlternativeToSearchThatReturnsOnlyTheIDsAndThatCanReturnMany 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 ProcessAlternativeToSearchThatReturnsOnlyTheIDsAndThatCanReturnMany attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -292,6 +331,8 @@ partial void ProcessAlternativeToSearchThatReturnsOnlyTheIDsAndThatCanReturnMany 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 ProcessAlternativeToSearchThatReturnsOnlyTheIDsAndThatCanReturnMany { __response.EnsureSuccessStatusCode(); - return - global::Mistral.ChatCompletionEventIds.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.ChatCompletionEventIds.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 ProcessAlternativeToSearchThatReturnsOnlyTheIDsAndThatCanReturnMany #endif ).ConfigureAwait(false); - return - await global::Mistral.ChatCompletionEventIds.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.ChatCompletionEventIds.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.BetaObservabilityChatCompletionEventsClient.GetChatCompletionEvent.g.cs b/src/libs/Mistral/Generated/Mistral.BetaObservabilityChatCompletionEventsClient.GetChatCompletionEvent.g.cs index 54c5a455..ee59f41f 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaObservabilityChatCompletionEventsClient.GetChatCompletionEvent.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaObservabilityChatCompletionEventsClient.GetChatCompletionEvent.g.cs @@ -52,6 +52,26 @@ partial void ProcessGetChatCompletionEventResponseContent( global::System.Guid eventId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetChatCompletionEventAsResponseAsync( + eventId: eventId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Chat Completion Event + /// + /// + /// 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> GetChatCompletionEventAsResponseAsync( + global::System.Guid eventId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -81,6 +101,7 @@ partial void ProcessGetChatCompletionEventResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/observability/chat-completion-events/{eventId}", baseUri: HttpClient.BaseAddress); @@ -154,6 +175,8 @@ partial void ProcessGetChatCompletionEventResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -164,6 +187,11 @@ partial void ProcessGetChatCompletionEventResponseContent( } 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 ProcessGetChatCompletionEventResponseContent( 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 ProcessGetChatCompletionEventResponseContent( __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 ProcessGetChatCompletionEventResponseContent( __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 ProcessGetChatCompletionEventResponseContent( 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 ProcessGetChatCompletionEventResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -283,6 +320,8 @@ partial void ProcessGetChatCompletionEventResponseContent( 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 ProcessGetChatCompletionEventResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.ChatCompletionEvent.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.ChatCompletionEvent.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 ProcessGetChatCompletionEventResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.ChatCompletionEvent.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.ChatCompletionEvent.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.BetaObservabilityChatCompletionEventsClient.GetChatCompletionEvents.g.cs b/src/libs/Mistral/Generated/Mistral.BetaObservabilityChatCompletionEventsClient.GetChatCompletionEvents.g.cs index c6089756..7e9e4ca4 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaObservabilityChatCompletionEventsClient.GetChatCompletionEvents.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaObservabilityChatCompletionEventsClient.GetChatCompletionEvents.g.cs @@ -58,6 +58,36 @@ partial void ProcessGetChatCompletionEventsResponseContent( /// public async global::System.Threading.Tasks.Task GetChatCompletionEventsAsync( + global::Mistral.GetChatCompletionEventsInSchema request, + int? pageSize = default, + string? cursor = default, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetChatCompletionEventsAsResponseAsync( + + request: request, + pageSize: pageSize, + cursor: cursor, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Chat Completion Events + /// + /// + /// Default Value: 50 + /// + /// + /// + /// 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> GetChatCompletionEventsAsResponseAsync( + global::Mistral.GetChatCompletionEventsInSchema request, int? pageSize = default, string? cursor = default, @@ -96,12 +126,13 @@ partial void ProcessGetChatCompletionEventsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: "/v1/observability/chat-completion-events/search", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("page_size", pageSize?.ToString()) - .AddOptionalParameter("cursor", cursor) + .AddOptionalParameter("cursor", cursor) ; var __path = __pathBuilder.ToString(); __path = global::Mistral.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -181,6 +212,8 @@ partial void ProcessGetChatCompletionEventsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -191,6 +224,11 @@ partial void ProcessGetChatCompletionEventsResponseContent( } 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, @@ -208,6 +246,8 @@ partial void ProcessGetChatCompletionEventsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -217,8 +257,7 @@ partial void ProcessGetChatCompletionEventsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -227,6 +266,11 @@ partial void ProcessGetChatCompletionEventsResponseContent( __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( @@ -243,14 +287,15 @@ partial void ProcessGetChatCompletionEventsResponseContent( 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; } @@ -290,6 +335,8 @@ partial void ProcessGetChatCompletionEventsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -310,6 +357,8 @@ partial void ProcessGetChatCompletionEventsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Bad Request - Invalid request parameters or data @@ -524,9 +573,13 @@ partial void ProcessGetChatCompletionEventsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.ChatCompletionEvents.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.ChatCompletionEvents.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) { @@ -554,9 +607,13 @@ partial void ProcessGetChatCompletionEventsResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.ChatCompletionEvents.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.ChatCompletionEvents.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.BetaObservabilityChatCompletionEventsClient.GetSimilarChatCompletionEvents.g.cs b/src/libs/Mistral/Generated/Mistral.BetaObservabilityChatCompletionEventsClient.GetSimilarChatCompletionEvents.g.cs index eaf8db53..c98febb3 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaObservabilityChatCompletionEventsClient.GetSimilarChatCompletionEvents.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaObservabilityChatCompletionEventsClient.GetSimilarChatCompletionEvents.g.cs @@ -52,6 +52,26 @@ partial void ProcessGetSimilarChatCompletionEventsResponseContent( global::System.Guid eventId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetSimilarChatCompletionEventsAsResponseAsync( + eventId: eventId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Similar Chat Completion Events + /// + /// + /// 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> GetSimilarChatCompletionEventsAsResponseAsync( + global::System.Guid eventId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -81,6 +101,7 @@ partial void ProcessGetSimilarChatCompletionEventsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/observability/chat-completion-events/{eventId}/similar-events", baseUri: HttpClient.BaseAddress); @@ -154,6 +175,8 @@ partial void ProcessGetSimilarChatCompletionEventsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -164,6 +187,11 @@ partial void ProcessGetSimilarChatCompletionEventsResponseContent( } 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 ProcessGetSimilarChatCompletionEventsResponseContent( 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 ProcessGetSimilarChatCompletionEventsResponseContent( __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 ProcessGetSimilarChatCompletionEventsResponseContent( __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 ProcessGetSimilarChatCompletionEventsResponseContent( 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 ProcessGetSimilarChatCompletionEventsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -283,6 +320,8 @@ partial void ProcessGetSimilarChatCompletionEventsResponseContent( 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 ProcessGetSimilarChatCompletionEventsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.ChatCompletionEvents.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.ChatCompletionEvents.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 ProcessGetSimilarChatCompletionEventsResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.ChatCompletionEvents.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.ChatCompletionEvents.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.BetaObservabilityChatCompletionEventsClient.RunJudgeOnAnEventBasedOnTheGivenOptions.g.cs b/src/libs/Mistral/Generated/Mistral.BetaObservabilityChatCompletionEventsClient.RunJudgeOnAnEventBasedOnTheGivenOptions.g.cs index b72a5139..e5adb7ba 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaObservabilityChatCompletionEventsClient.RunJudgeOnAnEventBasedOnTheGivenOptions.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaObservabilityChatCompletionEventsClient.RunJudgeOnAnEventBasedOnTheGivenOptions.g.cs @@ -54,6 +54,31 @@ partial void ProcessRunJudgeOnAnEventBasedOnTheGivenOptionsResponseContent( public async global::System.Threading.Tasks.Task RunJudgeOnAnEventBasedOnTheGivenOptionsAsync( global::System.Guid eventId, + global::Mistral.PostChatCompletionEventJudgingInSchema request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RunJudgeOnAnEventBasedOnTheGivenOptionsAsResponseAsync( + eventId: eventId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Run Judge on an event based on the given options + /// + /// + /// + /// 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> RunJudgeOnAnEventBasedOnTheGivenOptionsAsResponseAsync( + global::System.Guid eventId, + global::Mistral.PostChatCompletionEventJudgingInSchema request, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -89,6 +114,7 @@ partial void ProcessRunJudgeOnAnEventBasedOnTheGivenOptionsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/observability/chat-completion-events/{eventId}/live-judging", baseUri: HttpClient.BaseAddress); @@ -169,6 +195,8 @@ partial void ProcessRunJudgeOnAnEventBasedOnTheGivenOptionsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -179,6 +207,11 @@ partial void ProcessRunJudgeOnAnEventBasedOnTheGivenOptionsResponseContent( } 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, @@ -196,6 +229,8 @@ partial void ProcessRunJudgeOnAnEventBasedOnTheGivenOptionsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -205,8 +240,7 @@ partial void ProcessRunJudgeOnAnEventBasedOnTheGivenOptionsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -215,6 +249,11 @@ partial void ProcessRunJudgeOnAnEventBasedOnTheGivenOptionsResponseContent( __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( @@ -231,14 +270,15 @@ partial void ProcessRunJudgeOnAnEventBasedOnTheGivenOptionsResponseContent( 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; } @@ -278,6 +318,8 @@ partial void ProcessRunJudgeOnAnEventBasedOnTheGivenOptionsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -298,6 +340,8 @@ partial void ProcessRunJudgeOnAnEventBasedOnTheGivenOptionsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Bad Request - Invalid request parameters or data @@ -512,9 +556,13 @@ partial void ProcessRunJudgeOnAnEventBasedOnTheGivenOptionsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.JudgeOutput.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.JudgeOutput.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) { @@ -542,9 +590,13 @@ partial void ProcessRunJudgeOnAnEventBasedOnTheGivenOptionsResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.JudgeOutput.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.JudgeOutput.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.BetaObservabilityChatCompletionEventsClient.g.cs b/src/libs/Mistral/Generated/Mistral.BetaObservabilityChatCompletionEventsClient.g.cs index 1a843df2..b50099c3 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaObservabilityChatCompletionEventsClient.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaObservabilityChatCompletionEventsClient.g.cs @@ -73,10 +73,10 @@ public BetaObservabilityChatCompletionEventsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public BetaObservabilityChatCompletionEventsClient( - 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.BetaObservabilityChatCompletionEventsFieldsClient.GetChatCompletionFieldOptions.g.cs b/src/libs/Mistral/Generated/Mistral.BetaObservabilityChatCompletionEventsFieldsClient.GetChatCompletionFieldOptions.g.cs index bf596ed9..0e335891 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaObservabilityChatCompletionEventsFieldsClient.GetChatCompletionFieldOptions.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaObservabilityChatCompletionEventsFieldsClient.GetChatCompletionFieldOptions.g.cs @@ -58,6 +58,31 @@ partial void ProcessGetChatCompletionFieldOptionsResponseContent( global::Mistral.GetChatCompletionFieldOptionsV1ObservabilityChatCompletionFieldsFieldNameOptionsGetOperator @operator, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetChatCompletionFieldOptionsAsResponseAsync( + fieldName: fieldName, + @operator: @operator, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Chat Completion Field Options + /// + /// + /// + /// The operator to use for filtering options + /// + /// 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> GetChatCompletionFieldOptionsAsResponseAsync( + string fieldName, + global::Mistral.GetChatCompletionFieldOptionsV1ObservabilityChatCompletionFieldsFieldNameOptionsGetOperator @operator, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -88,11 +113,12 @@ partial void ProcessGetChatCompletionFieldOptionsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/observability/chat-completion-fields/{fieldName}/options", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder - .AddRequiredParameter("operator", @operator.ToValueString()) + .AddRequiredParameter("operator", @operator.ToValueString()) ; var __path = __pathBuilder.ToString(); __path = global::Mistral.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -165,6 +191,8 @@ partial void ProcessGetChatCompletionFieldOptionsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -175,6 +203,11 @@ partial void ProcessGetChatCompletionFieldOptionsResponseContent( } 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 +225,8 @@ partial void ProcessGetChatCompletionFieldOptionsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -201,8 +236,7 @@ partial void ProcessGetChatCompletionFieldOptionsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -211,6 +245,11 @@ partial void ProcessGetChatCompletionFieldOptionsResponseContent( __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 +266,15 @@ partial void ProcessGetChatCompletionFieldOptionsResponseContent( 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 +314,8 @@ partial void ProcessGetChatCompletionFieldOptionsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -294,6 +336,8 @@ partial void ProcessGetChatCompletionFieldOptionsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Bad Request - Invalid request parameters or data @@ -508,9 +552,13 @@ partial void ProcessGetChatCompletionFieldOptionsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.ChatCompletionFieldOptions.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.ChatCompletionFieldOptions.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) { @@ -538,9 +586,13 @@ partial void ProcessGetChatCompletionFieldOptionsResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.ChatCompletionFieldOptions.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.ChatCompletionFieldOptions.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.BetaObservabilityChatCompletionEventsFieldsClient.GetChatCompletionFieldOptionsCounts.g.cs b/src/libs/Mistral/Generated/Mistral.BetaObservabilityChatCompletionEventsFieldsClient.GetChatCompletionFieldOptionsCounts.g.cs index 77dd063d..b3a3cc12 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaObservabilityChatCompletionEventsFieldsClient.GetChatCompletionFieldOptionsCounts.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaObservabilityChatCompletionEventsFieldsClient.GetChatCompletionFieldOptionsCounts.g.cs @@ -54,6 +54,31 @@ partial void ProcessGetChatCompletionFieldOptionsCountsResponseContent( public async global::System.Threading.Tasks.Task GetChatCompletionFieldOptionsCountsAsync( string fieldName, + global::Mistral.FieldOptionCountsInSchema request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetChatCompletionFieldOptionsCountsAsResponseAsync( + fieldName: fieldName, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Chat Completion Field Options Counts + /// + /// + /// + /// 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> GetChatCompletionFieldOptionsCountsAsResponseAsync( + string fieldName, + global::Mistral.FieldOptionCountsInSchema request, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -89,6 +114,7 @@ partial void ProcessGetChatCompletionFieldOptionsCountsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/observability/chat-completion-fields/{fieldName}/options-counts", baseUri: HttpClient.BaseAddress); @@ -169,6 +195,8 @@ partial void ProcessGetChatCompletionFieldOptionsCountsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -179,6 +207,11 @@ partial void ProcessGetChatCompletionFieldOptionsCountsResponseContent( } 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, @@ -196,6 +229,8 @@ partial void ProcessGetChatCompletionFieldOptionsCountsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -205,8 +240,7 @@ partial void ProcessGetChatCompletionFieldOptionsCountsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -215,6 +249,11 @@ partial void ProcessGetChatCompletionFieldOptionsCountsResponseContent( __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( @@ -231,14 +270,15 @@ partial void ProcessGetChatCompletionFieldOptionsCountsResponseContent( 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; } @@ -278,6 +318,8 @@ partial void ProcessGetChatCompletionFieldOptionsCountsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -298,6 +340,8 @@ partial void ProcessGetChatCompletionFieldOptionsCountsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Bad Request - Invalid request parameters or data @@ -512,9 +556,13 @@ partial void ProcessGetChatCompletionFieldOptionsCountsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.FieldOptionCounts.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.FieldOptionCounts.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) { @@ -542,9 +590,13 @@ partial void ProcessGetChatCompletionFieldOptionsCountsResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.FieldOptionCounts.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.FieldOptionCounts.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.BetaObservabilityChatCompletionEventsFieldsClient.GetChatCompletionFields.g.cs b/src/libs/Mistral/Generated/Mistral.BetaObservabilityChatCompletionEventsFieldsClient.GetChatCompletionFields.g.cs index 6ecf13e3..c2964be9 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaObservabilityChatCompletionEventsFieldsClient.GetChatCompletionFields.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaObservabilityChatCompletionEventsFieldsClient.GetChatCompletionFields.g.cs @@ -48,6 +48,23 @@ partial void ProcessGetChatCompletionFieldsResponseContent( public async global::System.Threading.Tasks.Task GetChatCompletionFieldsAsync( global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetChatCompletionFieldsAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Chat Completion Fields + /// + /// 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> GetChatCompletionFieldsAsResponseAsync( + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -76,6 +93,7 @@ partial void ProcessGetChatCompletionFieldsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: "/v1/observability/chat-completion-fields", baseUri: HttpClient.BaseAddress); @@ -148,6 +166,8 @@ partial void ProcessGetChatCompletionFieldsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -158,6 +178,11 @@ partial void ProcessGetChatCompletionFieldsResponseContent( } 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, @@ -175,6 +200,8 @@ partial void ProcessGetChatCompletionFieldsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -184,8 +211,7 @@ partial void ProcessGetChatCompletionFieldsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -194,6 +220,11 @@ partial void ProcessGetChatCompletionFieldsResponseContent( __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( @@ -210,14 +241,15 @@ partial void ProcessGetChatCompletionFieldsResponseContent( 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; } @@ -257,6 +289,8 @@ partial void ProcessGetChatCompletionFieldsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -277,6 +311,8 @@ partial void ProcessGetChatCompletionFieldsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Bad Request - Invalid request parameters or data @@ -491,9 +527,13 @@ partial void ProcessGetChatCompletionFieldsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.ChatCompletionFields.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.ChatCompletionFields.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) { @@ -521,9 +561,13 @@ partial void ProcessGetChatCompletionFieldsResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.ChatCompletionFields.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.ChatCompletionFields.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.BetaObservabilityChatCompletionEventsFieldsClient.g.cs b/src/libs/Mistral/Generated/Mistral.BetaObservabilityChatCompletionEventsFieldsClient.g.cs index f9b9d031..6ed7c56d 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaObservabilityChatCompletionEventsFieldsClient.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaObservabilityChatCompletionEventsFieldsClient.g.cs @@ -73,10 +73,10 @@ public BetaObservabilityChatCompletionEventsFieldsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public BetaObservabilityChatCompletionEventsFieldsClient( - 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.BetaObservabilityDatasetsClient.AddAConversationToTheDataset.g.cs b/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsClient.AddAConversationToTheDataset.g.cs index a0352ba1..3299bfff 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsClient.AddAConversationToTheDataset.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsClient.AddAConversationToTheDataset.g.cs @@ -54,6 +54,31 @@ partial void ProcessAddAConversationToTheDatasetResponseContent( public async global::System.Threading.Tasks.Task AddAConversationToTheDatasetAsync( global::System.Guid datasetId, + global::Mistral.PostDatasetRecordInSchema request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await AddAConversationToTheDatasetAsResponseAsync( + datasetId: datasetId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Add a conversation to the dataset + /// + /// + /// + /// 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> AddAConversationToTheDatasetAsResponseAsync( + global::System.Guid datasetId, + global::Mistral.PostDatasetRecordInSchema request, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -89,6 +114,7 @@ partial void ProcessAddAConversationToTheDatasetResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/observability/datasets/{datasetId}/records", baseUri: HttpClient.BaseAddress); @@ -169,6 +195,8 @@ partial void ProcessAddAConversationToTheDatasetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -179,6 +207,11 @@ partial void ProcessAddAConversationToTheDatasetResponseContent( } 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, @@ -196,6 +229,8 @@ partial void ProcessAddAConversationToTheDatasetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -205,8 +240,7 @@ partial void ProcessAddAConversationToTheDatasetResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -215,6 +249,11 @@ partial void ProcessAddAConversationToTheDatasetResponseContent( __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( @@ -231,14 +270,15 @@ partial void ProcessAddAConversationToTheDatasetResponseContent( 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; } @@ -278,6 +318,8 @@ partial void ProcessAddAConversationToTheDatasetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -298,6 +340,8 @@ partial void ProcessAddAConversationToTheDatasetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Bad Request - Invalid request parameters or data @@ -512,9 +556,13 @@ partial void ProcessAddAConversationToTheDatasetResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.DatasetRecord.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.DatasetRecord.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) { @@ -542,9 +590,13 @@ partial void ProcessAddAConversationToTheDatasetResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.DatasetRecord.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.DatasetRecord.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.BetaObservabilityDatasetsClient.CreateANewEmptyDataset.g.cs b/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsClient.CreateANewEmptyDataset.g.cs index 36339b96..b9caa127 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsClient.CreateANewEmptyDataset.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsClient.CreateANewEmptyDataset.g.cs @@ -50,6 +50,28 @@ partial void ProcessCreateANewEmptyDatasetResponseContent( /// public async global::System.Threading.Tasks.Task CreateANewEmptyDatasetAsync( + global::Mistral.PostDatasetInSchema request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateANewEmptyDatasetAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create a new empty dataset + /// + /// + /// 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> CreateANewEmptyDatasetAsResponseAsync( + global::Mistral.PostDatasetInSchema request, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -84,6 +106,7 @@ partial void ProcessCreateANewEmptyDatasetResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: "/v1/observability/datasets", baseUri: HttpClient.BaseAddress); @@ -163,6 +186,8 @@ partial void ProcessCreateANewEmptyDatasetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -173,6 +198,11 @@ partial void ProcessCreateANewEmptyDatasetResponseContent( } 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 ProcessCreateANewEmptyDatasetResponseContent( 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 ProcessCreateANewEmptyDatasetResponseContent( __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 ProcessCreateANewEmptyDatasetResponseContent( __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 ProcessCreateANewEmptyDatasetResponseContent( 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 ProcessCreateANewEmptyDatasetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -292,6 +331,8 @@ partial void ProcessCreateANewEmptyDatasetResponseContent( 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 ProcessCreateANewEmptyDatasetResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.Dataset.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.Dataset.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 ProcessCreateANewEmptyDatasetResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.Dataset.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.Dataset.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.BetaObservabilityDatasetsClient.DeleteADataset.g.cs b/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsClient.DeleteADataset.g.cs index 273ab8ad..5167f288 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsClient.DeleteADataset.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsClient.DeleteADataset.g.cs @@ -47,6 +47,24 @@ partial void ProcessDeleteADatasetResponse( global::System.Guid datasetId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await DeleteADatasetAsResponseAsync( + datasetId: datasetId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Delete a dataset + /// + /// + /// 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 DeleteADatasetAsResponseAsync( + global::System.Guid datasetId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -76,6 +94,7 @@ partial void ProcessDeleteADatasetResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/observability/datasets/{datasetId}", baseUri: HttpClient.BaseAddress); @@ -149,6 +168,8 @@ partial void ProcessDeleteADatasetResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -159,6 +180,11 @@ partial void ProcessDeleteADatasetResponse( } 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 ProcessDeleteADatasetResponse( 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 ProcessDeleteADatasetResponse( __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 ProcessDeleteADatasetResponse( __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 ProcessDeleteADatasetResponse( 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 ProcessDeleteADatasetResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -278,6 +313,8 @@ partial void ProcessDeleteADatasetResponse( 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 ProcessDeleteADatasetResponse( { __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 ProcessDeleteADatasetResponse( 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.BetaObservabilityDatasetsClient.ExportToTheFilesApiAndRetrievePresignedUrlToDownloadTheResultingJsonlFile.g.cs b/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsClient.ExportToTheFilesApiAndRetrievePresignedUrlToDownloadTheResultingJsonlFile.g.cs index 33aaf77c..930809cc 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsClient.ExportToTheFilesApiAndRetrievePresignedUrlToDownloadTheResultingJsonlFile.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsClient.ExportToTheFilesApiAndRetrievePresignedUrlToDownloadTheResultingJsonlFile.g.cs @@ -52,6 +52,26 @@ partial void ProcessExportToTheFilesApiAndRetrievePresignedUrlToDownloadTheResul global::System.Guid datasetId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ExportToTheFilesApiAndRetrievePresignedUrlToDownloadTheResultingJsonlFileAsResponseAsync( + datasetId: datasetId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Export to the Files API and retrieve presigned URL to download the resulting JSONL file + /// + /// + /// 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> ExportToTheFilesApiAndRetrievePresignedUrlToDownloadTheResultingJsonlFileAsResponseAsync( + global::System.Guid datasetId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -81,6 +101,7 @@ partial void ProcessExportToTheFilesApiAndRetrievePresignedUrlToDownloadTheResul global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/observability/datasets/{datasetId}/exports/to-jsonl", baseUri: HttpClient.BaseAddress); @@ -154,6 +175,8 @@ partial void ProcessExportToTheFilesApiAndRetrievePresignedUrlToDownloadTheResul attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -164,6 +187,11 @@ partial void ProcessExportToTheFilesApiAndRetrievePresignedUrlToDownloadTheResul } 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 ProcessExportToTheFilesApiAndRetrievePresignedUrlToDownloadTheResul 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 ProcessExportToTheFilesApiAndRetrievePresignedUrlToDownloadTheResul __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 ProcessExportToTheFilesApiAndRetrievePresignedUrlToDownloadTheResul __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 ProcessExportToTheFilesApiAndRetrievePresignedUrlToDownloadTheResul 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 ProcessExportToTheFilesApiAndRetrievePresignedUrlToDownloadTheResul attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -283,6 +320,8 @@ partial void ProcessExportToTheFilesApiAndRetrievePresignedUrlToDownloadTheResul 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 ProcessExportToTheFilesApiAndRetrievePresignedUrlToDownloadTheResul { __response.EnsureSuccessStatusCode(); - return - global::Mistral.DatasetExport.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.DatasetExport.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 ProcessExportToTheFilesApiAndRetrievePresignedUrlToDownloadTheResul #endif ).ConfigureAwait(false); - return - await global::Mistral.DatasetExport.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.DatasetExport.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.BetaObservabilityDatasetsClient.GetDatasetById.g.cs b/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsClient.GetDatasetById.g.cs index 58d33c37..767c371d 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsClient.GetDatasetById.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsClient.GetDatasetById.g.cs @@ -52,6 +52,26 @@ partial void ProcessGetDatasetByIdResponseContent( global::System.Guid datasetId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetDatasetByIdAsResponseAsync( + datasetId: datasetId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get dataset 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> GetDatasetByIdAsResponseAsync( + global::System.Guid datasetId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -81,6 +101,7 @@ partial void ProcessGetDatasetByIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/observability/datasets/{datasetId}", baseUri: HttpClient.BaseAddress); @@ -154,6 +175,8 @@ partial void ProcessGetDatasetByIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -164,6 +187,11 @@ partial void ProcessGetDatasetByIdResponseContent( } 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 ProcessGetDatasetByIdResponseContent( 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 ProcessGetDatasetByIdResponseContent( __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 ProcessGetDatasetByIdResponseContent( __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 ProcessGetDatasetByIdResponseContent( 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 ProcessGetDatasetByIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -283,6 +320,8 @@ partial void ProcessGetDatasetByIdResponseContent( 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 ProcessGetDatasetByIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.DatasetPreview.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.DatasetPreview.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 ProcessGetDatasetByIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.DatasetPreview.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.DatasetPreview.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.BetaObservabilityDatasetsClient.GetStatusOfADatasetImportTask.g.cs b/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsClient.GetStatusOfADatasetImportTask.g.cs index 8afc2515..5c8dd718 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsClient.GetStatusOfADatasetImportTask.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsClient.GetStatusOfADatasetImportTask.g.cs @@ -56,6 +56,29 @@ partial void ProcessGetStatusOfADatasetImportTaskResponseContent( global::System.Guid taskId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetStatusOfADatasetImportTaskAsResponseAsync( + datasetId: datasetId, + taskId: taskId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get status of a dataset import task + /// + /// + /// + /// 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> GetStatusOfADatasetImportTaskAsResponseAsync( + global::System.Guid datasetId, + global::System.Guid taskId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -86,6 +109,7 @@ partial void ProcessGetStatusOfADatasetImportTaskResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/observability/datasets/{datasetId}/tasks/{taskId}", baseUri: HttpClient.BaseAddress); @@ -160,6 +184,8 @@ partial void ProcessGetStatusOfADatasetImportTaskResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -170,6 +196,11 @@ partial void ProcessGetStatusOfADatasetImportTaskResponseContent( } 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, @@ -187,6 +218,8 @@ partial void ProcessGetStatusOfADatasetImportTaskResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -196,8 +229,7 @@ partial void ProcessGetStatusOfADatasetImportTaskResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -206,6 +238,11 @@ partial void ProcessGetStatusOfADatasetImportTaskResponseContent( __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( @@ -222,14 +259,15 @@ partial void ProcessGetStatusOfADatasetImportTaskResponseContent( 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; } @@ -269,6 +307,8 @@ partial void ProcessGetStatusOfADatasetImportTaskResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -289,6 +329,8 @@ partial void ProcessGetStatusOfADatasetImportTaskResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Bad Request - Invalid request parameters or data @@ -503,9 +545,13 @@ partial void ProcessGetStatusOfADatasetImportTaskResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.DatasetImportTask.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.DatasetImportTask.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) { @@ -533,9 +579,13 @@ partial void ProcessGetStatusOfADatasetImportTaskResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.DatasetImportTask.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.DatasetImportTask.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.BetaObservabilityDatasetsClient.ListExistingDatasets.g.cs b/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsClient.ListExistingDatasets.g.cs index 04e128a3..4c242aa4 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsClient.ListExistingDatasets.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsClient.ListExistingDatasets.g.cs @@ -64,6 +64,36 @@ partial void ProcessListExistingDatasetsResponseContent( string? q = default, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListExistingDatasetsAsResponseAsync( + pageSize: pageSize, + page: page, + q: q, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List existing datasets + /// + /// + /// 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> ListExistingDatasetsAsResponseAsync( + 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 ProcessListExistingDatasetsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: "/v1/observability/datasets", - 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 ProcessListExistingDatasetsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -185,6 +218,11 @@ partial void ProcessListExistingDatasetsResponseContent( } 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 ProcessListExistingDatasetsResponseContent( 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 ProcessListExistingDatasetsResponseContent( __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 ProcessListExistingDatasetsResponseContent( __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 ProcessListExistingDatasetsResponseContent( 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 ProcessListExistingDatasetsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -304,6 +351,8 @@ partial void ProcessListExistingDatasetsResponseContent( 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 ProcessListExistingDatasetsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.DatasetPreviews.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.DatasetPreviews.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 ProcessListExistingDatasetsResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.DatasetPreviews.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.DatasetPreviews.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.BetaObservabilityDatasetsClient.ListExistingRecordsInTheDataset.g.cs b/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsClient.ListExistingRecordsInTheDataset.g.cs index b9187c92..57582e64 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsClient.ListExistingRecordsInTheDataset.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsClient.ListExistingRecordsInTheDataset.g.cs @@ -64,6 +64,36 @@ partial void ProcessListExistingRecordsInTheDatasetResponseContent( int? page = default, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListExistingRecordsInTheDatasetAsResponseAsync( + datasetId: datasetId, + pageSize: pageSize, + page: page, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List existing records in the dataset + /// + /// + /// + /// 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> ListExistingRecordsInTheDatasetAsResponseAsync( + global::System.Guid datasetId, + int? pageSize = default, + int? page = default, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -95,12 +125,13 @@ partial void ProcessListExistingRecordsInTheDatasetResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/observability/datasets/{datasetId}/records", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("page_size", pageSize?.ToString()) - .AddOptionalParameter("page", page?.ToString()) + .AddOptionalParameter("page", page?.ToString()) ; var __path = __pathBuilder.ToString(); __path = global::Mistral.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -174,6 +205,8 @@ partial void ProcessListExistingRecordsInTheDatasetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -184,6 +217,11 @@ partial void ProcessListExistingRecordsInTheDatasetResponseContent( } 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, @@ -201,6 +239,8 @@ partial void ProcessListExistingRecordsInTheDatasetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -210,8 +250,7 @@ partial void ProcessListExistingRecordsInTheDatasetResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -220,6 +259,11 @@ partial void ProcessListExistingRecordsInTheDatasetResponseContent( __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( @@ -236,14 +280,15 @@ partial void ProcessListExistingRecordsInTheDatasetResponseContent( 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; } @@ -283,6 +328,8 @@ partial void ProcessListExistingRecordsInTheDatasetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -303,6 +350,8 @@ partial void ProcessListExistingRecordsInTheDatasetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Bad Request - Invalid request parameters or data @@ -517,9 +566,13 @@ partial void ProcessListExistingRecordsInTheDatasetResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.DatasetRecords.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.DatasetRecords.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) { @@ -547,9 +600,13 @@ partial void ProcessListExistingRecordsInTheDatasetResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.DatasetRecords.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.DatasetRecords.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.BetaObservabilityDatasetsClient.ListImportTasksForTheGivenDataset.g.cs b/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsClient.ListImportTasksForTheGivenDataset.g.cs index 31f998c3..596c944a 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsClient.ListImportTasksForTheGivenDataset.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsClient.ListImportTasksForTheGivenDataset.g.cs @@ -64,6 +64,36 @@ partial void ProcessListImportTasksForTheGivenDatasetResponseContent( int? page = default, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListImportTasksForTheGivenDatasetAsResponseAsync( + datasetId: datasetId, + pageSize: pageSize, + page: page, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List import tasks for the given dataset + /// + /// + /// + /// 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> ListImportTasksForTheGivenDatasetAsResponseAsync( + global::System.Guid datasetId, + int? pageSize = default, + int? page = default, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -95,12 +125,13 @@ partial void ProcessListImportTasksForTheGivenDatasetResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/observability/datasets/{datasetId}/tasks", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("page_size", pageSize?.ToString()) - .AddOptionalParameter("page", page?.ToString()) + .AddOptionalParameter("page", page?.ToString()) ; var __path = __pathBuilder.ToString(); __path = global::Mistral.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -174,6 +205,8 @@ partial void ProcessListImportTasksForTheGivenDatasetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -184,6 +217,11 @@ partial void ProcessListImportTasksForTheGivenDatasetResponseContent( } 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, @@ -201,6 +239,8 @@ partial void ProcessListImportTasksForTheGivenDatasetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -210,8 +250,7 @@ partial void ProcessListImportTasksForTheGivenDatasetResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -220,6 +259,11 @@ partial void ProcessListImportTasksForTheGivenDatasetResponseContent( __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( @@ -236,14 +280,15 @@ partial void ProcessListImportTasksForTheGivenDatasetResponseContent( 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; } @@ -283,6 +328,8 @@ partial void ProcessListImportTasksForTheGivenDatasetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -303,6 +350,8 @@ partial void ProcessListImportTasksForTheGivenDatasetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Bad Request - Invalid request parameters or data @@ -517,9 +566,13 @@ partial void ProcessListImportTasksForTheGivenDatasetResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.DatasetImportTasks.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.DatasetImportTasks.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) { @@ -547,9 +600,13 @@ partial void ProcessListImportTasksForTheGivenDatasetResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.DatasetImportTasks.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.DatasetImportTasks.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.BetaObservabilityDatasetsClient.PatchDataset.g.cs b/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsClient.PatchDataset.g.cs index 47302580..80b89600 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsClient.PatchDataset.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsClient.PatchDataset.g.cs @@ -54,6 +54,31 @@ partial void ProcessPatchDatasetResponseContent( public async global::System.Threading.Tasks.Task PatchDatasetAsync( global::System.Guid datasetId, + global::Mistral.PatchDatasetInSchema request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PatchDatasetAsResponseAsync( + datasetId: datasetId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Patch dataset + /// + /// + /// + /// 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> PatchDatasetAsResponseAsync( + global::System.Guid datasetId, + global::Mistral.PatchDatasetInSchema request, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -89,6 +114,7 @@ partial void ProcessPatchDatasetResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/observability/datasets/{datasetId}", baseUri: HttpClient.BaseAddress); @@ -169,6 +195,8 @@ partial void ProcessPatchDatasetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -179,6 +207,11 @@ partial void ProcessPatchDatasetResponseContent( } 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, @@ -196,6 +229,8 @@ partial void ProcessPatchDatasetResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -205,8 +240,7 @@ partial void ProcessPatchDatasetResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -215,6 +249,11 @@ partial void ProcessPatchDatasetResponseContent( __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( @@ -231,14 +270,15 @@ partial void ProcessPatchDatasetResponseContent( 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; } @@ -278,6 +318,8 @@ partial void ProcessPatchDatasetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -298,6 +340,8 @@ partial void ProcessPatchDatasetResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Bad Request - Invalid request parameters or data @@ -512,9 +556,13 @@ partial void ProcessPatchDatasetResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.DatasetPreview.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.DatasetPreview.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) { @@ -542,9 +590,13 @@ partial void ProcessPatchDatasetResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.DatasetPreview.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.DatasetPreview.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.BetaObservabilityDatasetsClient.PopulateTheDatasetWithACampaign.g.cs b/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsClient.PopulateTheDatasetWithACampaign.g.cs index 304d4fd8..59ed1cf5 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsClient.PopulateTheDatasetWithACampaign.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsClient.PopulateTheDatasetWithACampaign.g.cs @@ -54,6 +54,31 @@ partial void ProcessPopulateTheDatasetWithACampaignResponseContent( public async global::System.Threading.Tasks.Task PopulateTheDatasetWithACampaignAsync( global::System.Guid datasetId, + global::Mistral.PostDatasetImportFromCampaignInSchema request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PopulateTheDatasetWithACampaignAsResponseAsync( + datasetId: datasetId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Populate the dataset with 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> PopulateTheDatasetWithACampaignAsResponseAsync( + global::System.Guid datasetId, + global::Mistral.PostDatasetImportFromCampaignInSchema request, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -89,6 +114,7 @@ partial void ProcessPopulateTheDatasetWithACampaignResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/observability/datasets/{datasetId}/imports/from-campaign", baseUri: HttpClient.BaseAddress); @@ -169,6 +195,8 @@ partial void ProcessPopulateTheDatasetWithACampaignResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -179,6 +207,11 @@ partial void ProcessPopulateTheDatasetWithACampaignResponseContent( } 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, @@ -196,6 +229,8 @@ partial void ProcessPopulateTheDatasetWithACampaignResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -205,8 +240,7 @@ partial void ProcessPopulateTheDatasetWithACampaignResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -215,6 +249,11 @@ partial void ProcessPopulateTheDatasetWithACampaignResponseContent( __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( @@ -231,14 +270,15 @@ partial void ProcessPopulateTheDatasetWithACampaignResponseContent( 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; } @@ -278,6 +318,8 @@ partial void ProcessPopulateTheDatasetWithACampaignResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -298,6 +340,8 @@ partial void ProcessPopulateTheDatasetWithACampaignResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Bad Request - Invalid request parameters or data @@ -512,9 +556,13 @@ partial void ProcessPopulateTheDatasetWithACampaignResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.DatasetImportTask.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.DatasetImportTask.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) { @@ -542,9 +590,13 @@ partial void ProcessPopulateTheDatasetWithACampaignResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.DatasetImportTask.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.DatasetImportTask.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.BetaObservabilityDatasetsClient.PopulateTheDatasetWithSamplesFromAnUploadedFile.g.cs b/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsClient.PopulateTheDatasetWithSamplesFromAnUploadedFile.g.cs index f6563a51..4e21cc7b 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsClient.PopulateTheDatasetWithSamplesFromAnUploadedFile.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsClient.PopulateTheDatasetWithSamplesFromAnUploadedFile.g.cs @@ -54,6 +54,31 @@ partial void ProcessPopulateTheDatasetWithSamplesFromAnUploadedFileResponseConte public async global::System.Threading.Tasks.Task PopulateTheDatasetWithSamplesFromAnUploadedFileAsync( global::System.Guid datasetId, + global::Mistral.PostDatasetImportFromFileInSchema request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PopulateTheDatasetWithSamplesFromAnUploadedFileAsResponseAsync( + datasetId: datasetId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Populate the dataset with samples from an uploaded file + /// + /// + /// + /// 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> PopulateTheDatasetWithSamplesFromAnUploadedFileAsResponseAsync( + global::System.Guid datasetId, + global::Mistral.PostDatasetImportFromFileInSchema request, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -89,6 +114,7 @@ partial void ProcessPopulateTheDatasetWithSamplesFromAnUploadedFileResponseConte global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/observability/datasets/{datasetId}/imports/from-file", baseUri: HttpClient.BaseAddress); @@ -169,6 +195,8 @@ partial void ProcessPopulateTheDatasetWithSamplesFromAnUploadedFileResponseConte attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -179,6 +207,11 @@ partial void ProcessPopulateTheDatasetWithSamplesFromAnUploadedFileResponseConte } 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, @@ -196,6 +229,8 @@ partial void ProcessPopulateTheDatasetWithSamplesFromAnUploadedFileResponseConte attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -205,8 +240,7 @@ partial void ProcessPopulateTheDatasetWithSamplesFromAnUploadedFileResponseConte __httpRequest.Dispose(); __httpRequest = null; await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -215,6 +249,11 @@ partial void ProcessPopulateTheDatasetWithSamplesFromAnUploadedFileResponseConte __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( @@ -231,14 +270,15 @@ partial void ProcessPopulateTheDatasetWithSamplesFromAnUploadedFileResponseConte 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; } @@ -278,6 +318,8 @@ partial void ProcessPopulateTheDatasetWithSamplesFromAnUploadedFileResponseConte attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -298,6 +340,8 @@ partial void ProcessPopulateTheDatasetWithSamplesFromAnUploadedFileResponseConte attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Bad Request - Invalid request parameters or data @@ -512,9 +556,13 @@ partial void ProcessPopulateTheDatasetWithSamplesFromAnUploadedFileResponseConte { __response.EnsureSuccessStatusCode(); - return - global::Mistral.DatasetImportTask.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.DatasetImportTask.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) { @@ -542,9 +590,13 @@ partial void ProcessPopulateTheDatasetWithSamplesFromAnUploadedFileResponseConte #endif ).ConfigureAwait(false); - return - await global::Mistral.DatasetImportTask.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.DatasetImportTask.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.BetaObservabilityDatasetsClient.PopulateTheDatasetWithSamplesFromAnotherDataset.g.cs b/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsClient.PopulateTheDatasetWithSamplesFromAnotherDataset.g.cs index 508ee599..dd1bc144 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsClient.PopulateTheDatasetWithSamplesFromAnotherDataset.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsClient.PopulateTheDatasetWithSamplesFromAnotherDataset.g.cs @@ -54,6 +54,31 @@ partial void ProcessPopulateTheDatasetWithSamplesFromAnotherDatasetResponseConte public async global::System.Threading.Tasks.Task PopulateTheDatasetWithSamplesFromAnotherDatasetAsync( global::System.Guid datasetId, + global::Mistral.PostDatasetImportFromDatasetInSchema request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PopulateTheDatasetWithSamplesFromAnotherDatasetAsResponseAsync( + datasetId: datasetId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Populate the dataset with samples from another dataset + /// + /// + /// + /// 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> PopulateTheDatasetWithSamplesFromAnotherDatasetAsResponseAsync( + global::System.Guid datasetId, + global::Mistral.PostDatasetImportFromDatasetInSchema request, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -89,6 +114,7 @@ partial void ProcessPopulateTheDatasetWithSamplesFromAnotherDatasetResponseConte global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/observability/datasets/{datasetId}/imports/from-dataset", baseUri: HttpClient.BaseAddress); @@ -169,6 +195,8 @@ partial void ProcessPopulateTheDatasetWithSamplesFromAnotherDatasetResponseConte attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -179,6 +207,11 @@ partial void ProcessPopulateTheDatasetWithSamplesFromAnotherDatasetResponseConte } 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, @@ -196,6 +229,8 @@ partial void ProcessPopulateTheDatasetWithSamplesFromAnotherDatasetResponseConte attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -205,8 +240,7 @@ partial void ProcessPopulateTheDatasetWithSamplesFromAnotherDatasetResponseConte __httpRequest.Dispose(); __httpRequest = null; await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -215,6 +249,11 @@ partial void ProcessPopulateTheDatasetWithSamplesFromAnotherDatasetResponseConte __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( @@ -231,14 +270,15 @@ partial void ProcessPopulateTheDatasetWithSamplesFromAnotherDatasetResponseConte 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; } @@ -278,6 +318,8 @@ partial void ProcessPopulateTheDatasetWithSamplesFromAnotherDatasetResponseConte attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -298,6 +340,8 @@ partial void ProcessPopulateTheDatasetWithSamplesFromAnotherDatasetResponseConte attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Bad Request - Invalid request parameters or data @@ -512,9 +556,13 @@ partial void ProcessPopulateTheDatasetWithSamplesFromAnotherDatasetResponseConte { __response.EnsureSuccessStatusCode(); - return - global::Mistral.DatasetImportTask.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.DatasetImportTask.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) { @@ -542,9 +590,13 @@ partial void ProcessPopulateTheDatasetWithSamplesFromAnotherDatasetResponseConte #endif ).ConfigureAwait(false); - return - await global::Mistral.DatasetImportTask.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.DatasetImportTask.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.BetaObservabilityDatasetsClient.PopulateTheDatasetWithSamplesFromTheExplorer.g.cs b/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsClient.PopulateTheDatasetWithSamplesFromTheExplorer.g.cs index e40052a6..35ccece4 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsClient.PopulateTheDatasetWithSamplesFromTheExplorer.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsClient.PopulateTheDatasetWithSamplesFromTheExplorer.g.cs @@ -54,6 +54,31 @@ partial void ProcessPopulateTheDatasetWithSamplesFromTheExplorerResponseContent( public async global::System.Threading.Tasks.Task PopulateTheDatasetWithSamplesFromTheExplorerAsync( global::System.Guid datasetId, + global::Mistral.PostDatasetImportFromExplorerInSchema request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PopulateTheDatasetWithSamplesFromTheExplorerAsResponseAsync( + datasetId: datasetId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Populate the dataset with samples from the explorer + /// + /// + /// + /// 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> PopulateTheDatasetWithSamplesFromTheExplorerAsResponseAsync( + global::System.Guid datasetId, + global::Mistral.PostDatasetImportFromExplorerInSchema request, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -89,6 +114,7 @@ partial void ProcessPopulateTheDatasetWithSamplesFromTheExplorerResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/observability/datasets/{datasetId}/imports/from-explorer", baseUri: HttpClient.BaseAddress); @@ -169,6 +195,8 @@ partial void ProcessPopulateTheDatasetWithSamplesFromTheExplorerResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -179,6 +207,11 @@ partial void ProcessPopulateTheDatasetWithSamplesFromTheExplorerResponseContent( } 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, @@ -196,6 +229,8 @@ partial void ProcessPopulateTheDatasetWithSamplesFromTheExplorerResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -205,8 +240,7 @@ partial void ProcessPopulateTheDatasetWithSamplesFromTheExplorerResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -215,6 +249,11 @@ partial void ProcessPopulateTheDatasetWithSamplesFromTheExplorerResponseContent( __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( @@ -231,14 +270,15 @@ partial void ProcessPopulateTheDatasetWithSamplesFromTheExplorerResponseContent( 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; } @@ -278,6 +318,8 @@ partial void ProcessPopulateTheDatasetWithSamplesFromTheExplorerResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -298,6 +340,8 @@ partial void ProcessPopulateTheDatasetWithSamplesFromTheExplorerResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Bad Request - Invalid request parameters or data @@ -512,9 +556,13 @@ partial void ProcessPopulateTheDatasetWithSamplesFromTheExplorerResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.DatasetImportTask.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.DatasetImportTask.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) { @@ -542,9 +590,13 @@ partial void ProcessPopulateTheDatasetWithSamplesFromTheExplorerResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.DatasetImportTask.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.DatasetImportTask.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.BetaObservabilityDatasetsClient.PopulateTheDatasetWithSamplesFromThePlayground.g.cs b/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsClient.PopulateTheDatasetWithSamplesFromThePlayground.g.cs index 7331b1b5..fc9da18c 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsClient.PopulateTheDatasetWithSamplesFromThePlayground.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsClient.PopulateTheDatasetWithSamplesFromThePlayground.g.cs @@ -54,6 +54,31 @@ partial void ProcessPopulateTheDatasetWithSamplesFromThePlaygroundResponseConten public async global::System.Threading.Tasks.Task PopulateTheDatasetWithSamplesFromThePlaygroundAsync( global::System.Guid datasetId, + global::Mistral.PostDatasetImportFromPlaygroundInSchema request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await PopulateTheDatasetWithSamplesFromThePlaygroundAsResponseAsync( + datasetId: datasetId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Populate the dataset with samples from the playground + /// + /// + /// + /// 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> PopulateTheDatasetWithSamplesFromThePlaygroundAsResponseAsync( + global::System.Guid datasetId, + global::Mistral.PostDatasetImportFromPlaygroundInSchema request, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -89,6 +114,7 @@ partial void ProcessPopulateTheDatasetWithSamplesFromThePlaygroundResponseConten global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/observability/datasets/{datasetId}/imports/from-playground", baseUri: HttpClient.BaseAddress); @@ -169,6 +195,8 @@ partial void ProcessPopulateTheDatasetWithSamplesFromThePlaygroundResponseConten attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -179,6 +207,11 @@ partial void ProcessPopulateTheDatasetWithSamplesFromThePlaygroundResponseConten } 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, @@ -196,6 +229,8 @@ partial void ProcessPopulateTheDatasetWithSamplesFromThePlaygroundResponseConten attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -205,8 +240,7 @@ partial void ProcessPopulateTheDatasetWithSamplesFromThePlaygroundResponseConten __httpRequest.Dispose(); __httpRequest = null; await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -215,6 +249,11 @@ partial void ProcessPopulateTheDatasetWithSamplesFromThePlaygroundResponseConten __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( @@ -231,14 +270,15 @@ partial void ProcessPopulateTheDatasetWithSamplesFromThePlaygroundResponseConten 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; } @@ -278,6 +318,8 @@ partial void ProcessPopulateTheDatasetWithSamplesFromThePlaygroundResponseConten attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -298,6 +340,8 @@ partial void ProcessPopulateTheDatasetWithSamplesFromThePlaygroundResponseConten attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Bad Request - Invalid request parameters or data @@ -512,9 +556,13 @@ partial void ProcessPopulateTheDatasetWithSamplesFromThePlaygroundResponseConten { __response.EnsureSuccessStatusCode(); - return - global::Mistral.DatasetImportTask.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.DatasetImportTask.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) { @@ -542,9 +590,13 @@ partial void ProcessPopulateTheDatasetWithSamplesFromThePlaygroundResponseConten #endif ).ConfigureAwait(false); - return - await global::Mistral.DatasetImportTask.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.DatasetImportTask.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.BetaObservabilityDatasetsClient.g.cs b/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsClient.g.cs index e68fb654..3d4ba052 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsClient.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsClient.g.cs @@ -73,10 +73,10 @@ public BetaObservabilityDatasetsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public BetaObservabilityDatasetsClient( - 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.BetaObservabilityDatasetsRecordsClient.DeleteARecordFromADataset.g.cs b/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsRecordsClient.DeleteARecordFromADataset.g.cs index ee12c856..33476f11 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsRecordsClient.DeleteARecordFromADataset.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsRecordsClient.DeleteARecordFromADataset.g.cs @@ -47,6 +47,24 @@ partial void ProcessDeleteARecordFromADatasetResponse( global::System.Guid datasetRecordId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await DeleteARecordFromADatasetAsResponseAsync( + datasetRecordId: datasetRecordId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Delete a record from a dataset + /// + /// + /// 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 DeleteARecordFromADatasetAsResponseAsync( + global::System.Guid datasetRecordId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -76,6 +94,7 @@ partial void ProcessDeleteARecordFromADatasetResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/observability/dataset-records/{datasetRecordId}", baseUri: HttpClient.BaseAddress); @@ -149,6 +168,8 @@ partial void ProcessDeleteARecordFromADatasetResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -159,6 +180,11 @@ partial void ProcessDeleteARecordFromADatasetResponse( } 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 ProcessDeleteARecordFromADatasetResponse( 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 ProcessDeleteARecordFromADatasetResponse( __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 ProcessDeleteARecordFromADatasetResponse( __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 ProcessDeleteARecordFromADatasetResponse( 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 ProcessDeleteARecordFromADatasetResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -278,6 +313,8 @@ partial void ProcessDeleteARecordFromADatasetResponse( 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 ProcessDeleteARecordFromADatasetResponse( { __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 ProcessDeleteARecordFromADatasetResponse( 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.BetaObservabilityDatasetsRecordsClient.DeleteMultipleRecordsFromDatasets.g.cs b/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsRecordsClient.DeleteMultipleRecordsFromDatasets.g.cs index a178b7fd..d010eb5c 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsRecordsClient.DeleteMultipleRecordsFromDatasets.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsRecordsClient.DeleteMultipleRecordsFromDatasets.g.cs @@ -45,6 +45,26 @@ partial void ProcessDeleteMultipleRecordsFromDatasetsResponse( /// public async global::System.Threading.Tasks.Task DeleteMultipleRecordsFromDatasetsAsync( + global::Mistral.DeleteDatasetRecordsInSchema request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + await DeleteMultipleRecordsFromDatasetsAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Delete multiple records from datasets + /// + /// + /// 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 DeleteMultipleRecordsFromDatasetsAsResponseAsync( + global::Mistral.DeleteDatasetRecordsInSchema request, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -79,6 +99,7 @@ partial void ProcessDeleteMultipleRecordsFromDatasetsResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: "/v1/observability/dataset-records/bulk-delete", baseUri: HttpClient.BaseAddress); @@ -158,6 +179,8 @@ partial void ProcessDeleteMultipleRecordsFromDatasetsResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -168,6 +191,11 @@ partial void ProcessDeleteMultipleRecordsFromDatasetsResponse( } 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, @@ -185,6 +213,8 @@ partial void ProcessDeleteMultipleRecordsFromDatasetsResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -194,8 +224,7 @@ partial void ProcessDeleteMultipleRecordsFromDatasetsResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -204,6 +233,11 @@ partial void ProcessDeleteMultipleRecordsFromDatasetsResponse( __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( @@ -220,14 +254,15 @@ partial void ProcessDeleteMultipleRecordsFromDatasetsResponse( 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; } @@ -267,6 +302,8 @@ partial void ProcessDeleteMultipleRecordsFromDatasetsResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -287,6 +324,8 @@ partial void ProcessDeleteMultipleRecordsFromDatasetsResponse( 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,6 +536,10 @@ partial void ProcessDeleteMultipleRecordsFromDatasetsResponse( { __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) { @@ -518,6 +561,10 @@ partial void ProcessDeleteMultipleRecordsFromDatasetsResponse( 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.BetaObservabilityDatasetsRecordsClient.GetTheContentOfAGivenConversationFromADataset.g.cs b/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsRecordsClient.GetTheContentOfAGivenConversationFromADataset.g.cs index ca0d671b..30c4d9be 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsRecordsClient.GetTheContentOfAGivenConversationFromADataset.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsRecordsClient.GetTheContentOfAGivenConversationFromADataset.g.cs @@ -52,6 +52,26 @@ partial void ProcessGetTheContentOfAGivenConversationFromADatasetResponseContent global::System.Guid datasetRecordId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetTheContentOfAGivenConversationFromADatasetAsResponseAsync( + datasetRecordId: datasetRecordId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get the content of a given conversation from a dataset + /// + /// + /// 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> GetTheContentOfAGivenConversationFromADatasetAsResponseAsync( + global::System.Guid datasetRecordId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -81,6 +101,7 @@ partial void ProcessGetTheContentOfAGivenConversationFromADatasetResponseContent global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/observability/dataset-records/{datasetRecordId}", baseUri: HttpClient.BaseAddress); @@ -154,6 +175,8 @@ partial void ProcessGetTheContentOfAGivenConversationFromADatasetResponseContent attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -164,6 +187,11 @@ partial void ProcessGetTheContentOfAGivenConversationFromADatasetResponseContent } 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 ProcessGetTheContentOfAGivenConversationFromADatasetResponseContent 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 ProcessGetTheContentOfAGivenConversationFromADatasetResponseContent __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 ProcessGetTheContentOfAGivenConversationFromADatasetResponseContent __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 ProcessGetTheContentOfAGivenConversationFromADatasetResponseContent 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 ProcessGetTheContentOfAGivenConversationFromADatasetResponseContent attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -283,6 +320,8 @@ partial void ProcessGetTheContentOfAGivenConversationFromADatasetResponseContent 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 ProcessGetTheContentOfAGivenConversationFromADatasetResponseContent { __response.EnsureSuccessStatusCode(); - return - global::Mistral.DatasetRecord.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.DatasetRecord.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 ProcessGetTheContentOfAGivenConversationFromADatasetResponseContent #endif ).ConfigureAwait(false); - return - await global::Mistral.DatasetRecord.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.DatasetRecord.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.BetaObservabilityDatasetsRecordsClient.RunJudgeOnADatasetRecordBasedOnTheGivenOptions.g.cs b/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsRecordsClient.RunJudgeOnADatasetRecordBasedOnTheGivenOptions.g.cs index d07ceb17..bbce8909 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsRecordsClient.RunJudgeOnADatasetRecordBasedOnTheGivenOptions.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsRecordsClient.RunJudgeOnADatasetRecordBasedOnTheGivenOptions.g.cs @@ -54,6 +54,31 @@ partial void ProcessRunJudgeOnADatasetRecordBasedOnTheGivenOptionsResponseConten public async global::System.Threading.Tasks.Task RunJudgeOnADatasetRecordBasedOnTheGivenOptionsAsync( global::System.Guid datasetRecordId, + global::Mistral.PostDatasetRecordJudgingInSchema request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RunJudgeOnADatasetRecordBasedOnTheGivenOptionsAsResponseAsync( + datasetRecordId: datasetRecordId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Run Judge on a dataset record based on the given options + /// + /// + /// + /// 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> RunJudgeOnADatasetRecordBasedOnTheGivenOptionsAsResponseAsync( + global::System.Guid datasetRecordId, + global::Mistral.PostDatasetRecordJudgingInSchema request, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -89,6 +114,7 @@ partial void ProcessRunJudgeOnADatasetRecordBasedOnTheGivenOptionsResponseConten global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/observability/dataset-records/{datasetRecordId}/live-judging", baseUri: HttpClient.BaseAddress); @@ -169,6 +195,8 @@ partial void ProcessRunJudgeOnADatasetRecordBasedOnTheGivenOptionsResponseConten attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -179,6 +207,11 @@ partial void ProcessRunJudgeOnADatasetRecordBasedOnTheGivenOptionsResponseConten } 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, @@ -196,6 +229,8 @@ partial void ProcessRunJudgeOnADatasetRecordBasedOnTheGivenOptionsResponseConten attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -205,8 +240,7 @@ partial void ProcessRunJudgeOnADatasetRecordBasedOnTheGivenOptionsResponseConten __httpRequest.Dispose(); __httpRequest = null; await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -215,6 +249,11 @@ partial void ProcessRunJudgeOnADatasetRecordBasedOnTheGivenOptionsResponseConten __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( @@ -231,14 +270,15 @@ partial void ProcessRunJudgeOnADatasetRecordBasedOnTheGivenOptionsResponseConten 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; } @@ -278,6 +318,8 @@ partial void ProcessRunJudgeOnADatasetRecordBasedOnTheGivenOptionsResponseConten attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -298,6 +340,8 @@ partial void ProcessRunJudgeOnADatasetRecordBasedOnTheGivenOptionsResponseConten attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Bad Request - Invalid request parameters or data @@ -512,9 +556,13 @@ partial void ProcessRunJudgeOnADatasetRecordBasedOnTheGivenOptionsResponseConten { __response.EnsureSuccessStatusCode(); - return - global::Mistral.JudgeOutput.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.JudgeOutput.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) { @@ -542,9 +590,13 @@ partial void ProcessRunJudgeOnADatasetRecordBasedOnTheGivenOptionsResponseConten #endif ).ConfigureAwait(false); - return - await global::Mistral.JudgeOutput.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.JudgeOutput.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.BetaObservabilityDatasetsRecordsClient.UpdateADatasetRecordConversationPayload.g.cs b/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsRecordsClient.UpdateADatasetRecordConversationPayload.g.cs index 65261abf..6ec8c926 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsRecordsClient.UpdateADatasetRecordConversationPayload.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsRecordsClient.UpdateADatasetRecordConversationPayload.g.cs @@ -49,6 +49,29 @@ partial void ProcessUpdateADatasetRecordConversationPayloadResponse( public async global::System.Threading.Tasks.Task UpdateADatasetRecordConversationPayloadAsync( global::System.Guid datasetRecordId, + global::Mistral.PutDatasetRecordPayloadInSchema request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + await UpdateADatasetRecordConversationPayloadAsResponseAsync( + datasetRecordId: datasetRecordId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Update a dataset record conversation payload + /// + /// + /// + /// 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 UpdateADatasetRecordConversationPayloadAsResponseAsync( + global::System.Guid datasetRecordId, + global::Mistral.PutDatasetRecordPayloadInSchema request, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -84,6 +107,7 @@ partial void ProcessUpdateADatasetRecordConversationPayloadResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/observability/dataset-records/{datasetRecordId}/payload", baseUri: HttpClient.BaseAddress); @@ -164,6 +188,8 @@ partial void ProcessUpdateADatasetRecordConversationPayloadResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -174,6 +200,11 @@ partial void ProcessUpdateADatasetRecordConversationPayloadResponse( } 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 ProcessUpdateADatasetRecordConversationPayloadResponse( 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 ProcessUpdateADatasetRecordConversationPayloadResponse( __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 ProcessUpdateADatasetRecordConversationPayloadResponse( __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 ProcessUpdateADatasetRecordConversationPayloadResponse( 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 ProcessUpdateADatasetRecordConversationPayloadResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -293,6 +333,8 @@ partial void ProcessUpdateADatasetRecordConversationPayloadResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Bad Request - Invalid request parameters or data @@ -503,6 +545,10 @@ partial void ProcessUpdateADatasetRecordConversationPayloadResponse( { __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) { @@ -524,6 +570,10 @@ partial void ProcessUpdateADatasetRecordConversationPayloadResponse( 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.BetaObservabilityDatasetsRecordsClient.UpdateConversationProperties.g.cs b/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsRecordsClient.UpdateConversationProperties.g.cs index b6a2699a..9d3f6291 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsRecordsClient.UpdateConversationProperties.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsRecordsClient.UpdateConversationProperties.g.cs @@ -49,6 +49,29 @@ partial void ProcessUpdateConversationPropertiesResponse( public async global::System.Threading.Tasks.Task UpdateConversationPropertiesAsync( global::System.Guid datasetRecordId, + global::Mistral.PutDatasetRecordPropertiesInSchema request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + await UpdateConversationPropertiesAsResponseAsync( + datasetRecordId: datasetRecordId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Update conversation properties + /// + /// + /// + /// 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 UpdateConversationPropertiesAsResponseAsync( + global::System.Guid datasetRecordId, + global::Mistral.PutDatasetRecordPropertiesInSchema request, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -84,6 +107,7 @@ partial void ProcessUpdateConversationPropertiesResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/observability/dataset-records/{datasetRecordId}/properties", baseUri: HttpClient.BaseAddress); @@ -164,6 +188,8 @@ partial void ProcessUpdateConversationPropertiesResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -174,6 +200,11 @@ partial void ProcessUpdateConversationPropertiesResponse( } 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 ProcessUpdateConversationPropertiesResponse( 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 ProcessUpdateConversationPropertiesResponse( __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 ProcessUpdateConversationPropertiesResponse( __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 ProcessUpdateConversationPropertiesResponse( 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 ProcessUpdateConversationPropertiesResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -293,6 +333,8 @@ partial void ProcessUpdateConversationPropertiesResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Bad Request - Invalid request parameters or data @@ -503,6 +545,10 @@ partial void ProcessUpdateConversationPropertiesResponse( { __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) { @@ -524,6 +570,10 @@ partial void ProcessUpdateConversationPropertiesResponse( 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.BetaObservabilityDatasetsRecordsClient.g.cs b/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsRecordsClient.g.cs index 1f151c1a..0b8a192b 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsRecordsClient.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaObservabilityDatasetsRecordsClient.g.cs @@ -73,10 +73,10 @@ public BetaObservabilityDatasetsRecordsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public BetaObservabilityDatasetsRecordsClient( - 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.BetaObservabilityJudgesClient.CreateANewJudge.g.cs b/src/libs/Mistral/Generated/Mistral.BetaObservabilityJudgesClient.CreateANewJudge.g.cs index 7be9bb85..97d1231c 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaObservabilityJudgesClient.CreateANewJudge.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaObservabilityJudgesClient.CreateANewJudge.g.cs @@ -50,6 +50,28 @@ partial void ProcessCreateANewJudgeResponseContent( /// public async global::System.Threading.Tasks.Task CreateANewJudgeAsync( + global::Mistral.PostJudgeInSchema request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateANewJudgeAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create a new judge + /// + /// + /// 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> CreateANewJudgeAsResponseAsync( + global::Mistral.PostJudgeInSchema request, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -84,6 +106,7 @@ partial void ProcessCreateANewJudgeResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: "/v1/observability/judges", baseUri: HttpClient.BaseAddress); @@ -163,6 +186,8 @@ partial void ProcessCreateANewJudgeResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -173,6 +198,11 @@ partial void ProcessCreateANewJudgeResponseContent( } 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 ProcessCreateANewJudgeResponseContent( 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 ProcessCreateANewJudgeResponseContent( __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 ProcessCreateANewJudgeResponseContent( __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 ProcessCreateANewJudgeResponseContent( 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 ProcessCreateANewJudgeResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -292,6 +331,8 @@ partial void ProcessCreateANewJudgeResponseContent( 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 ProcessCreateANewJudgeResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.JudgePreview.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.JudgePreview.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 ProcessCreateANewJudgeResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.JudgePreview.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.JudgePreview.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.BetaObservabilityJudgesClient.DeleteAJudge.g.cs b/src/libs/Mistral/Generated/Mistral.BetaObservabilityJudgesClient.DeleteAJudge.g.cs index f33c8f7a..bd0898af 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaObservabilityJudgesClient.DeleteAJudge.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaObservabilityJudgesClient.DeleteAJudge.g.cs @@ -47,6 +47,24 @@ partial void ProcessDeleteAJudgeResponse( global::System.Guid judgeId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await DeleteAJudgeAsResponseAsync( + judgeId: judgeId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Delete a judge + /// + /// + /// 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 DeleteAJudgeAsResponseAsync( + global::System.Guid judgeId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -76,6 +94,7 @@ partial void ProcessDeleteAJudgeResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/observability/judges/{judgeId}", baseUri: HttpClient.BaseAddress); @@ -149,6 +168,8 @@ partial void ProcessDeleteAJudgeResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -159,6 +180,11 @@ partial void ProcessDeleteAJudgeResponse( } 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 ProcessDeleteAJudgeResponse( 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 ProcessDeleteAJudgeResponse( __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 ProcessDeleteAJudgeResponse( __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 ProcessDeleteAJudgeResponse( 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 ProcessDeleteAJudgeResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -278,6 +313,8 @@ partial void ProcessDeleteAJudgeResponse( 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 ProcessDeleteAJudgeResponse( { __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 ProcessDeleteAJudgeResponse( 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.BetaObservabilityJudgesClient.GetJudgeById.g.cs b/src/libs/Mistral/Generated/Mistral.BetaObservabilityJudgesClient.GetJudgeById.g.cs index 6c004fe6..e5b2ef41 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaObservabilityJudgesClient.GetJudgeById.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaObservabilityJudgesClient.GetJudgeById.g.cs @@ -52,6 +52,26 @@ partial void ProcessGetJudgeByIdResponseContent( global::System.Guid judgeId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetJudgeByIdAsResponseAsync( + judgeId: judgeId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get judge 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> GetJudgeByIdAsResponseAsync( + global::System.Guid judgeId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -81,6 +101,7 @@ partial void ProcessGetJudgeByIdResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/observability/judges/{judgeId}", baseUri: HttpClient.BaseAddress); @@ -154,6 +175,8 @@ partial void ProcessGetJudgeByIdResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -164,6 +187,11 @@ partial void ProcessGetJudgeByIdResponseContent( } 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 ProcessGetJudgeByIdResponseContent( 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 ProcessGetJudgeByIdResponseContent( __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 ProcessGetJudgeByIdResponseContent( __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 ProcessGetJudgeByIdResponseContent( 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 ProcessGetJudgeByIdResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -283,6 +320,8 @@ partial void ProcessGetJudgeByIdResponseContent( 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 ProcessGetJudgeByIdResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.JudgePreview.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.JudgePreview.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 ProcessGetJudgeByIdResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.JudgePreview.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.JudgePreview.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.BetaObservabilityJudgesClient.GetJudgesWithOptionalFilteringAndSearch.g.cs b/src/libs/Mistral/Generated/Mistral.BetaObservabilityJudgesClient.GetJudgesWithOptionalFilteringAndSearch.g.cs index d2d208c5..59d59fa2 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaObservabilityJudgesClient.GetJudgesWithOptionalFilteringAndSearch.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaObservabilityJudgesClient.GetJudgesWithOptionalFilteringAndSearch.g.cs @@ -76,6 +76,46 @@ partial void ProcessGetJudgesWithOptionalFilteringAndSearchResponseContent( string? q = default, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetJudgesWithOptionalFilteringAndSearchAsResponseAsync( + typeFilter: typeFilter, + modelFilter: modelFilter, + pageSize: pageSize, + page: page, + q: q, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get judges with optional filtering and search + /// + /// + /// Filter by judge output types + /// + /// + /// Filter by model names + /// + /// + /// 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> GetJudgesWithOptionalFilteringAndSearchAsResponseAsync( + global::System.Collections.Generic.IList? typeFilter = default, + global::System.Collections.Generic.IList? modelFilter = default, + int? pageSize = default, + int? page = default, + string? q = default, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -109,15 +149,16 @@ partial void ProcessGetJudgesWithOptionalFilteringAndSearchResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: "/v1/observability/judges", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("type_filter", typeFilter?.ToString()) .AddOptionalParameter("model_filter", modelFilter?.ToString()) .AddOptionalParameter("page_size", pageSize?.ToString()) .AddOptionalParameter("page", page?.ToString()) - .AddOptionalParameter("q", q) + .AddOptionalParameter("q", q) ; var __path = __pathBuilder.ToString(); __path = global::Mistral.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -193,6 +234,8 @@ partial void ProcessGetJudgesWithOptionalFilteringAndSearchResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -203,6 +246,11 @@ partial void ProcessGetJudgesWithOptionalFilteringAndSearchResponseContent( } 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, @@ -220,6 +268,8 @@ partial void ProcessGetJudgesWithOptionalFilteringAndSearchResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -229,8 +279,7 @@ partial void ProcessGetJudgesWithOptionalFilteringAndSearchResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -239,6 +288,11 @@ partial void ProcessGetJudgesWithOptionalFilteringAndSearchResponseContent( __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( @@ -255,14 +309,15 @@ partial void ProcessGetJudgesWithOptionalFilteringAndSearchResponseContent( 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; } @@ -302,6 +357,8 @@ partial void ProcessGetJudgesWithOptionalFilteringAndSearchResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -322,6 +379,8 @@ partial void ProcessGetJudgesWithOptionalFilteringAndSearchResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Bad Request - Invalid request parameters or data @@ -536,9 +595,13 @@ partial void ProcessGetJudgesWithOptionalFilteringAndSearchResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.JudgePreviews.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.JudgePreviews.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) { @@ -566,9 +629,13 @@ partial void ProcessGetJudgesWithOptionalFilteringAndSearchResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.JudgePreviews.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.JudgePreviews.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.BetaObservabilityJudgesClient.RunASavedJudgeOnAConversation.g.cs b/src/libs/Mistral/Generated/Mistral.BetaObservabilityJudgesClient.RunASavedJudgeOnAConversation.g.cs index 07c78043..6a59c6a8 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaObservabilityJudgesClient.RunASavedJudgeOnAConversation.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaObservabilityJudgesClient.RunASavedJudgeOnAConversation.g.cs @@ -54,6 +54,31 @@ partial void ProcessRunASavedJudgeOnAConversationResponseContent( public async global::System.Threading.Tasks.Task RunASavedJudgeOnAConversationAsync( global::System.Guid judgeId, + global::Mistral.JudgeConversationRequest request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RunASavedJudgeOnAConversationAsResponseAsync( + judgeId: judgeId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Run a saved judge on a 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> RunASavedJudgeOnAConversationAsResponseAsync( + global::System.Guid judgeId, + global::Mistral.JudgeConversationRequest request, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -89,6 +114,7 @@ partial void ProcessRunASavedJudgeOnAConversationResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/observability/judges/{judgeId}/live-judging", baseUri: HttpClient.BaseAddress); @@ -169,6 +195,8 @@ partial void ProcessRunASavedJudgeOnAConversationResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -179,6 +207,11 @@ partial void ProcessRunASavedJudgeOnAConversationResponseContent( } 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, @@ -196,6 +229,8 @@ partial void ProcessRunASavedJudgeOnAConversationResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -205,8 +240,7 @@ partial void ProcessRunASavedJudgeOnAConversationResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -215,6 +249,11 @@ partial void ProcessRunASavedJudgeOnAConversationResponseContent( __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( @@ -231,14 +270,15 @@ partial void ProcessRunASavedJudgeOnAConversationResponseContent( 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; } @@ -278,6 +318,8 @@ partial void ProcessRunASavedJudgeOnAConversationResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -298,6 +340,8 @@ partial void ProcessRunASavedJudgeOnAConversationResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Bad Request - Invalid request parameters or data @@ -512,9 +556,13 @@ partial void ProcessRunASavedJudgeOnAConversationResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.JudgeOutput.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.JudgeOutput.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) { @@ -542,9 +590,13 @@ partial void ProcessRunASavedJudgeOnAConversationResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.JudgeOutput.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.JudgeOutput.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.BetaObservabilityJudgesClient.UpdateAJudge.g.cs b/src/libs/Mistral/Generated/Mistral.BetaObservabilityJudgesClient.UpdateAJudge.g.cs index c6bba22d..7443b14a 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaObservabilityJudgesClient.UpdateAJudge.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaObservabilityJudgesClient.UpdateAJudge.g.cs @@ -49,6 +49,29 @@ partial void ProcessUpdateAJudgeResponse( public async global::System.Threading.Tasks.Task UpdateAJudgeAsync( global::System.Guid judgeId, + global::Mistral.PutJudgeInSchema request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + await UpdateAJudgeAsResponseAsync( + judgeId: judgeId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Update a judge + /// + /// + /// + /// 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 UpdateAJudgeAsResponseAsync( + global::System.Guid judgeId, + global::Mistral.PutJudgeInSchema request, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -84,6 +107,7 @@ partial void ProcessUpdateAJudgeResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/observability/judges/{judgeId}", baseUri: HttpClient.BaseAddress); @@ -164,6 +188,8 @@ partial void ProcessUpdateAJudgeResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -174,6 +200,11 @@ partial void ProcessUpdateAJudgeResponse( } 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 ProcessUpdateAJudgeResponse( 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 ProcessUpdateAJudgeResponse( __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 ProcessUpdateAJudgeResponse( __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 ProcessUpdateAJudgeResponse( 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 ProcessUpdateAJudgeResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -293,6 +333,8 @@ partial void ProcessUpdateAJudgeResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Bad Request - Invalid request parameters or data @@ -503,6 +545,10 @@ partial void ProcessUpdateAJudgeResponse( { __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) { @@ -524,6 +570,10 @@ partial void ProcessUpdateAJudgeResponse( 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.BetaObservabilityJudgesClient.g.cs b/src/libs/Mistral/Generated/Mistral.BetaObservabilityJudgesClient.g.cs index 6e2f874f..b747d20e 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaObservabilityJudgesClient.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaObservabilityJudgesClient.g.cs @@ -73,10 +73,10 @@ public BetaObservabilityJudgesClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public BetaObservabilityJudgesClient( - 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.BetaWorkflowsClient.ArchiveWorkflow.g.cs b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsClient.ArchiveWorkflow.g.cs index d372696b..dc40567d 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaWorkflowsClient.ArchiveWorkflow.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsClient.ArchiveWorkflow.g.cs @@ -52,6 +52,26 @@ partial void ProcessArchiveWorkflowResponseContent( string workflowIdentifier, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ArchiveWorkflowAsResponseAsync( + workflowIdentifier: workflowIdentifier, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Archive Workflow + /// + /// + /// 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> ArchiveWorkflowAsResponseAsync( + string workflowIdentifier, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -81,6 +101,7 @@ partial void ProcessArchiveWorkflowResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/workflows/{workflowIdentifier}/archive", baseUri: HttpClient.BaseAddress); @@ -154,6 +175,8 @@ partial void ProcessArchiveWorkflowResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -164,6 +187,11 @@ partial void ProcessArchiveWorkflowResponseContent( } 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 ProcessArchiveWorkflowResponseContent( 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 ProcessArchiveWorkflowResponseContent( __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 ProcessArchiveWorkflowResponseContent( __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 ProcessArchiveWorkflowResponseContent( 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 ProcessArchiveWorkflowResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -283,6 +320,8 @@ partial void ProcessArchiveWorkflowResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -345,9 +384,13 @@ partial void ProcessArchiveWorkflowResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.WorkflowArchiveResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.WorkflowArchiveResponse.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) { @@ -375,9 +418,13 @@ partial void ProcessArchiveWorkflowResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.WorkflowArchiveResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.WorkflowArchiveResponse.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.BetaWorkflowsClient.ExecuteWorkflow.g.cs b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsClient.ExecuteWorkflow.g.cs index db3347d5..dfc8ad2d 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaWorkflowsClient.ExecuteWorkflow.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsClient.ExecuteWorkflow.g.cs @@ -56,6 +56,31 @@ partial void ProcessExecuteWorkflowResponseContent( public async global::System.Threading.Tasks.Task> ExecuteWorkflowAsync( string workflowIdentifier, + global::Mistral.WorkflowExecutionRequest request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ExecuteWorkflowAsResponseAsync( + workflowIdentifier: workflowIdentifier, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Execute Workflow + /// + /// + /// + /// 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>> ExecuteWorkflowAsResponseAsync( + string workflowIdentifier, + global::Mistral.WorkflowExecutionRequest request, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -91,6 +116,7 @@ partial void ProcessExecuteWorkflowResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/workflows/{workflowIdentifier}/execute", baseUri: HttpClient.BaseAddress); @@ -171,6 +197,8 @@ partial void ProcessExecuteWorkflowResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -181,6 +209,11 @@ partial void ProcessExecuteWorkflowResponseContent( } 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 +231,8 @@ partial void ProcessExecuteWorkflowResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -207,8 +242,7 @@ partial void ProcessExecuteWorkflowResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -217,6 +251,11 @@ partial void ProcessExecuteWorkflowResponseContent( __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 +272,15 @@ partial void ProcessExecuteWorkflowResponseContent( 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 +320,8 @@ partial void ProcessExecuteWorkflowResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -300,6 +342,8 @@ partial void ProcessExecuteWorkflowResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -362,9 +406,13 @@ partial void ProcessExecuteWorkflowResponseContent( { __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) { @@ -392,9 +440,13 @@ partial void ProcessExecuteWorkflowResponseContent( #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.BetaWorkflowsClient.GetWorkflow.g.cs b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsClient.GetWorkflow.g.cs index eb66a732..38476478 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaWorkflowsClient.GetWorkflow.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsClient.GetWorkflow.g.cs @@ -52,6 +52,26 @@ partial void ProcessGetWorkflowResponseContent( string workflowIdentifier, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetWorkflowAsResponseAsync( + workflowIdentifier: workflowIdentifier, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Workflow + /// + /// + /// 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> GetWorkflowAsResponseAsync( + string workflowIdentifier, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -81,6 +101,7 @@ partial void ProcessGetWorkflowResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/workflows/{workflowIdentifier}", baseUri: HttpClient.BaseAddress); @@ -154,6 +175,8 @@ partial void ProcessGetWorkflowResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -164,6 +187,11 @@ partial void ProcessGetWorkflowResponseContent( } 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 ProcessGetWorkflowResponseContent( 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 ProcessGetWorkflowResponseContent( __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 ProcessGetWorkflowResponseContent( __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 ProcessGetWorkflowResponseContent( 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 ProcessGetWorkflowResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -283,6 +320,8 @@ partial void ProcessGetWorkflowResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -345,9 +384,13 @@ partial void ProcessGetWorkflowResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.WorkflowGetResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.WorkflowGetResponse.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) { @@ -375,9 +418,13 @@ partial void ProcessGetWorkflowResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.WorkflowGetResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.WorkflowGetResponse.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.BetaWorkflowsClient.GetWorkflowRegistration.g.cs b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsClient.GetWorkflowRegistration.g.cs index 08dc5d75..7b25b137 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaWorkflowsClient.GetWorkflowRegistration.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsClient.GetWorkflowRegistration.g.cs @@ -66,6 +66,38 @@ partial void ProcessGetWorkflowRegistrationResponseContent( bool? includeShared = default, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetWorkflowRegistrationAsResponseAsync( + workflowRegistrationId: workflowRegistrationId, + withWorkflow: withWorkflow, + includeShared: includeShared, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Workflow Registration + /// + /// + /// + /// Whether to include the workflow definition
+ /// Default Value: false + /// + /// + /// Whether to include shared workflow versions
+ /// Default Value: true + /// + /// 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> GetWorkflowRegistrationAsResponseAsync( + global::System.Guid workflowRegistrationId, + bool? withWorkflow = default, + bool? includeShared = default, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -97,12 +129,13 @@ partial void ProcessGetWorkflowRegistrationResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/workflows/registrations/{workflowRegistrationId}", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("with_workflow", withWorkflow?.ToString().ToLowerInvariant()) - .AddOptionalParameter("include_shared", includeShared?.ToString().ToLowerInvariant()) + .AddOptionalParameter("include_shared", includeShared?.ToString().ToLowerInvariant()) ; var __path = __pathBuilder.ToString(); __path = global::Mistral.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -176,6 +209,8 @@ partial void ProcessGetWorkflowRegistrationResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -186,6 +221,11 @@ partial void ProcessGetWorkflowRegistrationResponseContent( } 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 +243,8 @@ partial void ProcessGetWorkflowRegistrationResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -212,8 +254,7 @@ partial void ProcessGetWorkflowRegistrationResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -222,6 +263,11 @@ partial void ProcessGetWorkflowRegistrationResponseContent( __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 +284,15 @@ partial void ProcessGetWorkflowRegistrationResponseContent( 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 +332,8 @@ partial void ProcessGetWorkflowRegistrationResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -305,6 +354,8 @@ partial void ProcessGetWorkflowRegistrationResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -367,9 +418,13 @@ partial void ProcessGetWorkflowRegistrationResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.WorkflowRegistrationGetResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.WorkflowRegistrationGetResponse.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 +452,13 @@ partial void ProcessGetWorkflowRegistrationResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.WorkflowRegistrationGetResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.WorkflowRegistrationGetResponse.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.BetaWorkflowsClient.GetWorkflowRegistrations.g.cs b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsClient.GetWorkflowRegistrations.g.cs index 58f0681c..bd9d33b4 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaWorkflowsClient.GetWorkflowRegistrations.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsClient.GetWorkflowRegistrations.g.cs @@ -112,6 +112,77 @@ partial void ProcessGetWorkflowRegistrationsResponseContent( global::System.Guid? cursor = default, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetWorkflowRegistrationsAsResponseAsync( + workflowId: workflowId, + taskQueue: taskQueue, + activeOnly: activeOnly, + includeShared: includeShared, + workflowSearch: workflowSearch, + archived: archived, + withWorkflow: withWorkflow, + availableInChatAssistant: availableInChatAssistant, + limit: limit, + cursor: cursor, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Workflow Registrations + /// + /// + /// The workflow ID to filter by + /// + /// + /// The task queue to filter by + /// + /// + /// Whether to only return active workflows versions
+ /// Default Value: false + /// + /// + /// Whether to include shared workflow versions
+ /// Default Value: true + /// + /// + /// The workflow name to filter by + /// + /// + /// Filter by archived state. False=exclude archived, True=only archived, None=include all + /// + /// + /// Whether to include the workflow definition
+ /// Default Value: false + /// + /// + /// Whether to only return workflows compatible with chat assistant + /// + /// + /// The maximum number of workflows versions to return
+ /// Default Value: 50 + /// + /// + /// The cursor for pagination + /// + /// 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> GetWorkflowRegistrationsAsResponseAsync( + global::System.Guid? workflowId = default, + string? taskQueue = default, + bool? activeOnly = default, + bool? includeShared = default, + string? workflowSearch = default, + bool? archived = default, + bool? withWorkflow = default, + bool? availableInChatAssistant = default, + int? limit = default, + global::System.Guid? cursor = default, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -150,9 +221,10 @@ partial void ProcessGetWorkflowRegistrationsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: "/v1/workflows/registrations", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("workflow_id", workflowId?.ToString()) .AddOptionalParameter("task_queue", taskQueue) @@ -163,7 +235,7 @@ partial void ProcessGetWorkflowRegistrationsResponseContent( .AddOptionalParameter("with_workflow", withWorkflow?.ToString().ToLowerInvariant()) .AddOptionalParameter("available_in_chat_assistant", availableInChatAssistant?.ToString().ToLowerInvariant()) .AddOptionalParameter("limit", limit?.ToString()) - .AddOptionalParameter("cursor", cursor?.ToString()) + .AddOptionalParameter("cursor", cursor?.ToString()) ; var __path = __pathBuilder.ToString(); __path = global::Mistral.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -244,6 +316,8 @@ partial void ProcessGetWorkflowRegistrationsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -254,6 +328,11 @@ partial void ProcessGetWorkflowRegistrationsResponseContent( } 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, @@ -271,6 +350,8 @@ partial void ProcessGetWorkflowRegistrationsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -280,8 +361,7 @@ partial void ProcessGetWorkflowRegistrationsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -290,6 +370,11 @@ partial void ProcessGetWorkflowRegistrationsResponseContent( __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( @@ -306,14 +391,15 @@ partial void ProcessGetWorkflowRegistrationsResponseContent( 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; } @@ -353,6 +439,8 @@ partial void ProcessGetWorkflowRegistrationsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -373,6 +461,8 @@ partial void ProcessGetWorkflowRegistrationsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -435,9 +525,13 @@ partial void ProcessGetWorkflowRegistrationsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.WorkflowRegistrationListResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.WorkflowRegistrationListResponse.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) { @@ -465,9 +559,13 @@ partial void ProcessGetWorkflowRegistrationsResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.WorkflowRegistrationListResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.WorkflowRegistrationListResponse.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.BetaWorkflowsClient.UnarchiveWorkflow.g.cs b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsClient.UnarchiveWorkflow.g.cs index 292abbb0..13e3141d 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaWorkflowsClient.UnarchiveWorkflow.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsClient.UnarchiveWorkflow.g.cs @@ -52,6 +52,26 @@ partial void ProcessUnarchiveWorkflowResponseContent( string workflowIdentifier, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UnarchiveWorkflowAsResponseAsync( + workflowIdentifier: workflowIdentifier, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Unarchive Workflow + /// + /// + /// 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> UnarchiveWorkflowAsResponseAsync( + string workflowIdentifier, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -81,6 +101,7 @@ partial void ProcessUnarchiveWorkflowResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/workflows/{workflowIdentifier}/unarchive", baseUri: HttpClient.BaseAddress); @@ -154,6 +175,8 @@ partial void ProcessUnarchiveWorkflowResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -164,6 +187,11 @@ partial void ProcessUnarchiveWorkflowResponseContent( } 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 ProcessUnarchiveWorkflowResponseContent( 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 ProcessUnarchiveWorkflowResponseContent( __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 ProcessUnarchiveWorkflowResponseContent( __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 ProcessUnarchiveWorkflowResponseContent( 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 ProcessUnarchiveWorkflowResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -283,6 +320,8 @@ partial void ProcessUnarchiveWorkflowResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -345,9 +384,13 @@ partial void ProcessUnarchiveWorkflowResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.WorkflowUnarchiveResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.WorkflowUnarchiveResponse.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) { @@ -375,9 +418,13 @@ partial void ProcessUnarchiveWorkflowResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.WorkflowUnarchiveResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.WorkflowUnarchiveResponse.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.BetaWorkflowsClient.UpdateWorkflow.g.cs b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsClient.UpdateWorkflow.g.cs index 42d6bea0..89e5e5cc 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaWorkflowsClient.UpdateWorkflow.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsClient.UpdateWorkflow.g.cs @@ -54,6 +54,31 @@ partial void ProcessUpdateWorkflowResponseContent( public async global::System.Threading.Tasks.Task UpdateWorkflowAsync( string workflowIdentifier, + global::Mistral.WorkflowUpdateRequest request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UpdateWorkflowAsResponseAsync( + workflowIdentifier: workflowIdentifier, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update Workflow + /// + /// + /// + /// 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> UpdateWorkflowAsResponseAsync( + string workflowIdentifier, + global::Mistral.WorkflowUpdateRequest request, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -89,6 +114,7 @@ partial void ProcessUpdateWorkflowResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/workflows/{workflowIdentifier}", baseUri: HttpClient.BaseAddress); @@ -169,6 +195,8 @@ partial void ProcessUpdateWorkflowResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -179,6 +207,11 @@ partial void ProcessUpdateWorkflowResponseContent( } 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, @@ -196,6 +229,8 @@ partial void ProcessUpdateWorkflowResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -205,8 +240,7 @@ partial void ProcessUpdateWorkflowResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -215,6 +249,11 @@ partial void ProcessUpdateWorkflowResponseContent( __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( @@ -231,14 +270,15 @@ partial void ProcessUpdateWorkflowResponseContent( 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; } @@ -278,6 +318,8 @@ partial void ProcessUpdateWorkflowResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -298,6 +340,8 @@ partial void ProcessUpdateWorkflowResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -360,9 +404,13 @@ partial void ProcessUpdateWorkflowResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.WorkflowUpdateResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.WorkflowUpdateResponse.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) { @@ -390,9 +438,13 @@ partial void ProcessUpdateWorkflowResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.WorkflowUpdateResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.WorkflowUpdateResponse.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.BetaWorkflowsClient.g.cs b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsClient.g.cs index 0ce9c266..c27345ac 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaWorkflowsClient.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsClient.g.cs @@ -73,10 +73,10 @@ public BetaWorkflowsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public BetaWorkflowsClient( - 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.BetaWorkflowsDeploymentsClient.GetDeployment.g.cs b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsDeploymentsClient.GetDeployment.g.cs index b74350a4..678edd56 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaWorkflowsDeploymentsClient.GetDeployment.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsDeploymentsClient.GetDeployment.g.cs @@ -52,6 +52,26 @@ partial void ProcessGetDeploymentResponseContent( string name, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetDeploymentAsResponseAsync( + name: name, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Deployment + /// + /// + /// 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> GetDeploymentAsResponseAsync( + string name, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -81,6 +101,7 @@ partial void ProcessGetDeploymentResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/workflows/deployments/{name}", baseUri: HttpClient.BaseAddress); @@ -154,6 +175,8 @@ partial void ProcessGetDeploymentResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -164,6 +187,11 @@ partial void ProcessGetDeploymentResponseContent( } 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 ProcessGetDeploymentResponseContent( 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 ProcessGetDeploymentResponseContent( __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 ProcessGetDeploymentResponseContent( __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 ProcessGetDeploymentResponseContent( 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 ProcessGetDeploymentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -283,6 +320,8 @@ partial void ProcessGetDeploymentResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -345,9 +384,13 @@ partial void ProcessGetDeploymentResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.DeploymentDetailResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.DeploymentDetailResponse.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) { @@ -375,9 +418,13 @@ partial void ProcessGetDeploymentResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.DeploymentDetailResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.DeploymentDetailResponse.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.BetaWorkflowsDeploymentsClient.ListDeployments.g.cs b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsDeploymentsClient.ListDeployments.g.cs index dc108ddd..ce859d9b 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaWorkflowsDeploymentsClient.ListDeployments.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsDeploymentsClient.ListDeployments.g.cs @@ -58,6 +58,31 @@ partial void ProcessListDeploymentsResponseContent( string? workflowName = default, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListDeploymentsAsResponseAsync( + activeOnly: activeOnly, + workflowName: workflowName, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Deployments + /// + /// + /// Default Value: true + /// + /// + /// 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> ListDeploymentsAsResponseAsync( + bool? activeOnly = default, + string? workflowName = default, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -88,12 +113,13 @@ partial void ProcessListDeploymentsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: "/v1/workflows/deployments", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("active_only", activeOnly?.ToString().ToLowerInvariant()) - .AddOptionalParameter("workflow_name", workflowName) + .AddOptionalParameter("workflow_name", workflowName) ; var __path = __pathBuilder.ToString(); __path = global::Mistral.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -166,6 +192,8 @@ partial void ProcessListDeploymentsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -176,6 +204,11 @@ partial void ProcessListDeploymentsResponseContent( } 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 +226,8 @@ partial void ProcessListDeploymentsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -202,8 +237,7 @@ partial void ProcessListDeploymentsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -212,6 +246,11 @@ partial void ProcessListDeploymentsResponseContent( __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 +267,15 @@ partial void ProcessListDeploymentsResponseContent( 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 +315,8 @@ partial void ProcessListDeploymentsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -295,6 +337,8 @@ partial void ProcessListDeploymentsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -357,9 +401,13 @@ partial void ProcessListDeploymentsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.DeploymentListResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.DeploymentListResponse.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) { @@ -387,9 +435,13 @@ partial void ProcessListDeploymentsResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.DeploymentListResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.DeploymentListResponse.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.BetaWorkflowsDeploymentsClient.g.cs b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsDeploymentsClient.g.cs index 6a6a751c..045522fe 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaWorkflowsDeploymentsClient.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsDeploymentsClient.g.cs @@ -73,10 +73,10 @@ public BetaWorkflowsDeploymentsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public BetaWorkflowsDeploymentsClient( - 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.BetaWorkflowsEventsClient.GetStreamEvents.g.cs b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsEventsClient.GetStreamEvents.g.cs index 1f99801b..5b5b5c8e 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaWorkflowsEventsClient.GetStreamEvents.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsEventsClient.GetStreamEvents.g.cs @@ -149,9 +149,10 @@ partial void ProcessGetStreamEventsResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: "/v1/workflows/events/stream", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("scope", scope?.ToValueString()) .AddOptionalParameter("activity_name", activityName) @@ -163,7 +164,7 @@ partial void ProcessGetStreamEventsResponse( .AddOptionalParameter("stream", stream) .AddOptionalParameter("start_seq", startSeq?.ToString()) .AddOptionalParameter("metadata_filters", metadataFilters?.ToString()) - .AddOptionalParameter("workflow_event_types", workflowEventTypes?.ToString()) + .AddOptionalParameter("workflow_event_types", workflowEventTypes?.ToString()) ; var __path = __pathBuilder.ToString(); __path = global::Mistral.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -252,6 +253,8 @@ partial void ProcessGetStreamEventsResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -262,6 +265,11 @@ partial void ProcessGetStreamEventsResponse( } 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, @@ -279,6 +287,8 @@ partial void ProcessGetStreamEventsResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -288,8 +298,7 @@ partial void ProcessGetStreamEventsResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -298,6 +307,11 @@ partial void ProcessGetStreamEventsResponse( __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( @@ -314,14 +328,15 @@ partial void ProcessGetStreamEventsResponse( 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; } @@ -361,6 +376,8 @@ partial void ProcessGetStreamEventsResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -381,6 +398,8 @@ partial void ProcessGetStreamEventsResponse( 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.BetaWorkflowsEventsClient.GetWorkflowEvents.g.cs b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsEventsClient.GetWorkflowEvents.g.cs index d444e890..dc758574 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaWorkflowsEventsClient.GetWorkflowEvents.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsEventsClient.GetWorkflowEvents.g.cs @@ -79,6 +79,49 @@ partial void ProcessGetWorkflowEventsResponseContent( string? cursor = default, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetWorkflowEventsAsResponseAsync( + rootWorkflowExecId: rootWorkflowExecId, + workflowExecId: workflowExecId, + workflowRunId: workflowRunId, + limit: limit, + cursor: cursor, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Workflow Events + /// + /// + /// Execution ID of the root workflow that initiated this execution chain. + /// + /// + /// Execution ID of the workflow that emitted this event. + /// + /// + /// Run ID of the workflow that emitted this event. + /// + /// + /// Maximum number of events to return.
+ /// Default Value: 100 + /// + /// + /// Cursor for pagination. + /// + /// 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> GetWorkflowEventsAsResponseAsync( + string? rootWorkflowExecId = default, + string? workflowExecId = default, + string? workflowRunId = default, + int? limit = default, + string? cursor = default, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -112,15 +155,16 @@ partial void ProcessGetWorkflowEventsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: "/v1/workflows/events/list", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("root_workflow_exec_id", rootWorkflowExecId) .AddOptionalParameter("workflow_exec_id", workflowExecId) .AddOptionalParameter("workflow_run_id", workflowRunId) .AddOptionalParameter("limit", limit?.ToString()) - .AddOptionalParameter("cursor", cursor) + .AddOptionalParameter("cursor", cursor) ; var __path = __pathBuilder.ToString(); __path = global::Mistral.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -196,6 +240,8 @@ partial void ProcessGetWorkflowEventsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -206,6 +252,11 @@ partial void ProcessGetWorkflowEventsResponseContent( } 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, @@ -223,6 +274,8 @@ partial void ProcessGetWorkflowEventsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -232,8 +285,7 @@ partial void ProcessGetWorkflowEventsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -242,6 +294,11 @@ partial void ProcessGetWorkflowEventsResponseContent( __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( @@ -258,14 +315,15 @@ partial void ProcessGetWorkflowEventsResponseContent( 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; } @@ -305,6 +363,8 @@ partial void ProcessGetWorkflowEventsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -325,6 +385,8 @@ partial void ProcessGetWorkflowEventsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -387,9 +449,13 @@ partial void ProcessGetWorkflowEventsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.ListWorkflowEventResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.ListWorkflowEventResponse.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) { @@ -417,9 +483,13 @@ partial void ProcessGetWorkflowEventsResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.ListWorkflowEventResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.ListWorkflowEventResponse.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.BetaWorkflowsEventsClient.g.cs b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsEventsClient.g.cs index d0a20a9b..7a984dd3 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaWorkflowsEventsClient.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsEventsClient.g.cs @@ -73,10 +73,10 @@ public BetaWorkflowsEventsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public BetaWorkflowsEventsClient( - 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.BetaWorkflowsExecutionsClient.BatchCancelWorkflowExecutions.g.cs b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsExecutionsClient.BatchCancelWorkflowExecutions.g.cs index 785039d7..154b3858 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaWorkflowsExecutionsClient.BatchCancelWorkflowExecutions.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsExecutionsClient.BatchCancelWorkflowExecutions.g.cs @@ -50,6 +50,28 @@ partial void ProcessBatchCancelWorkflowExecutionsResponseContent( /// public async global::System.Threading.Tasks.Task BatchCancelWorkflowExecutionsAsync( + global::Mistral.BatchExecutionBody request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await BatchCancelWorkflowExecutionsAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Batch Cancel Workflow Executions + /// + /// + /// 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> BatchCancelWorkflowExecutionsAsResponseAsync( + global::Mistral.BatchExecutionBody request, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -84,6 +106,7 @@ partial void ProcessBatchCancelWorkflowExecutionsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: "/v1/workflows/executions/cancel", baseUri: HttpClient.BaseAddress); @@ -163,6 +186,8 @@ partial void ProcessBatchCancelWorkflowExecutionsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -173,6 +198,11 @@ partial void ProcessBatchCancelWorkflowExecutionsResponseContent( } 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 ProcessBatchCancelWorkflowExecutionsResponseContent( 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 ProcessBatchCancelWorkflowExecutionsResponseContent( __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 ProcessBatchCancelWorkflowExecutionsResponseContent( __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 ProcessBatchCancelWorkflowExecutionsResponseContent( 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 ProcessBatchCancelWorkflowExecutionsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -292,6 +331,8 @@ partial void ProcessBatchCancelWorkflowExecutionsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -354,9 +395,13 @@ partial void ProcessBatchCancelWorkflowExecutionsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.BatchExecutionResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.BatchExecutionResponse.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) { @@ -384,9 +429,13 @@ partial void ProcessBatchCancelWorkflowExecutionsResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.BatchExecutionResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.BatchExecutionResponse.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.BetaWorkflowsExecutionsClient.BatchTerminateWorkflowExecutions.g.cs b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsExecutionsClient.BatchTerminateWorkflowExecutions.g.cs index 7ef91d6d..34bb3e99 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaWorkflowsExecutionsClient.BatchTerminateWorkflowExecutions.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsExecutionsClient.BatchTerminateWorkflowExecutions.g.cs @@ -50,6 +50,28 @@ partial void ProcessBatchTerminateWorkflowExecutionsResponseContent( /// public async global::System.Threading.Tasks.Task BatchTerminateWorkflowExecutionsAsync( + global::Mistral.BatchExecutionBody request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await BatchTerminateWorkflowExecutionsAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Batch Terminate Workflow Executions + /// + /// + /// 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> BatchTerminateWorkflowExecutionsAsResponseAsync( + global::Mistral.BatchExecutionBody request, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -84,6 +106,7 @@ partial void ProcessBatchTerminateWorkflowExecutionsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: "/v1/workflows/executions/terminate", baseUri: HttpClient.BaseAddress); @@ -163,6 +186,8 @@ partial void ProcessBatchTerminateWorkflowExecutionsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -173,6 +198,11 @@ partial void ProcessBatchTerminateWorkflowExecutionsResponseContent( } 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 ProcessBatchTerminateWorkflowExecutionsResponseContent( 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 ProcessBatchTerminateWorkflowExecutionsResponseContent( __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 ProcessBatchTerminateWorkflowExecutionsResponseContent( __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 ProcessBatchTerminateWorkflowExecutionsResponseContent( 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 ProcessBatchTerminateWorkflowExecutionsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -292,6 +331,8 @@ partial void ProcessBatchTerminateWorkflowExecutionsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -354,9 +395,13 @@ partial void ProcessBatchTerminateWorkflowExecutionsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.BatchExecutionResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.BatchExecutionResponse.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) { @@ -384,9 +429,13 @@ partial void ProcessBatchTerminateWorkflowExecutionsResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.BatchExecutionResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.BatchExecutionResponse.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.BetaWorkflowsExecutionsClient.CancelWorkflowExecution.g.cs b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsExecutionsClient.CancelWorkflowExecution.g.cs index 609993c8..ea96f5ab 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaWorkflowsExecutionsClient.CancelWorkflowExecution.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsExecutionsClient.CancelWorkflowExecution.g.cs @@ -47,6 +47,24 @@ partial void ProcessCancelWorkflowExecutionResponse( string executionId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await CancelWorkflowExecutionAsResponseAsync( + executionId: executionId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Cancel Workflow Execution + /// + /// + /// 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 CancelWorkflowExecutionAsResponseAsync( + string executionId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -76,6 +94,7 @@ partial void ProcessCancelWorkflowExecutionResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/workflows/executions/{executionId}/cancel", baseUri: HttpClient.BaseAddress); @@ -149,6 +168,8 @@ partial void ProcessCancelWorkflowExecutionResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -159,6 +180,11 @@ partial void ProcessCancelWorkflowExecutionResponse( } 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 ProcessCancelWorkflowExecutionResponse( 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 ProcessCancelWorkflowExecutionResponse( __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 ProcessCancelWorkflowExecutionResponse( __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 ProcessCancelWorkflowExecutionResponse( 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 ProcessCancelWorkflowExecutionResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -278,6 +313,8 @@ partial void ProcessCancelWorkflowExecutionResponse( 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 ProcessCancelWorkflowExecutionResponse( { __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 ProcessCancelWorkflowExecutionResponse( 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.BetaWorkflowsExecutionsClient.GetWorkflowExecution.g.cs b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsExecutionsClient.GetWorkflowExecution.g.cs index 44194cd2..0c0cbfe5 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaWorkflowsExecutionsClient.GetWorkflowExecution.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsExecutionsClient.GetWorkflowExecution.g.cs @@ -52,6 +52,26 @@ partial void ProcessGetWorkflowExecutionResponseContent( string executionId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetWorkflowExecutionAsResponseAsync( + executionId: executionId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Workflow Execution + /// + /// + /// 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> GetWorkflowExecutionAsResponseAsync( + string executionId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -81,6 +101,7 @@ partial void ProcessGetWorkflowExecutionResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/workflows/executions/{executionId}", baseUri: HttpClient.BaseAddress); @@ -154,6 +175,8 @@ partial void ProcessGetWorkflowExecutionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -164,6 +187,11 @@ partial void ProcessGetWorkflowExecutionResponseContent( } 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 ProcessGetWorkflowExecutionResponseContent( 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 ProcessGetWorkflowExecutionResponseContent( __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 ProcessGetWorkflowExecutionResponseContent( __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 ProcessGetWorkflowExecutionResponseContent( 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 ProcessGetWorkflowExecutionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -283,6 +320,8 @@ partial void ProcessGetWorkflowExecutionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -345,9 +384,13 @@ partial void ProcessGetWorkflowExecutionResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.WorkflowExecutionResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.WorkflowExecutionResponse.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) { @@ -375,9 +418,13 @@ partial void ProcessGetWorkflowExecutionResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.WorkflowExecutionResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.WorkflowExecutionResponse.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.BetaWorkflowsExecutionsClient.GetWorkflowExecutionHistory.g.cs b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsExecutionsClient.GetWorkflowExecutionHistory.g.cs index 368e196f..41a12264 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaWorkflowsExecutionsClient.GetWorkflowExecutionHistory.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsExecutionsClient.GetWorkflowExecutionHistory.g.cs @@ -58,6 +58,31 @@ partial void ProcessGetWorkflowExecutionHistoryResponseContent( bool? decodePayloads = default, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetWorkflowExecutionHistoryAsResponseAsync( + executionId: executionId, + decodePayloads: decodePayloads, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Workflow Execution History + /// + /// + /// + /// Default Value: false + /// + /// 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> GetWorkflowExecutionHistoryAsResponseAsync( + string executionId, + bool? decodePayloads = default, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -88,11 +113,12 @@ partial void ProcessGetWorkflowExecutionHistoryResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/workflows/executions/{executionId}/history", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder - .AddOptionalParameter("decode_payloads", decodePayloads?.ToString().ToLowerInvariant()) + .AddOptionalParameter("decode_payloads", decodePayloads?.ToString().ToLowerInvariant()) ; var __path = __pathBuilder.ToString(); __path = global::Mistral.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -165,6 +191,8 @@ partial void ProcessGetWorkflowExecutionHistoryResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -175,6 +203,11 @@ partial void ProcessGetWorkflowExecutionHistoryResponseContent( } 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 +225,8 @@ partial void ProcessGetWorkflowExecutionHistoryResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -201,8 +236,7 @@ partial void ProcessGetWorkflowExecutionHistoryResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -211,6 +245,11 @@ partial void ProcessGetWorkflowExecutionHistoryResponseContent( __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 +266,15 @@ partial void ProcessGetWorkflowExecutionHistoryResponseContent( 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 +314,8 @@ partial void ProcessGetWorkflowExecutionHistoryResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -294,6 +336,8 @@ partial void ProcessGetWorkflowExecutionHistoryResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -356,7 +400,11 @@ partial void ProcessGetWorkflowExecutionHistoryResponseContent( { __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) { @@ -384,7 +432,11 @@ partial void ProcessGetWorkflowExecutionHistoryResponseContent( #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.BetaWorkflowsExecutionsClient.GetWorkflowExecutionTraceEvents.g.cs b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsExecutionsClient.GetWorkflowExecutionTraceEvents.g.cs index 7712fda9..58bc7705 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaWorkflowsExecutionsClient.GetWorkflowExecutionTraceEvents.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsExecutionsClient.GetWorkflowExecutionTraceEvents.g.cs @@ -64,6 +64,36 @@ partial void ProcessGetWorkflowExecutionTraceEventsResponseContent( bool? includeInternalEvents = default, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetWorkflowExecutionTraceEventsAsResponseAsync( + executionId: executionId, + mergeSameIdEvents: mergeSameIdEvents, + includeInternalEvents: includeInternalEvents, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Workflow Execution Trace Events + /// + /// + /// + /// Default Value: false + /// + /// + /// Default Value: false + /// + /// 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> GetWorkflowExecutionTraceEventsAsResponseAsync( + string executionId, + bool? mergeSameIdEvents = default, + bool? includeInternalEvents = default, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -95,12 +125,13 @@ partial void ProcessGetWorkflowExecutionTraceEventsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/workflows/executions/{executionId}/trace/events", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("merge_same_id_events", mergeSameIdEvents?.ToString().ToLowerInvariant()) - .AddOptionalParameter("include_internal_events", includeInternalEvents?.ToString().ToLowerInvariant()) + .AddOptionalParameter("include_internal_events", includeInternalEvents?.ToString().ToLowerInvariant()) ; var __path = __pathBuilder.ToString(); __path = global::Mistral.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -174,6 +205,8 @@ partial void ProcessGetWorkflowExecutionTraceEventsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -184,6 +217,11 @@ partial void ProcessGetWorkflowExecutionTraceEventsResponseContent( } 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, @@ -201,6 +239,8 @@ partial void ProcessGetWorkflowExecutionTraceEventsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -210,8 +250,7 @@ partial void ProcessGetWorkflowExecutionTraceEventsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -220,6 +259,11 @@ partial void ProcessGetWorkflowExecutionTraceEventsResponseContent( __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( @@ -236,14 +280,15 @@ partial void ProcessGetWorkflowExecutionTraceEventsResponseContent( 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; } @@ -283,6 +328,8 @@ partial void ProcessGetWorkflowExecutionTraceEventsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -303,6 +350,8 @@ partial void ProcessGetWorkflowExecutionTraceEventsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -365,9 +414,13 @@ partial void ProcessGetWorkflowExecutionTraceEventsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.WorkflowExecutionTraceEventsResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.WorkflowExecutionTraceEventsResponse.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) { @@ -395,9 +448,13 @@ partial void ProcessGetWorkflowExecutionTraceEventsResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.WorkflowExecutionTraceEventsResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.WorkflowExecutionTraceEventsResponse.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.BetaWorkflowsExecutionsClient.GetWorkflowExecutionTraceOtel.g.cs b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsExecutionsClient.GetWorkflowExecutionTraceOtel.g.cs index 00f8191c..d5b6372d 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaWorkflowsExecutionsClient.GetWorkflowExecutionTraceOtel.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsExecutionsClient.GetWorkflowExecutionTraceOtel.g.cs @@ -52,6 +52,26 @@ partial void ProcessGetWorkflowExecutionTraceOtelResponseContent( string executionId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetWorkflowExecutionTraceOtelAsResponseAsync( + executionId: executionId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Workflow Execution Trace Otel + /// + /// + /// 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> GetWorkflowExecutionTraceOtelAsResponseAsync( + string executionId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -81,6 +101,7 @@ partial void ProcessGetWorkflowExecutionTraceOtelResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/workflows/executions/{executionId}/trace/otel", baseUri: HttpClient.BaseAddress); @@ -154,6 +175,8 @@ partial void ProcessGetWorkflowExecutionTraceOtelResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -164,6 +187,11 @@ partial void ProcessGetWorkflowExecutionTraceOtelResponseContent( } 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 ProcessGetWorkflowExecutionTraceOtelResponseContent( 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 ProcessGetWorkflowExecutionTraceOtelResponseContent( __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 ProcessGetWorkflowExecutionTraceOtelResponseContent( __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 ProcessGetWorkflowExecutionTraceOtelResponseContent( 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 ProcessGetWorkflowExecutionTraceOtelResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -283,6 +320,8 @@ partial void ProcessGetWorkflowExecutionTraceOtelResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -345,9 +384,13 @@ partial void ProcessGetWorkflowExecutionTraceOtelResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.WorkflowExecutionTraceOTelResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.WorkflowExecutionTraceOTelResponse.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) { @@ -375,9 +418,13 @@ partial void ProcessGetWorkflowExecutionTraceOtelResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.WorkflowExecutionTraceOTelResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.WorkflowExecutionTraceOTelResponse.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.BetaWorkflowsExecutionsClient.GetWorkflowExecutionTraceSummary.g.cs b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsExecutionsClient.GetWorkflowExecutionTraceSummary.g.cs index dabc1c30..7df6bb9a 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaWorkflowsExecutionsClient.GetWorkflowExecutionTraceSummary.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsExecutionsClient.GetWorkflowExecutionTraceSummary.g.cs @@ -52,6 +52,26 @@ partial void ProcessGetWorkflowExecutionTraceSummaryResponseContent( string executionId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetWorkflowExecutionTraceSummaryAsResponseAsync( + executionId: executionId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Workflow Execution Trace Summary + /// + /// + /// 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> GetWorkflowExecutionTraceSummaryAsResponseAsync( + string executionId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -81,6 +101,7 @@ partial void ProcessGetWorkflowExecutionTraceSummaryResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/workflows/executions/{executionId}/trace/summary", baseUri: HttpClient.BaseAddress); @@ -154,6 +175,8 @@ partial void ProcessGetWorkflowExecutionTraceSummaryResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -164,6 +187,11 @@ partial void ProcessGetWorkflowExecutionTraceSummaryResponseContent( } 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 ProcessGetWorkflowExecutionTraceSummaryResponseContent( 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 ProcessGetWorkflowExecutionTraceSummaryResponseContent( __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 ProcessGetWorkflowExecutionTraceSummaryResponseContent( __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 ProcessGetWorkflowExecutionTraceSummaryResponseContent( 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 ProcessGetWorkflowExecutionTraceSummaryResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -283,6 +320,8 @@ partial void ProcessGetWorkflowExecutionTraceSummaryResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -345,9 +384,13 @@ partial void ProcessGetWorkflowExecutionTraceSummaryResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.WorkflowExecutionTraceSummaryResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.WorkflowExecutionTraceSummaryResponse.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) { @@ -375,9 +418,13 @@ partial void ProcessGetWorkflowExecutionTraceSummaryResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.WorkflowExecutionTraceSummaryResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.WorkflowExecutionTraceSummaryResponse.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.BetaWorkflowsExecutionsClient.QueryWorkflowExecution.g.cs b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsExecutionsClient.QueryWorkflowExecution.g.cs index a65d4077..dd8b2337 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaWorkflowsExecutionsClient.QueryWorkflowExecution.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsExecutionsClient.QueryWorkflowExecution.g.cs @@ -54,6 +54,31 @@ partial void ProcessQueryWorkflowExecutionResponseContent( public async global::System.Threading.Tasks.Task QueryWorkflowExecutionAsync( string executionId, + global::Mistral.QueryInvocationBody request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await QueryWorkflowExecutionAsResponseAsync( + executionId: executionId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Query Workflow Execution + /// + /// + /// + /// 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> QueryWorkflowExecutionAsResponseAsync( + string executionId, + global::Mistral.QueryInvocationBody request, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -89,6 +114,7 @@ partial void ProcessQueryWorkflowExecutionResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/workflows/executions/{executionId}/queries", baseUri: HttpClient.BaseAddress); @@ -169,6 +195,8 @@ partial void ProcessQueryWorkflowExecutionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -179,6 +207,11 @@ partial void ProcessQueryWorkflowExecutionResponseContent( } 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, @@ -196,6 +229,8 @@ partial void ProcessQueryWorkflowExecutionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -205,8 +240,7 @@ partial void ProcessQueryWorkflowExecutionResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -215,6 +249,11 @@ partial void ProcessQueryWorkflowExecutionResponseContent( __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( @@ -231,14 +270,15 @@ partial void ProcessQueryWorkflowExecutionResponseContent( 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; } @@ -278,6 +318,8 @@ partial void ProcessQueryWorkflowExecutionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -298,6 +340,8 @@ partial void ProcessQueryWorkflowExecutionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -360,9 +404,13 @@ partial void ProcessQueryWorkflowExecutionResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.QueryWorkflowResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.QueryWorkflowResponse.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) { @@ -390,9 +438,13 @@ partial void ProcessQueryWorkflowExecutionResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.QueryWorkflowResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.QueryWorkflowResponse.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.BetaWorkflowsExecutionsClient.ResetWorkflow.g.cs b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsExecutionsClient.ResetWorkflow.g.cs index e75308bd..11cbd3c2 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaWorkflowsExecutionsClient.ResetWorkflow.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsExecutionsClient.ResetWorkflow.g.cs @@ -49,6 +49,29 @@ partial void ProcessResetWorkflowResponse( public async global::System.Threading.Tasks.Task ResetWorkflowAsync( string executionId, + global::Mistral.ResetInvocationBody request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + await ResetWorkflowAsResponseAsync( + executionId: executionId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Reset Workflow + /// + /// + /// + /// 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 ResetWorkflowAsResponseAsync( + string executionId, + global::Mistral.ResetInvocationBody request, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -84,6 +107,7 @@ partial void ProcessResetWorkflowResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/workflows/executions/{executionId}/reset", baseUri: HttpClient.BaseAddress); @@ -164,6 +188,8 @@ partial void ProcessResetWorkflowResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -174,6 +200,11 @@ partial void ProcessResetWorkflowResponse( } 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 ProcessResetWorkflowResponse( 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 ProcessResetWorkflowResponse( __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 ProcessResetWorkflowResponse( __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 ProcessResetWorkflowResponse( 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 ProcessResetWorkflowResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -293,6 +333,8 @@ partial void ProcessResetWorkflowResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -351,6 +393,10 @@ partial void ProcessResetWorkflowResponse( { __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) { @@ -372,6 +418,10 @@ partial void ProcessResetWorkflowResponse( 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.BetaWorkflowsExecutionsClient.SignalWorkflowExecution.g.cs b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsExecutionsClient.SignalWorkflowExecution.g.cs index a532c9ae..9542afe1 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaWorkflowsExecutionsClient.SignalWorkflowExecution.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsExecutionsClient.SignalWorkflowExecution.g.cs @@ -54,6 +54,31 @@ partial void ProcessSignalWorkflowExecutionResponseContent( public async global::System.Threading.Tasks.Task SignalWorkflowExecutionAsync( string executionId, + global::Mistral.SignalInvocationBody request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await SignalWorkflowExecutionAsResponseAsync( + executionId: executionId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Signal Workflow Execution + /// + /// + /// + /// 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> SignalWorkflowExecutionAsResponseAsync( + string executionId, + global::Mistral.SignalInvocationBody request, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -89,6 +114,7 @@ partial void ProcessSignalWorkflowExecutionResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/workflows/executions/{executionId}/signals", baseUri: HttpClient.BaseAddress); @@ -169,6 +195,8 @@ partial void ProcessSignalWorkflowExecutionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -179,6 +207,11 @@ partial void ProcessSignalWorkflowExecutionResponseContent( } 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, @@ -196,6 +229,8 @@ partial void ProcessSignalWorkflowExecutionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -205,8 +240,7 @@ partial void ProcessSignalWorkflowExecutionResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -215,6 +249,11 @@ partial void ProcessSignalWorkflowExecutionResponseContent( __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( @@ -231,14 +270,15 @@ partial void ProcessSignalWorkflowExecutionResponseContent( 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; } @@ -278,6 +318,8 @@ partial void ProcessSignalWorkflowExecutionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -298,6 +340,8 @@ partial void ProcessSignalWorkflowExecutionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -360,9 +404,13 @@ partial void ProcessSignalWorkflowExecutionResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.SignalWorkflowResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.SignalWorkflowResponse.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) { @@ -390,9 +438,13 @@ partial void ProcessSignalWorkflowExecutionResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.SignalWorkflowResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.SignalWorkflowResponse.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.BetaWorkflowsExecutionsClient.Stream.g.cs b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsExecutionsClient.Stream.g.cs index 6333b288..1a925fb9 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaWorkflowsExecutionsClient.Stream.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsExecutionsClient.Stream.g.cs @@ -86,12 +86,13 @@ partial void ProcessStreamResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/workflows/executions/{executionId}/stream", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("event_source", eventSource?.ToString()) - .AddOptionalParameter("last_event_id", lastEventId) + .AddOptionalParameter("last_event_id", lastEventId) ; var __path = __pathBuilder.ToString(); __path = global::Mistral.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -165,6 +166,8 @@ partial void ProcessStreamResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -175,6 +178,11 @@ partial void ProcessStreamResponse( } 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 ProcessStreamResponse( 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 ProcessStreamResponse( __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 ProcessStreamResponse( __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 ProcessStreamResponse( 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 ProcessStreamResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -294,6 +311,8 @@ partial void ProcessStreamResponse( 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.BetaWorkflowsExecutionsClient.TerminateWorkflowExecution.g.cs b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsExecutionsClient.TerminateWorkflowExecution.g.cs index 34fb6d1c..ea952997 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaWorkflowsExecutionsClient.TerminateWorkflowExecution.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsExecutionsClient.TerminateWorkflowExecution.g.cs @@ -47,6 +47,24 @@ partial void ProcessTerminateWorkflowExecutionResponse( string executionId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await TerminateWorkflowExecutionAsResponseAsync( + executionId: executionId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Terminate Workflow Execution + /// + /// + /// 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 TerminateWorkflowExecutionAsResponseAsync( + string executionId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -76,6 +94,7 @@ partial void ProcessTerminateWorkflowExecutionResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/workflows/executions/{executionId}/terminate", baseUri: HttpClient.BaseAddress); @@ -149,6 +168,8 @@ partial void ProcessTerminateWorkflowExecutionResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -159,6 +180,11 @@ partial void ProcessTerminateWorkflowExecutionResponse( } 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 ProcessTerminateWorkflowExecutionResponse( 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 ProcessTerminateWorkflowExecutionResponse( __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 ProcessTerminateWorkflowExecutionResponse( __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 ProcessTerminateWorkflowExecutionResponse( 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 ProcessTerminateWorkflowExecutionResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -278,6 +313,8 @@ partial void ProcessTerminateWorkflowExecutionResponse( 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 ProcessTerminateWorkflowExecutionResponse( { __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 ProcessTerminateWorkflowExecutionResponse( 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.BetaWorkflowsExecutionsClient.UpdateWorkflowExecution.g.cs b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsExecutionsClient.UpdateWorkflowExecution.g.cs index ed18223b..aa1f09aa 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaWorkflowsExecutionsClient.UpdateWorkflowExecution.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsExecutionsClient.UpdateWorkflowExecution.g.cs @@ -54,6 +54,31 @@ partial void ProcessUpdateWorkflowExecutionResponseContent( public async global::System.Threading.Tasks.Task UpdateWorkflowExecutionAsync( string executionId, + global::Mistral.UpdateInvocationBody request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UpdateWorkflowExecutionAsResponseAsync( + executionId: executionId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update Workflow Execution + /// + /// + /// + /// 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> UpdateWorkflowExecutionAsResponseAsync( + string executionId, + global::Mistral.UpdateInvocationBody request, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -89,6 +114,7 @@ partial void ProcessUpdateWorkflowExecutionResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/workflows/executions/{executionId}/updates", baseUri: HttpClient.BaseAddress); @@ -169,6 +195,8 @@ partial void ProcessUpdateWorkflowExecutionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -179,6 +207,11 @@ partial void ProcessUpdateWorkflowExecutionResponseContent( } 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, @@ -196,6 +229,8 @@ partial void ProcessUpdateWorkflowExecutionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -205,8 +240,7 @@ partial void ProcessUpdateWorkflowExecutionResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -215,6 +249,11 @@ partial void ProcessUpdateWorkflowExecutionResponseContent( __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( @@ -231,14 +270,15 @@ partial void ProcessUpdateWorkflowExecutionResponseContent( 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; } @@ -278,6 +318,8 @@ partial void ProcessUpdateWorkflowExecutionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -298,6 +340,8 @@ partial void ProcessUpdateWorkflowExecutionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -360,9 +404,13 @@ partial void ProcessUpdateWorkflowExecutionResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.UpdateWorkflowResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.UpdateWorkflowResponse.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) { @@ -390,9 +438,13 @@ partial void ProcessUpdateWorkflowExecutionResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.UpdateWorkflowResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.UpdateWorkflowResponse.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.BetaWorkflowsExecutionsClient.g.cs b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsExecutionsClient.g.cs index 13fed0d2..0a1e7c14 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaWorkflowsExecutionsClient.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsExecutionsClient.g.cs @@ -73,10 +73,10 @@ public BetaWorkflowsExecutionsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public BetaWorkflowsExecutionsClient( - 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.BetaWorkflowsMetricsClient.GetWorkflowMetrics.g.cs b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsMetricsClient.GetWorkflowMetrics.g.cs index 3e5201ea..9286a828 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaWorkflowsMetricsClient.GetWorkflowMetrics.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsMetricsClient.GetWorkflowMetrics.g.cs @@ -81,6 +81,53 @@ partial void ProcessGetWorkflowMetricsResponseContent( global::System.DateTime? endTime = default, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetWorkflowMetricsAsResponseAsync( + workflowName: workflowName, + startTime: startTime, + endTime: endTime, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Workflow Metrics
+ /// Get comprehensive metrics for a specific workflow.
+ /// Args:
+ /// workflow_name: The name of the workflow type to get metrics for
+ /// start_time: Optional start time filter (ISO 8601 format)
+ /// end_time: Optional end time filter (ISO 8601 format)
+ /// Returns:
+ /// WorkflowMetrics: Dictionary containing metrics:
+ /// - execution_count: Total number of executions
+ /// - success_count: Number of successful executions
+ /// - error_count: Number of failed/terminated executions
+ /// - average_latency_ms: Average execution duration in milliseconds
+ /// - retry_rate: Proportion of workflows with retries
+ /// - latency_over_time: Time-series data of execution durations
+ /// Example:
+ /// GET /v1/workflows/MyWorkflow/metrics
+ /// GET /v1/workflows/MyWorkflow/metrics?start_time=2025-01-01T00:00:00Z
+ /// GET /v1/workflows/MyWorkflow/metrics?start_time=2025-01-01T00:00:00Z&end_time=2025-12-31T23:59:59Z + ///
+ /// + /// + /// Filter workflows started after this time (ISO 8601) + /// + /// + /// Filter workflows started before this time (ISO 8601) + /// + /// 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> GetWorkflowMetricsAsResponseAsync( + string workflowName, + global::System.DateTime? startTime = default, + global::System.DateTime? endTime = default, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -112,12 +159,13 @@ partial void ProcessGetWorkflowMetricsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/workflows/{workflowName}/metrics", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("start_time", startTime?.ToString()) - .AddOptionalParameter("end_time", endTime?.ToString()) + .AddOptionalParameter("end_time", endTime?.ToString()) ; var __path = __pathBuilder.ToString(); __path = global::Mistral.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -191,6 +239,8 @@ partial void ProcessGetWorkflowMetricsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -201,6 +251,11 @@ partial void ProcessGetWorkflowMetricsResponseContent( } 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, @@ -218,6 +273,8 @@ partial void ProcessGetWorkflowMetricsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -227,8 +284,7 @@ partial void ProcessGetWorkflowMetricsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -237,6 +293,11 @@ partial void ProcessGetWorkflowMetricsResponseContent( __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( @@ -253,14 +314,15 @@ partial void ProcessGetWorkflowMetricsResponseContent( 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; } @@ -300,6 +362,8 @@ partial void ProcessGetWorkflowMetricsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -320,6 +384,8 @@ partial void ProcessGetWorkflowMetricsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -382,9 +448,13 @@ partial void ProcessGetWorkflowMetricsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.WorkflowMetrics.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.WorkflowMetrics.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) { @@ -412,9 +482,13 @@ partial void ProcessGetWorkflowMetricsResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.WorkflowMetrics.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.WorkflowMetrics.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.BetaWorkflowsMetricsClient.g.cs b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsMetricsClient.g.cs index 53c3a0c0..6c43f8a5 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaWorkflowsMetricsClient.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsMetricsClient.g.cs @@ -73,10 +73,10 @@ public BetaWorkflowsMetricsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public BetaWorkflowsMetricsClient( - 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.BetaWorkflowsRunsClient.GetRun.g.cs b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsRunsClient.GetRun.g.cs index 206e2944..93de8af7 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaWorkflowsRunsClient.GetRun.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsRunsClient.GetRun.g.cs @@ -52,6 +52,26 @@ partial void ProcessGetRunResponseContent( global::System.Guid runId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetRunAsResponseAsync( + runId: runId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Run + /// + /// + /// 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> GetRunAsResponseAsync( + global::System.Guid runId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -81,6 +101,7 @@ partial void ProcessGetRunResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/workflows/runs/{runId}", baseUri: HttpClient.BaseAddress); @@ -154,6 +175,8 @@ partial void ProcessGetRunResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -164,6 +187,11 @@ partial void ProcessGetRunResponseContent( } 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 ProcessGetRunResponseContent( 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 ProcessGetRunResponseContent( __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 ProcessGetRunResponseContent( __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 ProcessGetRunResponseContent( 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 ProcessGetRunResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -283,6 +320,8 @@ partial void ProcessGetRunResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -345,9 +384,13 @@ partial void ProcessGetRunResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.WorkflowExecutionResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.WorkflowExecutionResponse.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) { @@ -375,9 +418,13 @@ partial void ProcessGetRunResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.WorkflowExecutionResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.WorkflowExecutionResponse.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.BetaWorkflowsRunsClient.GetRunHistory.g.cs b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsRunsClient.GetRunHistory.g.cs index ee583dfb..1e3eb332 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaWorkflowsRunsClient.GetRunHistory.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsRunsClient.GetRunHistory.g.cs @@ -58,6 +58,31 @@ partial void ProcessGetRunHistoryResponseContent( bool? decodePayloads = default, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetRunHistoryAsResponseAsync( + runId: runId, + decodePayloads: decodePayloads, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Run History + /// + /// + /// + /// Default Value: false + /// + /// 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> GetRunHistoryAsResponseAsync( + global::System.Guid runId, + bool? decodePayloads = default, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -88,11 +113,12 @@ partial void ProcessGetRunHistoryResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/workflows/runs/{runId}/history", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder - .AddOptionalParameter("decode_payloads", decodePayloads?.ToString().ToLowerInvariant()) + .AddOptionalParameter("decode_payloads", decodePayloads?.ToString().ToLowerInvariant()) ; var __path = __pathBuilder.ToString(); __path = global::Mistral.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -165,6 +191,8 @@ partial void ProcessGetRunHistoryResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -175,6 +203,11 @@ partial void ProcessGetRunHistoryResponseContent( } 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 +225,8 @@ partial void ProcessGetRunHistoryResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -201,8 +236,7 @@ partial void ProcessGetRunHistoryResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -211,6 +245,11 @@ partial void ProcessGetRunHistoryResponseContent( __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 +266,15 @@ partial void ProcessGetRunHistoryResponseContent( 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 +314,8 @@ partial void ProcessGetRunHistoryResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -294,6 +336,8 @@ partial void ProcessGetRunHistoryResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -356,7 +400,11 @@ partial void ProcessGetRunHistoryResponseContent( { __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) { @@ -384,7 +432,11 @@ partial void ProcessGetRunHistoryResponseContent( #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.BetaWorkflowsRunsClient.ListRuns.g.cs b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsRunsClient.ListRuns.g.cs index 6a5012fe..f4ac6b61 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaWorkflowsRunsClient.ListRuns.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsRunsClient.ListRuns.g.cs @@ -79,6 +79,49 @@ partial void ProcessListRunsResponseContent( string? nextPageToken = default, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListRunsAsResponseAsync( + workflowIdentifier: workflowIdentifier, + search: search, + status: status, + pageSize: pageSize, + nextPageToken: nextPageToken, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Runs + /// + /// + /// Filter by workflow name or id + /// + /// + /// Search by workflow name, display name or id + /// + /// + /// Filter by workflow status + /// + /// + /// Number of items per page
+ /// Default Value: 50 + /// + /// + /// Token for the next page of results + /// + /// 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> ListRunsAsResponseAsync( + string? workflowIdentifier = default, + string? search = default, + global::Mistral.AnyOf, object>? status = default, + int? pageSize = default, + string? nextPageToken = default, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -112,15 +155,16 @@ partial void ProcessListRunsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: "/v1/workflows/runs", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("workflow_identifier", workflowIdentifier) .AddOptionalParameter("search", search) .AddOptionalParameter("status", status?.ToString()) .AddOptionalParameter("page_size", pageSize?.ToString()) - .AddOptionalParameter("next_page_token", nextPageToken) + .AddOptionalParameter("next_page_token", nextPageToken) ; var __path = __pathBuilder.ToString(); __path = global::Mistral.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -196,6 +240,8 @@ partial void ProcessListRunsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -206,6 +252,11 @@ partial void ProcessListRunsResponseContent( } 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, @@ -223,6 +274,8 @@ partial void ProcessListRunsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -232,8 +285,7 @@ partial void ProcessListRunsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -242,6 +294,11 @@ partial void ProcessListRunsResponseContent( __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( @@ -258,14 +315,15 @@ partial void ProcessListRunsResponseContent( 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; } @@ -305,6 +363,8 @@ partial void ProcessListRunsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -325,6 +385,8 @@ partial void ProcessListRunsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -387,9 +449,13 @@ partial void ProcessListRunsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.WorkflowExecutionListResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.WorkflowExecutionListResponse.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) { @@ -417,9 +483,13 @@ partial void ProcessListRunsResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.WorkflowExecutionListResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.WorkflowExecutionListResponse.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.BetaWorkflowsRunsClient.g.cs b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsRunsClient.g.cs index 76047529..4191cff8 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaWorkflowsRunsClient.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsRunsClient.g.cs @@ -73,10 +73,10 @@ public BetaWorkflowsRunsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public BetaWorkflowsRunsClient( - 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.BetaWorkflowsSchedulesClient.GetSchedules.g.cs b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsSchedulesClient.GetSchedules.g.cs index 52c6887c..5bff76ac 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaWorkflowsSchedulesClient.GetSchedules.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsSchedulesClient.GetSchedules.g.cs @@ -48,6 +48,23 @@ partial void ProcessGetSchedulesResponseContent( public async global::System.Threading.Tasks.Task GetSchedulesAsync( global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetSchedulesAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Schedules + /// + /// 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> GetSchedulesAsResponseAsync( + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -76,6 +93,7 @@ partial void ProcessGetSchedulesResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: "/v1/workflows/schedules", baseUri: HttpClient.BaseAddress); @@ -148,6 +166,8 @@ partial void ProcessGetSchedulesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -158,6 +178,11 @@ partial void ProcessGetSchedulesResponseContent( } 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, @@ -175,6 +200,8 @@ partial void ProcessGetSchedulesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -184,8 +211,7 @@ partial void ProcessGetSchedulesResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -194,6 +220,11 @@ partial void ProcessGetSchedulesResponseContent( __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( @@ -210,14 +241,15 @@ partial void ProcessGetSchedulesResponseContent( 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; } @@ -257,6 +289,8 @@ partial void ProcessGetSchedulesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -277,6 +311,8 @@ partial void ProcessGetSchedulesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -301,9 +337,13 @@ partial void ProcessGetSchedulesResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.WorkflowScheduleListResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.WorkflowScheduleListResponse.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) { @@ -331,9 +371,13 @@ partial void ProcessGetSchedulesResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.WorkflowScheduleListResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.WorkflowScheduleListResponse.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.BetaWorkflowsSchedulesClient.ScheduleWorkflow.g.cs b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsSchedulesClient.ScheduleWorkflow.g.cs index e08cfac4..6cb0bb72 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaWorkflowsSchedulesClient.ScheduleWorkflow.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsSchedulesClient.ScheduleWorkflow.g.cs @@ -52,6 +52,28 @@ partial void ProcessScheduleWorkflowResponseContent( /// public async global::System.Threading.Tasks.Task ScheduleWorkflowAsync( + global::Mistral.WorkflowScheduleRequest request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ScheduleWorkflowAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Schedule Workflow + /// + /// + /// 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> ScheduleWorkflowAsResponseAsync( + global::Mistral.WorkflowScheduleRequest request, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -86,6 +108,7 @@ partial void ProcessScheduleWorkflowResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: "/v1/workflows/schedules", baseUri: HttpClient.BaseAddress); @@ -165,6 +188,8 @@ partial void ProcessScheduleWorkflowResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -175,6 +200,11 @@ partial void ProcessScheduleWorkflowResponseContent( } 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 +222,8 @@ partial void ProcessScheduleWorkflowResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -201,8 +233,7 @@ partial void ProcessScheduleWorkflowResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -211,6 +242,11 @@ partial void ProcessScheduleWorkflowResponseContent( __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 +263,15 @@ partial void ProcessScheduleWorkflowResponseContent( 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 +311,8 @@ partial void ProcessScheduleWorkflowResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -294,6 +333,8 @@ partial void ProcessScheduleWorkflowResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -356,9 +397,13 @@ partial void ProcessScheduleWorkflowResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.WorkflowScheduleResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.WorkflowScheduleResponse.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) { @@ -386,9 +431,13 @@ partial void ProcessScheduleWorkflowResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.WorkflowScheduleResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.WorkflowScheduleResponse.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.BetaWorkflowsSchedulesClient.UnscheduleWorkflow.g.cs b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsSchedulesClient.UnscheduleWorkflow.g.cs index 0b5c7773..2c1dfd7d 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaWorkflowsSchedulesClient.UnscheduleWorkflow.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsSchedulesClient.UnscheduleWorkflow.g.cs @@ -47,6 +47,24 @@ partial void ProcessUnscheduleWorkflowResponse( string scheduleId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + await UnscheduleWorkflowAsResponseAsync( + scheduleId: scheduleId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + } + /// + /// Unschedule Workflow + /// + /// + /// 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 UnscheduleWorkflowAsResponseAsync( + string scheduleId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -76,6 +94,7 @@ partial void ProcessUnscheduleWorkflowResponse( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/workflows/schedules/{scheduleId}", baseUri: HttpClient.BaseAddress); @@ -149,6 +168,8 @@ partial void ProcessUnscheduleWorkflowResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -159,6 +180,11 @@ partial void ProcessUnscheduleWorkflowResponse( } 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 ProcessUnscheduleWorkflowResponse( 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 ProcessUnscheduleWorkflowResponse( __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 ProcessUnscheduleWorkflowResponse( __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 ProcessUnscheduleWorkflowResponse( 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 ProcessUnscheduleWorkflowResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -278,6 +313,8 @@ partial void ProcessUnscheduleWorkflowResponse( 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 ProcessUnscheduleWorkflowResponse( { __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 ProcessUnscheduleWorkflowResponse( 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.BetaWorkflowsSchedulesClient.g.cs b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsSchedulesClient.g.cs index 4e1b23ed..7cb02e6f 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaWorkflowsSchedulesClient.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsSchedulesClient.g.cs @@ -73,10 +73,10 @@ public BetaWorkflowsSchedulesClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public BetaWorkflowsSchedulesClient( - 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.BetaWorkflowsWorkersClient.GetWorkerInfo.g.cs b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsWorkersClient.GetWorkerInfo.g.cs index 6ccf6b47..b697d7fc 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaWorkflowsWorkersClient.GetWorkerInfo.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsWorkersClient.GetWorkerInfo.g.cs @@ -48,6 +48,23 @@ partial void ProcessGetWorkerInfoResponseContent( public async global::System.Threading.Tasks.Task GetWorkerInfoAsync( global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetWorkerInfoAsResponseAsync( + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Worker Info + /// + /// 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> GetWorkerInfoAsResponseAsync( + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -76,6 +93,7 @@ partial void ProcessGetWorkerInfoResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: "/v1/workflows/workers/whoami", baseUri: HttpClient.BaseAddress); @@ -148,6 +166,8 @@ partial void ProcessGetWorkerInfoResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -158,6 +178,11 @@ partial void ProcessGetWorkerInfoResponseContent( } 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, @@ -175,6 +200,8 @@ partial void ProcessGetWorkerInfoResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -184,8 +211,7 @@ partial void ProcessGetWorkerInfoResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -194,6 +220,11 @@ partial void ProcessGetWorkerInfoResponseContent( __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( @@ -210,14 +241,15 @@ partial void ProcessGetWorkerInfoResponseContent( 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; } @@ -257,6 +289,8 @@ partial void ProcessGetWorkerInfoResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -277,6 +311,8 @@ partial void ProcessGetWorkerInfoResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -301,9 +337,13 @@ partial void ProcessGetWorkerInfoResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.WorkerInfo.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.WorkerInfo.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) { @@ -331,9 +371,13 @@ partial void ProcessGetWorkerInfoResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.WorkerInfo.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.WorkerInfo.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.BetaWorkflowsWorkersClient.g.cs b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsWorkersClient.g.cs index f7056ec5..c9f5b893 100644 --- a/src/libs/Mistral/Generated/Mistral.BetaWorkflowsWorkersClient.g.cs +++ b/src/libs/Mistral/Generated/Mistral.BetaWorkflowsWorkersClient.g.cs @@ -73,10 +73,10 @@ public BetaWorkflowsWorkersClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public BetaWorkflowsWorkersClient( - 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.ChatClient.ChatCompletion.g.cs b/src/libs/Mistral/Generated/Mistral.ChatClient.ChatCompletion.g.cs index 382462f1..6afbfa2c 100644 --- a/src/libs/Mistral/Generated/Mistral.ChatClient.ChatCompletion.g.cs +++ b/src/libs/Mistral/Generated/Mistral.ChatClient.ChatCompletion.g.cs @@ -50,6 +50,28 @@ partial void ProcessChatCompletionResponseContent( /// public async global::System.Threading.Tasks.Task ChatCompletionAsync( + global::Mistral.ChatCompletionRequest request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ChatCompletionAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Chat Completion + /// + /// + /// 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> ChatCompletionAsResponseAsync( + global::Mistral.ChatCompletionRequest request, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -104,10 +126,11 @@ partial void ProcessChatCompletionResponseContent( 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/chat/completions", baseUri: HttpClient.BaseAddress); @@ -187,6 +210,8 @@ partial void ProcessChatCompletionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -197,6 +222,11 @@ partial void ProcessChatCompletionResponseContent( } 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, @@ -214,6 +244,8 @@ partial void ProcessChatCompletionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -223,8 +255,7 @@ partial void ProcessChatCompletionResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -233,6 +264,11 @@ partial void ProcessChatCompletionResponseContent( __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( @@ -249,14 +285,15 @@ partial void ProcessChatCompletionResponseContent( 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; } @@ -296,6 +333,8 @@ partial void ProcessChatCompletionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -316,6 +355,8 @@ partial void ProcessChatCompletionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -378,9 +419,13 @@ partial void ProcessChatCompletionResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.ChatCompletionResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.ChatCompletionResponse.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) { @@ -408,9 +453,13 @@ partial void ProcessChatCompletionResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.ChatCompletionResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.ChatCompletionResponse.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.ChatClient.ChatCompletionAsStream.g.cs b/src/libs/Mistral/Generated/Mistral.ChatClient.ChatCompletionAsStream.g.cs index 16dd9d10..50720236 100644 --- a/src/libs/Mistral/Generated/Mistral.ChatClient.ChatCompletionAsStream.g.cs +++ b/src/libs/Mistral/Generated/Mistral.ChatClient.ChatCompletionAsStream.g.cs @@ -99,10 +99,11 @@ partial void ProcessChatCompletionAsStreamResponse( 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/chat/completions", baseUri: HttpClient.BaseAddress); @@ -182,6 +183,8 @@ partial void ProcessChatCompletionAsStreamResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -192,6 +195,11 @@ partial void ProcessChatCompletionAsStreamResponse( } 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, @@ -209,6 +217,8 @@ partial void ProcessChatCompletionAsStreamResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -218,8 +228,7 @@ partial void ProcessChatCompletionAsStreamResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -228,6 +237,11 @@ partial void ProcessChatCompletionAsStreamResponse( __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( @@ -244,14 +258,15 @@ partial void ProcessChatCompletionAsStreamResponse( 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; } @@ -291,6 +306,8 @@ partial void ProcessChatCompletionAsStreamResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -311,6 +328,8 @@ partial void ProcessChatCompletionAsStreamResponse( 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.ChatClient.g.cs b/src/libs/Mistral/Generated/Mistral.ChatClient.g.cs index 89f3ed38..d0aa9217 100644 --- a/src/libs/Mistral/Generated/Mistral.ChatClient.g.cs +++ b/src/libs/Mistral/Generated/Mistral.ChatClient.g.cs @@ -73,10 +73,10 @@ public ChatClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public ChatClient( - 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.ClassifiersClient.ChatClassifications.g.cs b/src/libs/Mistral/Generated/Mistral.ClassifiersClient.ChatClassifications.g.cs index d050c7e5..d75585d7 100644 --- a/src/libs/Mistral/Generated/Mistral.ClassifiersClient.ChatClassifications.g.cs +++ b/src/libs/Mistral/Generated/Mistral.ClassifiersClient.ChatClassifications.g.cs @@ -50,6 +50,28 @@ partial void ProcessChatClassificationsResponseContent( /// public async global::System.Threading.Tasks.Task ChatClassificationsAsync( + global::Mistral.ChatClassificationRequest request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ChatClassificationsAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Chat Classifications + /// + /// + /// 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> ChatClassificationsAsResponseAsync( + global::Mistral.ChatClassificationRequest request, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -84,6 +106,7 @@ partial void ProcessChatClassificationsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: "/v1/chat/classifications", baseUri: HttpClient.BaseAddress); @@ -163,6 +186,8 @@ partial void ProcessChatClassificationsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -173,6 +198,11 @@ partial void ProcessChatClassificationsResponseContent( } 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 ProcessChatClassificationsResponseContent( 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 ProcessChatClassificationsResponseContent( __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 ProcessChatClassificationsResponseContent( __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 ProcessChatClassificationsResponseContent( 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 ProcessChatClassificationsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -292,6 +331,8 @@ partial void ProcessChatClassificationsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -354,9 +395,13 @@ partial void ProcessChatClassificationsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.ClassificationResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.ClassificationResponse.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) { @@ -384,9 +429,13 @@ partial void ProcessChatClassificationsResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.ClassificationResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.ClassificationResponse.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.ClassifiersClient.ChatModerations.g.cs b/src/libs/Mistral/Generated/Mistral.ClassifiersClient.ChatModerations.g.cs index c3b882d5..4c4ffea5 100644 --- a/src/libs/Mistral/Generated/Mistral.ClassifiersClient.ChatModerations.g.cs +++ b/src/libs/Mistral/Generated/Mistral.ClassifiersClient.ChatModerations.g.cs @@ -50,6 +50,28 @@ partial void ProcessChatModerationsResponseContent( /// public async global::System.Threading.Tasks.Task ChatModerationsAsync( + global::Mistral.ChatModerationRequest request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ChatModerationsAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Chat Moderations + /// + /// + /// 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> ChatModerationsAsResponseAsync( + global::Mistral.ChatModerationRequest request, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -84,6 +106,7 @@ partial void ProcessChatModerationsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: "/v1/chat/moderations", baseUri: HttpClient.BaseAddress); @@ -163,6 +186,8 @@ partial void ProcessChatModerationsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -173,6 +198,11 @@ partial void ProcessChatModerationsResponseContent( } 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 ProcessChatModerationsResponseContent( 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 ProcessChatModerationsResponseContent( __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 ProcessChatModerationsResponseContent( __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 ProcessChatModerationsResponseContent( 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 ProcessChatModerationsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -292,6 +331,8 @@ partial void ProcessChatModerationsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -354,9 +395,13 @@ partial void ProcessChatModerationsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.ModerationResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.ModerationResponse.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) { @@ -384,9 +429,13 @@ partial void ProcessChatModerationsResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.ModerationResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.ModerationResponse.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.ClassifiersClient.Classifications.g.cs b/src/libs/Mistral/Generated/Mistral.ClassifiersClient.Classifications.g.cs index 1f911d81..08d2cae4 100644 --- a/src/libs/Mistral/Generated/Mistral.ClassifiersClient.Classifications.g.cs +++ b/src/libs/Mistral/Generated/Mistral.ClassifiersClient.Classifications.g.cs @@ -50,6 +50,28 @@ partial void ProcessClassificationsResponseContent( /// public async global::System.Threading.Tasks.Task ClassificationsAsync( + global::Mistral.ClassificationRequest request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ClassificationsAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Classifications + /// + /// + /// 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> ClassificationsAsResponseAsync( + global::Mistral.ClassificationRequest request, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -84,6 +106,7 @@ partial void ProcessClassificationsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: "/v1/classifications", baseUri: HttpClient.BaseAddress); @@ -163,6 +186,8 @@ partial void ProcessClassificationsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -173,6 +198,11 @@ partial void ProcessClassificationsResponseContent( } 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 ProcessClassificationsResponseContent( 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 ProcessClassificationsResponseContent( __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 ProcessClassificationsResponseContent( __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 ProcessClassificationsResponseContent( 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 ProcessClassificationsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -292,6 +331,8 @@ partial void ProcessClassificationsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -354,9 +395,13 @@ partial void ProcessClassificationsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.ClassificationResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.ClassificationResponse.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) { @@ -384,9 +429,13 @@ partial void ProcessClassificationsResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.ClassificationResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.ClassificationResponse.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.ClassifiersClient.Moderations.g.cs b/src/libs/Mistral/Generated/Mistral.ClassifiersClient.Moderations.g.cs index 3feebada..8c42f388 100644 --- a/src/libs/Mistral/Generated/Mistral.ClassifiersClient.Moderations.g.cs +++ b/src/libs/Mistral/Generated/Mistral.ClassifiersClient.Moderations.g.cs @@ -50,6 +50,28 @@ partial void ProcessModerationsResponseContent( /// public async global::System.Threading.Tasks.Task ModerationsAsync( + global::Mistral.ClassificationRequest request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ModerationsAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Moderations + /// + /// + /// 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> ModerationsAsResponseAsync( + global::Mistral.ClassificationRequest request, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -84,6 +106,7 @@ partial void ProcessModerationsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: "/v1/moderations", baseUri: HttpClient.BaseAddress); @@ -163,6 +186,8 @@ partial void ProcessModerationsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -173,6 +198,11 @@ partial void ProcessModerationsResponseContent( } 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 ProcessModerationsResponseContent( 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 ProcessModerationsResponseContent( __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 ProcessModerationsResponseContent( __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 ProcessModerationsResponseContent( 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 ProcessModerationsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -292,6 +331,8 @@ partial void ProcessModerationsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -354,9 +395,13 @@ partial void ProcessModerationsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.ModerationResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.ModerationResponse.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) { @@ -384,9 +429,13 @@ partial void ProcessModerationsResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.ModerationResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.ModerationResponse.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.ClassifiersClient.g.cs b/src/libs/Mistral/Generated/Mistral.ClassifiersClient.g.cs index 6c07dcea..5ace01f5 100644 --- a/src/libs/Mistral/Generated/Mistral.ClassifiersClient.g.cs +++ b/src/libs/Mistral/Generated/Mistral.ClassifiersClient.g.cs @@ -73,10 +73,10 @@ public ClassifiersClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public ClassifiersClient( - 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.DeprecatedFineTuningClient.CancelFineTuningJob.g.cs b/src/libs/Mistral/Generated/Mistral.DeprecatedFineTuningClient.CancelFineTuningJob.g.cs index 3188936a..fb7ffa19 100644 --- a/src/libs/Mistral/Generated/Mistral.DeprecatedFineTuningClient.CancelFineTuningJob.g.cs +++ b/src/libs/Mistral/Generated/Mistral.DeprecatedFineTuningClient.CancelFineTuningJob.g.cs @@ -53,6 +53,27 @@ partial void ProcessCancelFineTuningJobResponseContent( global::System.Guid jobId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CancelFineTuningJobAsResponseAsync( + jobId: jobId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Cancel Fine Tuning Job
+ /// Request the cancellation of a fine tuning 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> CancelFineTuningJobAsResponseAsync( + global::System.Guid jobId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -82,6 +103,7 @@ partial void ProcessCancelFineTuningJobResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/fine_tuning/jobs/{jobId}/cancel", baseUri: HttpClient.BaseAddress); @@ -155,6 +177,8 @@ partial void ProcessCancelFineTuningJobResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -165,6 +189,11 @@ partial void ProcessCancelFineTuningJobResponseContent( } 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 ProcessCancelFineTuningJobResponseContent( 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 ProcessCancelFineTuningJobResponseContent( __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 ProcessCancelFineTuningJobResponseContent( __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 ProcessCancelFineTuningJobResponseContent( 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 ProcessCancelFineTuningJobResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -284,6 +322,8 @@ partial void ProcessCancelFineTuningJobResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -308,9 +348,13 @@ partial void ProcessCancelFineTuningJobResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.JobsApiRoutesFineTuningCancelFineTuningJobResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.JobsApiRoutesFineTuningCancelFineTuningJobResponse.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 ProcessCancelFineTuningJobResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.JobsApiRoutesFineTuningCancelFineTuningJobResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.JobsApiRoutesFineTuningCancelFineTuningJobResponse.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.DeprecatedFineTuningClient.CreateFineTuningJob.g.cs b/src/libs/Mistral/Generated/Mistral.DeprecatedFineTuningClient.CreateFineTuningJob.g.cs index 8e05a373..ad4c3e86 100644 --- a/src/libs/Mistral/Generated/Mistral.DeprecatedFineTuningClient.CreateFineTuningJob.g.cs +++ b/src/libs/Mistral/Generated/Mistral.DeprecatedFineTuningClient.CreateFineTuningJob.g.cs @@ -54,6 +54,32 @@ partial void ProcessCreateFineTuningJobResponseContent( /// public async global::System.Threading.Tasks.Task> CreateFineTuningJobAsync( + global::Mistral.JobIn request, + bool? dryRun = default, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await CreateFineTuningJobAsResponseAsync( + + request: request, + dryRun: dryRun, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Create Fine Tuning Job
+ /// Create a new fine-tuning 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>> CreateFineTuningJobAsResponseAsync( + global::Mistral.JobIn request, bool? dryRun = default, global::Mistral.AutoSDKRequestOptions? requestOptions = default, @@ -90,11 +116,12 @@ partial void ProcessCreateFineTuningJobResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: "/v1/fine_tuning/jobs", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder - .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) + .AddOptionalParameter("dry_run", dryRun?.ToString().ToLowerInvariant()) ; var __path = __pathBuilder.ToString(); __path = global::Mistral.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -173,6 +200,8 @@ partial void ProcessCreateFineTuningJobResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -183,6 +212,11 @@ partial void ProcessCreateFineTuningJobResponseContent( } 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 +234,8 @@ partial void ProcessCreateFineTuningJobResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -209,8 +245,7 @@ partial void ProcessCreateFineTuningJobResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -219,6 +254,11 @@ partial void ProcessCreateFineTuningJobResponseContent( __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 +275,15 @@ partial void ProcessCreateFineTuningJobResponseContent( 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 +323,8 @@ partial void ProcessCreateFineTuningJobResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -302,6 +345,8 @@ partial void ProcessCreateFineTuningJobResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -326,9 +371,13 @@ partial void ProcessCreateFineTuningJobResponseContent( { __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) { @@ -356,9 +405,13 @@ partial void ProcessCreateFineTuningJobResponseContent( #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.DeprecatedFineTuningClient.GetFineTuningJob.g.cs b/src/libs/Mistral/Generated/Mistral.DeprecatedFineTuningClient.GetFineTuningJob.g.cs index 15a40429..acaf2f45 100644 --- a/src/libs/Mistral/Generated/Mistral.DeprecatedFineTuningClient.GetFineTuningJob.g.cs +++ b/src/libs/Mistral/Generated/Mistral.DeprecatedFineTuningClient.GetFineTuningJob.g.cs @@ -53,6 +53,27 @@ partial void ProcessGetFineTuningJobResponseContent( global::System.Guid jobId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetFineTuningJobAsResponseAsync( + jobId: jobId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Fine Tuning Job
+ /// Get a fine-tuned job details by its UUID. + ///
+ /// + /// 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> GetFineTuningJobAsResponseAsync( + global::System.Guid jobId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -82,6 +103,7 @@ partial void ProcessGetFineTuningJobResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/fine_tuning/jobs/{jobId}", baseUri: HttpClient.BaseAddress); @@ -155,6 +177,8 @@ partial void ProcessGetFineTuningJobResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -165,6 +189,11 @@ partial void ProcessGetFineTuningJobResponseContent( } 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 ProcessGetFineTuningJobResponseContent( 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 ProcessGetFineTuningJobResponseContent( __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 ProcessGetFineTuningJobResponseContent( __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 ProcessGetFineTuningJobResponseContent( 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 ProcessGetFineTuningJobResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -284,6 +322,8 @@ partial void ProcessGetFineTuningJobResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -308,9 +348,13 @@ partial void ProcessGetFineTuningJobResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.JobsApiRoutesFineTuningGetFineTuningJobResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.JobsApiRoutesFineTuningGetFineTuningJobResponse.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 ProcessGetFineTuningJobResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.JobsApiRoutesFineTuningGetFineTuningJobResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.JobsApiRoutesFineTuningGetFineTuningJobResponse.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.DeprecatedFineTuningClient.GetFineTuningJobs.g.cs b/src/libs/Mistral/Generated/Mistral.DeprecatedFineTuningClient.GetFineTuningJobs.g.cs index dc605fe0..aa15f0d8 100644 --- a/src/libs/Mistral/Generated/Mistral.DeprecatedFineTuningClient.GetFineTuningJobs.g.cs +++ b/src/libs/Mistral/Generated/Mistral.DeprecatedFineTuningClient.GetFineTuningJobs.g.cs @@ -95,6 +95,60 @@ partial void ProcessGetFineTuningJobsResponseContent( string? suffix = default, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetFineTuningJobsAsResponseAsync( + page: page, + pageSize: pageSize, + model: model, + createdAfter: createdAfter, + createdBefore: createdBefore, + createdByMe: createdByMe, + status: status, + wandbProject: wandbProject, + wandbName: wandbName, + suffix: suffix, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Fine Tuning Jobs
+ /// Get a list of fine-tuning jobs for your organization and user. + ///
+ /// + /// Default Value: 0 + /// + /// + /// Default Value: 100 + /// + /// + /// + /// + /// + /// Default Value: false + /// + /// + /// + /// + /// + /// 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> GetFineTuningJobsAsResponseAsync( + int? page = default, + int? pageSize = default, + string? model = default, + global::System.DateTime? createdAfter = default, + global::System.DateTime? createdBefore = default, + bool? createdByMe = default, + global::Mistral.JobsApiRoutesFineTuningGetFineTuningJobsStatus2? status = default, + string? wandbProject = default, + string? wandbName = default, + string? suffix = default, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -133,9 +187,10 @@ partial void ProcessGetFineTuningJobsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: "/v1/fine_tuning/jobs", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("page", page?.ToString()) .AddOptionalParameter("page_size", pageSize?.ToString()) @@ -146,7 +201,7 @@ partial void ProcessGetFineTuningJobsResponseContent( .AddOptionalParameter("status", status?.ToString()) .AddOptionalParameter("wandb_project", wandbProject) .AddOptionalParameter("wandb_name", wandbName) - .AddOptionalParameter("suffix", suffix) + .AddOptionalParameter("suffix", suffix) ; var __path = __pathBuilder.ToString(); __path = global::Mistral.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -227,6 +282,8 @@ partial void ProcessGetFineTuningJobsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -237,6 +294,11 @@ partial void ProcessGetFineTuningJobsResponseContent( } 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, @@ -254,6 +316,8 @@ partial void ProcessGetFineTuningJobsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -263,8 +327,7 @@ partial void ProcessGetFineTuningJobsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -273,6 +336,11 @@ partial void ProcessGetFineTuningJobsResponseContent( __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( @@ -289,14 +357,15 @@ partial void ProcessGetFineTuningJobsResponseContent( 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; } @@ -336,6 +405,8 @@ partial void ProcessGetFineTuningJobsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -356,6 +427,8 @@ partial void ProcessGetFineTuningJobsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -380,9 +453,13 @@ partial void ProcessGetFineTuningJobsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.JobsOut.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.JobsOut.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) { @@ -410,9 +487,13 @@ partial void ProcessGetFineTuningJobsResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.JobsOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.JobsOut.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.DeprecatedFineTuningClient.StartFineTuningJob.g.cs b/src/libs/Mistral/Generated/Mistral.DeprecatedFineTuningClient.StartFineTuningJob.g.cs index 03c5dba5..24c88fdb 100644 --- a/src/libs/Mistral/Generated/Mistral.DeprecatedFineTuningClient.StartFineTuningJob.g.cs +++ b/src/libs/Mistral/Generated/Mistral.DeprecatedFineTuningClient.StartFineTuningJob.g.cs @@ -53,6 +53,27 @@ partial void ProcessStartFineTuningJobResponseContent( global::System.Guid jobId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await StartFineTuningJobAsResponseAsync( + jobId: jobId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Start Fine Tuning Job
+ /// Request the start of a validated fine tuning 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> StartFineTuningJobAsResponseAsync( + global::System.Guid jobId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -82,6 +103,7 @@ partial void ProcessStartFineTuningJobResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/fine_tuning/jobs/{jobId}/start", baseUri: HttpClient.BaseAddress); @@ -155,6 +177,8 @@ partial void ProcessStartFineTuningJobResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -165,6 +189,11 @@ partial void ProcessStartFineTuningJobResponseContent( } 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 ProcessStartFineTuningJobResponseContent( 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 ProcessStartFineTuningJobResponseContent( __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 ProcessStartFineTuningJobResponseContent( __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 ProcessStartFineTuningJobResponseContent( 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 ProcessStartFineTuningJobResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -284,6 +322,8 @@ partial void ProcessStartFineTuningJobResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -308,9 +348,13 @@ partial void ProcessStartFineTuningJobResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.JobsApiRoutesFineTuningStartFineTuningJobResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.JobsApiRoutesFineTuningStartFineTuningJobResponse.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 ProcessStartFineTuningJobResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.JobsApiRoutesFineTuningStartFineTuningJobResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.JobsApiRoutesFineTuningStartFineTuningJobResponse.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.DeprecatedFineTuningClient.g.cs b/src/libs/Mistral/Generated/Mistral.DeprecatedFineTuningClient.g.cs index 3e41fbfa..b4e5aa4d 100644 --- a/src/libs/Mistral/Generated/Mistral.DeprecatedFineTuningClient.g.cs +++ b/src/libs/Mistral/Generated/Mistral.DeprecatedFineTuningClient.g.cs @@ -73,10 +73,10 @@ public DeprecatedFineTuningClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public DeprecatedFineTuningClient( - 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.EmbeddingsClient.Embeddings.g.cs b/src/libs/Mistral/Generated/Mistral.EmbeddingsClient.Embeddings.g.cs index 2d8c250c..236de7b9 100644 --- a/src/libs/Mistral/Generated/Mistral.EmbeddingsClient.Embeddings.g.cs +++ b/src/libs/Mistral/Generated/Mistral.EmbeddingsClient.Embeddings.g.cs @@ -51,6 +51,29 @@ partial void ProcessEmbeddingsResponseContent( /// public async global::System.Threading.Tasks.Task EmbeddingsAsync( + global::Mistral.EmbeddingRequest request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await EmbeddingsAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Embeddings
+ /// Embeddings + ///
+ /// + /// 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> EmbeddingsAsResponseAsync( + global::Mistral.EmbeddingRequest request, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -85,6 +108,7 @@ partial void ProcessEmbeddingsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: "/v1/embeddings", baseUri: HttpClient.BaseAddress); @@ -164,6 +188,8 @@ partial void ProcessEmbeddingsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -174,6 +200,11 @@ partial void ProcessEmbeddingsResponseContent( } 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 ProcessEmbeddingsResponseContent( 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 ProcessEmbeddingsResponseContent( __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 ProcessEmbeddingsResponseContent( __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 ProcessEmbeddingsResponseContent( 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 ProcessEmbeddingsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -293,6 +333,8 @@ partial void ProcessEmbeddingsResponseContent( 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 ProcessEmbeddingsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.EmbeddingResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.EmbeddingResponse.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 ProcessEmbeddingsResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.EmbeddingResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.EmbeddingResponse.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.EmbeddingsClient.g.cs b/src/libs/Mistral/Generated/Mistral.EmbeddingsClient.g.cs index 20f42746..32933a48 100644 --- a/src/libs/Mistral/Generated/Mistral.EmbeddingsClient.g.cs +++ b/src/libs/Mistral/Generated/Mistral.EmbeddingsClient.g.cs @@ -73,10 +73,10 @@ public EmbeddingsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public EmbeddingsClient( - 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.FilesClient.DeleteFile.g.cs b/src/libs/Mistral/Generated/Mistral.FilesClient.DeleteFile.g.cs index 1c2406b6..dccf6ebb 100644 --- a/src/libs/Mistral/Generated/Mistral.FilesClient.DeleteFile.g.cs +++ b/src/libs/Mistral/Generated/Mistral.FilesClient.DeleteFile.g.cs @@ -53,6 +53,27 @@ partial void ProcessDeleteFileResponseContent( global::System.Guid fileId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteFileAsResponseAsync( + fileId: fileId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete File
+ /// Delete a file. + ///
+ /// + /// 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> DeleteFileAsResponseAsync( + global::System.Guid fileId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -82,6 +103,7 @@ partial void ProcessDeleteFileResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/files/{fileId}", baseUri: HttpClient.BaseAddress); @@ -155,6 +177,8 @@ partial void ProcessDeleteFileResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -165,6 +189,11 @@ partial void ProcessDeleteFileResponseContent( } 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 ProcessDeleteFileResponseContent( 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 ProcessDeleteFileResponseContent( __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 ProcessDeleteFileResponseContent( __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 ProcessDeleteFileResponseContent( 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 ProcessDeleteFileResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -284,6 +322,8 @@ partial void ProcessDeleteFileResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -308,9 +348,13 @@ partial void ProcessDeleteFileResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.DeleteFileOut.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.DeleteFileOut.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 ProcessDeleteFileResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.DeleteFileOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.DeleteFileOut.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.FilesClient.DownloadFile.g.cs b/src/libs/Mistral/Generated/Mistral.FilesClient.DownloadFile.g.cs index 0ef99850..74f594bc 100644 --- a/src/libs/Mistral/Generated/Mistral.FilesClient.DownloadFile.g.cs +++ b/src/libs/Mistral/Generated/Mistral.FilesClient.DownloadFile.g.cs @@ -53,6 +53,27 @@ partial void ProcessDownloadFileResponseContent( global::System.Guid fileId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DownloadFileAsResponseAsync( + fileId: fileId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Download File
+ /// Download a file + ///
+ /// + /// 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 DownloadFileAsStreamAsync( + global::System.Guid fileId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -82,6 +103,7 @@ partial void ProcessDownloadFileResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/files/{fileId}/content", baseUri: HttpClient.BaseAddress); @@ -155,16 +177,23 @@ partial void ProcessDownloadFileResponseContent( 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, + 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, @@ -182,6 +211,8 @@ partial void ProcessDownloadFileResponseContent( 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 ProcessDownloadFileResponseContent( __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 ProcessDownloadFileResponseContent( __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,332 @@ partial void ProcessDownloadFileResponseContent( 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."); + } + + try + { + + ProcessResponse( + client: HttpClient, + response: __response); + ProcessDownloadFileResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "DownloadFile", + methodName: "DownloadFileAsync", + pathTemplate: "$\"/v1/files/{fileId}/content\"", + httpMethod: "GET", + 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: "DownloadFile", + methodName: "DownloadFileAsync", + pathTemplate: "$\"/v1/files/{fileId}/content\"", + httpMethod: "GET", + 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(); + + var __content = await __response.Content.ReadAsStreamAsync( + #if NET5_0_OR_GREATER + __effectiveCancellationToken + #endif + ).ConfigureAwait(false); + + return new global::Mistral.ResponseStream(__response, __content); + } + 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), + }; + } + + } + catch + { + __response.Dispose(); + throw; + } + } + finally + { + __httpRequest?.Dispose(); + } + } + /// + /// Download File
+ /// Download a file + ///
+ /// + /// 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> DownloadFileAsResponseAsync( + global::System.Guid fileId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + PrepareArguments( + client: HttpClient); + PrepareDownloadFileArguments( + httpClient: HttpClient, + fileId: ref fileId); + + + var __authorizations = global::Mistral.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_DownloadFileSecurityRequirements, + operationName: "DownloadFileAsync"); + + 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: true); + + global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() + { + + var __pathBuilder = new global::Mistral.PathBuilder( + path: $"/v1/files/{fileId}/content", + 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.Get, + 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); + } + } + global::Mistral.AutoSDKRequestOptionsSupport.ApplyHeaders( + request: __httpRequest, + clientHeaders: Options.Headers, + requestHeaders: requestOptions?.Headers); + + PrepareRequest( + client: HttpClient, + request: __httpRequest); + PrepareDownloadFileRequest( + httpClient: HttpClient, + httpRequestMessage: __httpRequest, + fileId: fileId!); + + 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: "DownloadFile", + methodName: "DownloadFileAsync", + pathTemplate: "$\"/v1/files/{fileId}/content\"", + httpMethod: "GET", + 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: "DownloadFile", + methodName: "DownloadFileAsync", + pathTemplate: "$\"/v1/files/{fileId}/content\"", + httpMethod: "GET", + 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: "DownloadFile", + methodName: "DownloadFileAsync", + pathTemplate: "$\"/v1/files/{fileId}/content\"", + httpMethod: "GET", + 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; } @@ -264,6 +617,8 @@ partial void ProcessDownloadFileResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -284,6 +639,8 @@ partial void ProcessDownloadFileResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -304,7 +661,11 @@ partial void ProcessDownloadFileResponseContent( { __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) { @@ -331,7 +692,11 @@ partial void ProcessDownloadFileResponseContent( #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.FilesClient.GetSignedUrl.g.cs b/src/libs/Mistral/Generated/Mistral.FilesClient.GetSignedUrl.g.cs index fc00a10e..769f2f44 100644 --- a/src/libs/Mistral/Generated/Mistral.FilesClient.GetSignedUrl.g.cs +++ b/src/libs/Mistral/Generated/Mistral.FilesClient.GetSignedUrl.g.cs @@ -59,6 +59,32 @@ partial void ProcessGetSignedUrlResponseContent( int? expiry = default, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await GetSignedUrlAsResponseAsync( + fileId: fileId, + expiry: expiry, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Get Signed Url + /// + /// + /// + /// Number of hours before the url becomes invalid. Defaults to 24h
+ /// Default Value: 24 + /// + /// 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> GetSignedUrlAsResponseAsync( + global::System.Guid fileId, + int? expiry = default, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -89,11 +115,12 @@ partial void ProcessGetSignedUrlResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/files/{fileId}/url", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder - .AddOptionalParameter("expiry", expiry?.ToString()) + .AddOptionalParameter("expiry", expiry?.ToString()) ; var __path = __pathBuilder.ToString(); __path = global::Mistral.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -166,6 +193,8 @@ partial void ProcessGetSignedUrlResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -176,6 +205,11 @@ partial void ProcessGetSignedUrlResponseContent( } 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 ProcessGetSignedUrlResponseContent( 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 ProcessGetSignedUrlResponseContent( __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 ProcessGetSignedUrlResponseContent( __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 ProcessGetSignedUrlResponseContent( 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 ProcessGetSignedUrlResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -295,6 +338,8 @@ partial void ProcessGetSignedUrlResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -319,9 +364,13 @@ partial void ProcessGetSignedUrlResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.FileSignedURL.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.FileSignedURL.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 ProcessGetSignedUrlResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.FileSignedURL.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.FileSignedURL.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.FilesClient.ListFiles.g.cs b/src/libs/Mistral/Generated/Mistral.FilesClient.ListFiles.g.cs index 42879f30..5389a47b 100644 --- a/src/libs/Mistral/Generated/Mistral.FilesClient.ListFiles.g.cs +++ b/src/libs/Mistral/Generated/Mistral.FilesClient.ListFiles.g.cs @@ -87,6 +87,54 @@ partial void ProcessListFilesResponseContent( global::System.Collections.Generic.IList? mimetypes = default, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListFilesAsResponseAsync( + page: page, + pageSize: pageSize, + includeTotal: includeTotal, + sampleType: sampleType, + source: source, + search: search, + purpose: purpose, + mimetypes: mimetypes, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Files
+ /// Returns a list of files that belong to the user's organization. + ///
+ /// + /// Default Value: 0 + /// + /// + /// Default Value: 100 + /// + /// + /// Default Value: true + /// + /// + /// + /// + /// + /// + /// 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> ListFilesAsResponseAsync( + int? page = default, + int? pageSize = default, + bool? includeTotal = default, + global::System.Collections.Generic.IList? sampleType = default, + global::System.Collections.Generic.IList? source = default, + string? search = default, + global::Mistral.FilePurpose? purpose = default, + global::System.Collections.Generic.IList? mimetypes = default, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -123,9 +171,10 @@ partial void ProcessListFilesResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: "/v1/files", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("page", page?.ToString()) .AddOptionalParameter("page_size", pageSize?.ToString()) @@ -134,7 +183,7 @@ partial void ProcessListFilesResponseContent( .AddOptionalParameter("source", source?.ToString()) .AddOptionalParameter("search", search) .AddOptionalParameter("purpose", purpose?.ToString()) - .AddOptionalParameter("mimetypes", mimetypes?.ToString()) + .AddOptionalParameter("mimetypes", mimetypes?.ToString()) ; var __path = __pathBuilder.ToString(); __path = global::Mistral.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -213,6 +262,8 @@ partial void ProcessListFilesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -223,6 +274,11 @@ partial void ProcessListFilesResponseContent( } 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, @@ -240,6 +296,8 @@ partial void ProcessListFilesResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -249,8 +307,7 @@ partial void ProcessListFilesResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -259,6 +316,11 @@ partial void ProcessListFilesResponseContent( __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( @@ -275,14 +337,15 @@ partial void ProcessListFilesResponseContent( 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; } @@ -322,6 +385,8 @@ partial void ProcessListFilesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -342,6 +407,8 @@ partial void ProcessListFilesResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -366,9 +433,13 @@ partial void ProcessListFilesResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.ListFilesOut.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.ListFilesOut.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) { @@ -396,9 +467,13 @@ partial void ProcessListFilesResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.ListFilesOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.ListFilesOut.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.FilesClient.RetrieveFile.g.cs b/src/libs/Mistral/Generated/Mistral.FilesClient.RetrieveFile.g.cs index 1277ed48..bfddfd90 100644 --- a/src/libs/Mistral/Generated/Mistral.FilesClient.RetrieveFile.g.cs +++ b/src/libs/Mistral/Generated/Mistral.FilesClient.RetrieveFile.g.cs @@ -53,6 +53,27 @@ partial void ProcessRetrieveFileResponseContent( global::System.Guid fileId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RetrieveFileAsResponseAsync( + fileId: fileId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Retrieve File
+ /// Returns information about a specific file. + ///
+ /// + /// 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> RetrieveFileAsResponseAsync( + global::System.Guid fileId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -82,6 +103,7 @@ partial void ProcessRetrieveFileResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/files/{fileId}", baseUri: HttpClient.BaseAddress); @@ -155,6 +177,8 @@ partial void ProcessRetrieveFileResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -165,6 +189,11 @@ partial void ProcessRetrieveFileResponseContent( } 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 ProcessRetrieveFileResponseContent( 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 ProcessRetrieveFileResponseContent( __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 ProcessRetrieveFileResponseContent( __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 ProcessRetrieveFileResponseContent( 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 ProcessRetrieveFileResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -284,6 +322,8 @@ partial void ProcessRetrieveFileResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -308,9 +348,13 @@ partial void ProcessRetrieveFileResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.RetrieveFileOut.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.RetrieveFileOut.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 ProcessRetrieveFileResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.RetrieveFileOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.RetrieveFileOut.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.FilesClient.UploadFile.g.cs b/src/libs/Mistral/Generated/Mistral.FilesClient.UploadFile.g.cs index 9e03835f..ceb8a02d 100644 --- a/src/libs/Mistral/Generated/Mistral.FilesClient.UploadFile.g.cs +++ b/src/libs/Mistral/Generated/Mistral.FilesClient.UploadFile.g.cs @@ -53,6 +53,31 @@ partial void ProcessUploadFileResponseContent( /// public async global::System.Threading.Tasks.Task UploadFileAsync( + global::Mistral.FilesApiRoutesUploadFileRequest request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UploadFileAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Upload File
+ /// Upload a file that can be used across various endpoints.
+ /// The size of individual files can be a maximum of 512 MB. The Fine-tuning API only supports .jsonl files.
+ /// Please contact us if you need to increase these storage limits. + ///
+ /// + /// 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> UploadFileAsResponseAsync( + global::Mistral.FilesApiRoutesUploadFileRequest request, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -83,10 +108,11 @@ partial void ProcessUploadFileResponseContent( 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/files", baseUri: HttpClient.BaseAddress); @@ -119,6 +145,7 @@ partial void ProcessUploadFileResponseContent( __httpRequest.Headers.Add(__authorization.Name, __authorization.Value); } } + var __httpRequestContent = new global::System.Net.Http.MultipartFormDataContent(); if (request.Expiry != default) { @@ -126,20 +153,23 @@ partial void ProcessUploadFileResponseContent( __httpRequestContent.Add( content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Expiry, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), name: "\"expiry\""); - } + + } if (request.Visibility != default) { __httpRequestContent.Add( content: new global::System.Net.Http.StringContent((request.Visibility).HasValue ? (request.Visibility).GetValueOrDefault().ToValueString() : string.Empty), name: "\"visibility\""); - } + + } if (request.Purpose != default) { __httpRequestContent.Add( content: new global::System.Net.Http.StringContent((request.Purpose).HasValue ? (request.Purpose).GetValueOrDefault().ToValueString() : string.Empty), name: "\"purpose\""); + } var __contentFile = new global::System.Net.Http.ByteArrayContent(request.File ?? global::System.Array.Empty()); __contentFile.Headers.ContentType = new global::System.Net.Http.Headers.MediaTypeHeaderValue( @@ -178,7 +208,9 @@ request.Filename is null { __contentFile.Headers.ContentDisposition.FileNameStar = null; } + __httpRequest.Content = __httpRequestContent; + global::Mistral.AutoSDKRequestOptionsSupport.ApplyHeaders( request: __httpRequest, clientHeaders: Options.Headers, @@ -220,6 +252,8 @@ request.Filename is null attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -230,6 +264,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, @@ -247,6 +286,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) { @@ -256,8 +297,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; } @@ -266,6 +306,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( @@ -282,14 +327,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; } @@ -329,6 +375,8 @@ request.Filename is null attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -349,6 +397,8 @@ request.Filename is null attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -373,9 +423,13 @@ request.Filename is null { __response.EnsureSuccessStatusCode(); - return - global::Mistral.UploadFileOut.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.UploadFileOut.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) { @@ -403,9 +457,13 @@ request.Filename is null #endif ).ConfigureAwait(false); - return - await global::Mistral.UploadFileOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.UploadFileOut.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) { @@ -502,5 +560,942 @@ request.Filename is null requestOptions: requestOptions, cancellationToken: cancellationToken).ConfigureAwait(false); } + + /// + /// Upload File
+ /// Upload a file that can be used across various endpoints.
+ /// The size of individual files can be a maximum of 512 MB. The Fine-tuning API only supports .jsonl files.
+ /// Please contact us if you need to increase these storage limits. + ///
+ /// + /// + /// Default Value: workspace + /// + /// + /// + /// 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 UploadFileAsync( + global::System.IO.Stream file, + string filename, + int? expiry = default, + global::Mistral.FilesApiRoutesUploadFileRequestVisibility? visibility = default, + global::Mistral.FilePurpose? purpose = default, + 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.FilesApiRoutesUploadFileRequest + { + Expiry = expiry, + Visibility = visibility, + Purpose = purpose, + File = global::System.Array.Empty(), + Filename = filename, + }; + PrepareArguments( + client: HttpClient); + PrepareUploadFileArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::Mistral.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_UploadFileSecurityRequirements, + operationName: "UploadFileAsync"); + + 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/files", + 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(); + if (request.Expiry != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Expiry, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"expiry\""); + + } + if (request.Visibility != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Visibility).HasValue ? (request.Visibility).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"visibility\""); + + } + if (request.Purpose != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Purpose).HasValue ? (request.Purpose).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"purpose\""); + + } + 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); + PrepareUploadFileRequest( + 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: "UploadFile", + methodName: "UploadFileAsync", + pathTemplate: "\"/v1/files\"", + 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: "UploadFile", + methodName: "UploadFileAsync", + pathTemplate: "\"/v1/files\"", + 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: "UploadFile", + methodName: "UploadFileAsync", + pathTemplate: "\"/v1/files\"", + 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); + ProcessUploadFileResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadFile", + methodName: "UploadFileAsync", + pathTemplate: "\"/v1/files\"", + 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: "UploadFile", + methodName: "UploadFileAsync", + pathTemplate: "\"/v1/files\"", + 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); + ProcessUploadFileResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + return + global::Mistral.UploadFileOut.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.UploadFileOut.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 File
+ /// Upload a file that can be used across various endpoints.
+ /// The size of individual files can be a maximum of 512 MB. The Fine-tuning API only supports .jsonl files.
+ /// Please contact us if you need to increase these storage limits. + ///
+ /// + /// + /// Default Value: workspace + /// + /// + /// + /// 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> UploadFileAsResponseAsync( + global::System.IO.Stream file, + string filename, + int? expiry = default, + global::Mistral.FilesApiRoutesUploadFileRequestVisibility? visibility = default, + global::Mistral.FilePurpose? purpose = default, + 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.FilesApiRoutesUploadFileRequest + { + Expiry = expiry, + Visibility = visibility, + Purpose = purpose, + File = global::System.Array.Empty(), + Filename = filename, + }; + PrepareArguments( + client: HttpClient); + PrepareUploadFileArguments( + httpClient: HttpClient, + request: request); + + + var __authorizations = global::Mistral.EndPointSecurityResolver.ResolveAuthorizations( + availableAuthorizations: Authorizations, + securityRequirements: s_UploadFileSecurityRequirements, + operationName: "UploadFileAsync"); + + 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/files", + 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(); + if (request.Expiry != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent(global::System.Convert.ToString(request.Expiry, global::System.Globalization.CultureInfo.InvariantCulture) ?? string.Empty), + name: "\"expiry\""); + + } + if (request.Visibility != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Visibility).HasValue ? (request.Visibility).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"visibility\""); + + } + if (request.Purpose != default) + { + + __httpRequestContent.Add( + content: new global::System.Net.Http.StringContent((request.Purpose).HasValue ? (request.Purpose).GetValueOrDefault().ToValueString() : string.Empty), + name: "\"purpose\""); + + } + 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); + PrepareUploadFileRequest( + 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: "UploadFile", + methodName: "UploadFileAsync", + pathTemplate: "\"/v1/files\"", + 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: "UploadFile", + methodName: "UploadFileAsync", + pathTemplate: "\"/v1/files\"", + 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: "UploadFile", + methodName: "UploadFileAsync", + pathTemplate: "\"/v1/files\"", + 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); + ProcessUploadFileResponse( + httpClient: HttpClient, + httpResponseMessage: __response); + if (__response.IsSuccessStatusCode) + { + await global::Mistral.AutoSDKRequestOptionsSupport.OnAfterSuccessAsync( + clientOptions: Options, + context: global::Mistral.AutoSDKRequestOptionsSupport.CreateHookContext( + operationId: "UploadFile", + methodName: "UploadFileAsync", + pathTemplate: "\"/v1/files\"", + 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: "UploadFile", + methodName: "UploadFileAsync", + pathTemplate: "\"/v1/files\"", + 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); + ProcessUploadFileResponseContent( + httpClient: HttpClient, + httpResponseMessage: __response, + content: ref __content); + + try + { + __response.EnsureSuccessStatusCode(); + + var __value = global::Mistral.UploadFileOut.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.UploadFileOut.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.FilesClient.g.cs b/src/libs/Mistral/Generated/Mistral.FilesClient.g.cs index 4c3753a1..af07ef6a 100644 --- a/src/libs/Mistral/Generated/Mistral.FilesClient.g.cs +++ b/src/libs/Mistral/Generated/Mistral.FilesClient.g.cs @@ -73,10 +73,10 @@ public FilesClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public FilesClient( - 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.FimClient.FimCompletion.g.cs b/src/libs/Mistral/Generated/Mistral.FimClient.FimCompletion.g.cs index e4425a1d..23b1b382 100644 --- a/src/libs/Mistral/Generated/Mistral.FimClient.FimCompletion.g.cs +++ b/src/libs/Mistral/Generated/Mistral.FimClient.FimCompletion.g.cs @@ -51,6 +51,29 @@ partial void ProcessFimCompletionResponseContent( /// public async global::System.Threading.Tasks.Task FimCompletionAsync( + global::Mistral.FIMCompletionRequest request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await FimCompletionAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Fim Completion
+ /// FIM completion. + ///
+ /// + /// 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> FimCompletionAsResponseAsync( + global::Mistral.FIMCompletionRequest request, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -95,10 +118,11 @@ partial void ProcessFimCompletionResponseContent( 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/fim/completions", baseUri: HttpClient.BaseAddress); @@ -178,6 +202,8 @@ partial void ProcessFimCompletionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -188,6 +214,11 @@ partial void ProcessFimCompletionResponseContent( } 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, @@ -205,6 +236,8 @@ partial void ProcessFimCompletionResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -214,8 +247,7 @@ partial void ProcessFimCompletionResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -224,6 +256,11 @@ partial void ProcessFimCompletionResponseContent( __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( @@ -240,14 +277,15 @@ partial void ProcessFimCompletionResponseContent( 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; } @@ -287,6 +325,8 @@ partial void ProcessFimCompletionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -307,6 +347,8 @@ partial void ProcessFimCompletionResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -369,9 +411,13 @@ partial void ProcessFimCompletionResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.FIMCompletionResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.FIMCompletionResponse.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) { @@ -399,9 +445,13 @@ partial void ProcessFimCompletionResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.FIMCompletionResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.FIMCompletionResponse.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.FimClient.FimCompletionAsStream.g.cs b/src/libs/Mistral/Generated/Mistral.FimClient.FimCompletionAsStream.g.cs index a641c069..aa0d1337 100644 --- a/src/libs/Mistral/Generated/Mistral.FimClient.FimCompletionAsStream.g.cs +++ b/src/libs/Mistral/Generated/Mistral.FimClient.FimCompletionAsStream.g.cs @@ -90,10 +90,11 @@ partial void ProcessFimCompletionAsStreamResponse( 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/fim/completions", baseUri: HttpClient.BaseAddress); @@ -173,6 +174,8 @@ partial void ProcessFimCompletionAsStreamResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -183,6 +186,11 @@ partial void ProcessFimCompletionAsStreamResponse( } 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 +208,8 @@ partial void ProcessFimCompletionAsStreamResponse( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -209,8 +219,7 @@ partial void ProcessFimCompletionAsStreamResponse( __httpRequest.Dispose(); __httpRequest = null; await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -219,6 +228,11 @@ partial void ProcessFimCompletionAsStreamResponse( __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 +249,15 @@ partial void ProcessFimCompletionAsStreamResponse( 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 +297,8 @@ partial void ProcessFimCompletionAsStreamResponse( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -302,6 +319,8 @@ partial void ProcessFimCompletionAsStreamResponse( 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.FimClient.g.cs b/src/libs/Mistral/Generated/Mistral.FimClient.g.cs index a4a08f8f..47dc3b9f 100644 --- a/src/libs/Mistral/Generated/Mistral.FimClient.g.cs +++ b/src/libs/Mistral/Generated/Mistral.FimClient.g.cs @@ -73,10 +73,10 @@ public FimClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public FimClient( - 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.IAudioSpeechClient.Speech.g.cs b/src/libs/Mistral/Generated/Mistral.IAudioSpeechClient.Speech.g.cs index 578b55a1..517a1383 100644 --- a/src/libs/Mistral/Generated/Mistral.IAudioSpeechClient.Speech.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IAudioSpeechClient.Speech.g.cs @@ -21,6 +21,19 @@ public partial interface IAudioSpeechClient /// 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 + /// + global::System.Threading.Tasks.Task> SpeechAsResponseAsync( + + global::Mistral.SpeechRequest request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Speech
+ /// Generate speech from text using a saved voice or a reference audio clip. + ///
/// /// /// The preset or custom voice to use for generating the speech. diff --git a/src/libs/Mistral/Generated/Mistral.IAudioTranscriptionsClient.CreateStreamingTranscriptionSse.g.cs b/src/libs/Mistral/Generated/Mistral.IAudioTranscriptionsClient.CreateStreamingTranscriptionSse.g.cs index ab20e776..82506c6a 100644 --- a/src/libs/Mistral/Generated/Mistral.IAudioTranscriptionsClient.CreateStreamingTranscriptionSse.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IAudioTranscriptionsClient.CreateStreamingTranscriptionSse.g.cs @@ -70,5 +70,60 @@ public partial interface IAudioTranscriptionsClient global::System.Collections.Generic.IList? timestampGranularities = default, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// 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 + /// + 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.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IAudioTranscriptionsClient.CreateTranscription.g.cs b/src/libs/Mistral/Generated/Mistral.IAudioTranscriptionsClient.CreateTranscription.g.cs index b1a7ea2d..2eb872d8 100644 --- a/src/libs/Mistral/Generated/Mistral.IAudioTranscriptionsClient.CreateTranscription.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IAudioTranscriptionsClient.CreateTranscription.g.cs @@ -19,6 +19,18 @@ public partial interface IAudioTranscriptionsClient /// /// Create Transcription /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateTranscriptionAsResponseAsync( + + global::Mistral.AudioTranscriptionRequest request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Transcription + /// /// /// ID of the model to be used. /// @@ -72,5 +84,118 @@ public partial interface IAudioTranscriptionsClient global::System.Collections.Generic.IList? timestampGranularities = default, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// 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 + /// + 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); + /// + /// 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 + /// + 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); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IAudioVoicesClient.CreateANewVoice.g.cs b/src/libs/Mistral/Generated/Mistral.IAudioVoicesClient.CreateANewVoice.g.cs index ac98be02..f93cfdda 100644 --- a/src/libs/Mistral/Generated/Mistral.IAudioVoicesClient.CreateANewVoice.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IAudioVoicesClient.CreateANewVoice.g.cs @@ -21,6 +21,19 @@ public partial interface IAudioVoicesClient /// 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 + /// + global::System.Threading.Tasks.Task> CreateANewVoiceAsResponseAsync( + + global::Mistral.VoiceCreateRequest request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create a new voice
+ /// Create a new voice with a base64-encoded audio sample + ///
/// /// /// diff --git a/src/libs/Mistral/Generated/Mistral.IAudioVoicesClient.DeleteACustomVoice.g.cs b/src/libs/Mistral/Generated/Mistral.IAudioVoicesClient.DeleteACustomVoice.g.cs index 703a7da5..6ccf659f 100644 --- a/src/libs/Mistral/Generated/Mistral.IAudioVoicesClient.DeleteACustomVoice.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IAudioVoicesClient.DeleteACustomVoice.g.cs @@ -16,5 +16,17 @@ public partial interface IAudioVoicesClient global::System.Guid voiceId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// 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 + /// + global::System.Threading.Tasks.Task> DeleteACustomVoiceAsResponseAsync( + global::System.Guid voiceId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IAudioVoicesClient.GetVoiceDetails.g.cs b/src/libs/Mistral/Generated/Mistral.IAudioVoicesClient.GetVoiceDetails.g.cs index 8ef519e8..efb2c6f6 100644 --- a/src/libs/Mistral/Generated/Mistral.IAudioVoicesClient.GetVoiceDetails.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IAudioVoicesClient.GetVoiceDetails.g.cs @@ -16,5 +16,17 @@ public partial interface IAudioVoicesClient string voiceId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// 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 + /// + global::System.Threading.Tasks.Task> GetVoiceDetailsAsResponseAsync( + string voiceId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IAudioVoicesClient.GetVoiceSampleAudio.g.cs b/src/libs/Mistral/Generated/Mistral.IAudioVoicesClient.GetVoiceSampleAudio.g.cs index 25adcf3b..6ed4674f 100644 --- a/src/libs/Mistral/Generated/Mistral.IAudioVoicesClient.GetVoiceSampleAudio.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IAudioVoicesClient.GetVoiceSampleAudio.g.cs @@ -16,5 +16,17 @@ public partial interface IAudioVoicesClient string voiceId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// 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 + /// + global::System.Threading.Tasks.Task> GetVoiceSampleAudioAsResponseAsync( + string voiceId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IAudioVoicesClient.ListAllVoices.g.cs b/src/libs/Mistral/Generated/Mistral.IAudioVoicesClient.ListAllVoices.g.cs index 20be4507..85559b46 100644 --- a/src/libs/Mistral/Generated/Mistral.IAudioVoicesClient.ListAllVoices.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IAudioVoicesClient.ListAllVoices.g.cs @@ -24,5 +24,25 @@ public partial interface IAudioVoicesClient int? offset = default, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// 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 + /// + global::System.Threading.Tasks.Task> ListAllVoicesAsResponseAsync( + int? limit = default, + int? offset = default, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IAudioVoicesClient.UpdateVoiceMetadata.g.cs b/src/libs/Mistral/Generated/Mistral.IAudioVoicesClient.UpdateVoiceMetadata.g.cs index 4c74811e..62e1ec6a 100644 --- a/src/libs/Mistral/Generated/Mistral.IAudioVoicesClient.UpdateVoiceMetadata.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IAudioVoicesClient.UpdateVoiceMetadata.g.cs @@ -24,6 +24,21 @@ public partial interface IAudioVoicesClient /// 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 + /// + 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); + /// + /// Update voice metadata
+ /// Update voice metadata (name, gender, languages, age, tags). + ///
+ /// /// /// /// diff --git a/src/libs/Mistral/Generated/Mistral.IBatchClient.CancelBatchJob.g.cs b/src/libs/Mistral/Generated/Mistral.IBatchClient.CancelBatchJob.g.cs index d8714355..85883c14 100644 --- a/src/libs/Mistral/Generated/Mistral.IBatchClient.CancelBatchJob.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBatchClient.CancelBatchJob.g.cs @@ -16,5 +16,17 @@ public partial interface IBatchClient global::System.Guid jobId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// 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 + /// + global::System.Threading.Tasks.Task> CancelBatchJobAsResponseAsync( + global::System.Guid jobId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBatchClient.CreateBatchJob.g.cs b/src/libs/Mistral/Generated/Mistral.IBatchClient.CreateBatchJob.g.cs index 49107430..6b65279c 100644 --- a/src/libs/Mistral/Generated/Mistral.IBatchClient.CreateBatchJob.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBatchClient.CreateBatchJob.g.cs @@ -21,6 +21,19 @@ public partial interface IBatchClient /// 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 + /// + global::System.Threading.Tasks.Task> CreateBatchJobAsResponseAsync( + + global::Mistral.BatchJobIn request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Batch Job
+ /// Create a new batch job, it will be queued for processing. + ///
/// /// The list of input files to be used for batch inference, these files should be `jsonl` files, containing the input data corresponding to the bory request for the batch inference in a "body" field. An example of such file is the following: ```json {"custom_id": "0", "body": {"max_tokens": 100, "messages": [{"role": "user", "content": "What is the best French cheese?"}]}} {"custom_id": "1", "body": {"max_tokens": 100, "messages": [{"role": "user", "content": "What is the best French wine?"}]}} ``` /// diff --git a/src/libs/Mistral/Generated/Mistral.IBatchClient.GetBatchJob.g.cs b/src/libs/Mistral/Generated/Mistral.IBatchClient.GetBatchJob.g.cs index 88da0627..f088c00e 100644 --- a/src/libs/Mistral/Generated/Mistral.IBatchClient.GetBatchJob.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBatchClient.GetBatchJob.g.cs @@ -20,5 +20,21 @@ public partial interface IBatchClient bool? inline = default, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// 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 + /// + global::System.Threading.Tasks.Task> GetBatchJobAsResponseAsync( + global::System.Guid jobId, + bool? inline = default, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBatchClient.GetBatchJobs.g.cs b/src/libs/Mistral/Generated/Mistral.IBatchClient.GetBatchJobs.g.cs index 253841a5..ab676497 100644 --- a/src/libs/Mistral/Generated/Mistral.IBatchClient.GetBatchJobs.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBatchClient.GetBatchJobs.g.cs @@ -40,5 +40,41 @@ public partial interface IBatchClient global::Mistral.JobsApiRoutesBatchGetBatchJobsOrderBy? orderBy = default, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// 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 + /// + 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); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaAgentsClient.CreateAAgentThatCanBeUsedWithinAConversation.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaAgentsClient.CreateAAgentThatCanBeUsedWithinAConversation.g.cs index 9c18eb98..76222b04 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaAgentsClient.CreateAAgentThatCanBeUsedWithinAConversation.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaAgentsClient.CreateAAgentThatCanBeUsedWithinAConversation.g.cs @@ -21,6 +21,19 @@ public partial interface IBetaAgentsClient /// 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 + /// + global::System.Threading.Tasks.Task> CreateAAgentThatCanBeUsedWithinAConversationAsResponseAsync( + + global::Mistral.AgentCreationRequest request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// 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. + ///
/// /// Instruction prompt the model will follow during the conversation. /// diff --git a/src/libs/Mistral/Generated/Mistral.IBetaAgentsClient.CreateOrUpdateAnAgentVersionAlias.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaAgentsClient.CreateOrUpdateAnAgentVersionAlias.g.cs index e977bd1f..e6ce34f6 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaAgentsClient.CreateOrUpdateAnAgentVersionAlias.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaAgentsClient.CreateOrUpdateAnAgentVersionAlias.g.cs @@ -20,5 +20,21 @@ public partial interface IBetaAgentsClient int version, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// 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 + /// + global::System.Threading.Tasks.Task> CreateOrUpdateAnAgentVersionAliasAsResponseAsync( + string agentId, + string alias, + int version, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaAgentsClient.DeleteAnAgentEntity.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaAgentsClient.DeleteAnAgentEntity.g.cs index 5af221e6..708a1070 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaAgentsClient.DeleteAnAgentEntity.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaAgentsClient.DeleteAnAgentEntity.g.cs @@ -15,5 +15,16 @@ public partial interface IBetaAgentsClient string agentId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete an agent entity. + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeleteAnAgentEntityAsResponseAsync( + string agentId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaAgentsClient.DeleteAnAgentVersionAlias.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaAgentsClient.DeleteAnAgentVersionAlias.g.cs index 26da6e41..d0c88ddb 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaAgentsClient.DeleteAnAgentVersionAlias.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaAgentsClient.DeleteAnAgentVersionAlias.g.cs @@ -18,5 +18,19 @@ public partial interface IBetaAgentsClient string alias, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// 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 + /// + global::System.Threading.Tasks.Task DeleteAnAgentVersionAliasAsResponseAsync( + string agentId, + string alias, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaAgentsClient.ListAgentEntities.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaAgentsClient.ListAgentEntities.g.cs index cd920133..1f920406 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaAgentsClient.ListAgentEntities.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaAgentsClient.ListAgentEntities.g.cs @@ -40,5 +40,41 @@ public partial interface IBetaAgentsClient object? metadata = default, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// 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 + /// + 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); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaAgentsClient.ListAllAliasesForAnAgent.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaAgentsClient.ListAllAliasesForAnAgent.g.cs index 7b681aac..4d14d532 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaAgentsClient.ListAllAliasesForAnAgent.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaAgentsClient.ListAllAliasesForAnAgent.g.cs @@ -16,5 +16,17 @@ public partial interface IBetaAgentsClient string agentId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// 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 + /// + global::System.Threading.Tasks.Task>> ListAllAliasesForAnAgentAsResponseAsync( + string agentId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaAgentsClient.ListAllVersionsOfAnAgent.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaAgentsClient.ListAllVersionsOfAnAgent.g.cs index 6762bfff..2df94a4a 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaAgentsClient.ListAllVersionsOfAnAgent.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaAgentsClient.ListAllVersionsOfAnAgent.g.cs @@ -26,5 +26,27 @@ public partial interface IBetaAgentsClient int? pageSize = default, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// 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 + /// + 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); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaAgentsClient.RetrieveASpecificVersionOfAnAgent.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaAgentsClient.RetrieveASpecificVersionOfAnAgent.g.cs index ee7c4784..a4a3c665 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaAgentsClient.RetrieveASpecificVersionOfAnAgent.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaAgentsClient.RetrieveASpecificVersionOfAnAgent.g.cs @@ -18,5 +18,19 @@ public partial interface IBetaAgentsClient string version, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// 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 + /// + global::System.Threading.Tasks.Task> RetrieveASpecificVersionOfAnAgentAsResponseAsync( + string agentId, + string version, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaAgentsClient.RetrieveAnAgentEntity.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaAgentsClient.RetrieveAnAgentEntity.g.cs index 18d016af..6d3a8c8b 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaAgentsClient.RetrieveAnAgentEntity.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaAgentsClient.RetrieveAnAgentEntity.g.cs @@ -18,5 +18,19 @@ public partial interface IBetaAgentsClient global::Mistral.AnyOf? agentVersion = default, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// 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 + /// + global::System.Threading.Tasks.Task> RetrieveAnAgentEntityAsResponseAsync( + string agentId, + global::Mistral.AnyOf? agentVersion = default, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaAgentsClient.UpdateAnAgentEntity.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaAgentsClient.UpdateAnAgentEntity.g.cs index 03d472b3..bbb556aa 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaAgentsClient.UpdateAnAgentEntity.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaAgentsClient.UpdateAnAgentEntity.g.cs @@ -24,6 +24,21 @@ public partial interface IBetaAgentsClient /// 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 + /// + global::System.Threading.Tasks.Task> UpdateAnAgentEntityAsResponseAsync( + string agentId, + + global::Mistral.AgentUpdateRequest request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update an agent entity.
+ /// Update an agent attributes and create a new version. + ///
+ /// /// /// Instruction prompt the model will follow during the conversation. /// diff --git a/src/libs/Mistral/Generated/Mistral.IBetaAgentsClient.UpdateAnAgentVersion.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaAgentsClient.UpdateAnAgentVersion.g.cs index 3c524fd9..af4a5884 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaAgentsClient.UpdateAnAgentVersion.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaAgentsClient.UpdateAnAgentVersion.g.cs @@ -18,5 +18,19 @@ public partial interface IBetaAgentsClient int version, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// 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 + /// + global::System.Threading.Tasks.Task> UpdateAnAgentVersionAsResponseAsync( + string agentId, + int version, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaConversationsClient.AppendNewEntriesToAnExistingConversation.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaConversationsClient.AppendNewEntriesToAnExistingConversation.g.cs index 721f0aba..f1b91b90 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaConversationsClient.AppendNewEntriesToAnExistingConversation.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaConversationsClient.AppendNewEntriesToAnExistingConversation.g.cs @@ -28,6 +28,23 @@ public partial interface IBetaConversationsClient /// /// 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 + /// + global::System.Threading.Tasks.Task> AppendNewEntriesToAnExistingConversationAsResponseAsync( + string conversationId, + + global::Mistral.ConversationAppendRequest request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// 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 /// diff --git a/src/libs/Mistral/Generated/Mistral.IBetaConversationsClient.CreateAConversationAndAppendEntriesToIt.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaConversationsClient.CreateAConversationAndAppendEntriesToIt.g.cs index 3d0884df..c255af53 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaConversationsClient.CreateAConversationAndAppendEntriesToIt.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaConversationsClient.CreateAConversationAndAppendEntriesToIt.g.cs @@ -21,6 +21,19 @@ public partial interface IBetaConversationsClient /// 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 + /// + global::System.Threading.Tasks.Task> CreateAConversationAndAppendEntriesToItAsResponseAsync( + + global::Mistral.ConversationRequest request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// 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 /// diff --git a/src/libs/Mistral/Generated/Mistral.IBetaConversationsClient.DeleteAConversation.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaConversationsClient.DeleteAConversation.g.cs index 2cb385c4..e671ef61 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaConversationsClient.DeleteAConversation.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaConversationsClient.DeleteAConversation.g.cs @@ -18,5 +18,19 @@ public partial interface IBetaConversationsClient string conversationId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// 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 + /// + global::System.Threading.Tasks.Task DeleteAConversationAsResponseAsync( + string conversationId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaConversationsClient.ListAllCreatedConversations.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaConversationsClient.ListAllCreatedConversations.g.cs index 55bd8176..ca4e1b03 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaConversationsClient.ListAllCreatedConversations.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaConversationsClient.ListAllCreatedConversations.g.cs @@ -24,5 +24,25 @@ public partial interface IBetaConversationsClient object? metadata = default, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// 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 + /// + 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); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaConversationsClient.RestartAConversationStartingFromAGivenEntry.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaConversationsClient.RestartAConversationStartingFromAGivenEntry.g.cs index 99457639..56b22512 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaConversationsClient.RestartAConversationStartingFromAGivenEntry.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaConversationsClient.RestartAConversationStartingFromAGivenEntry.g.cs @@ -28,6 +28,23 @@ public partial interface IBetaConversationsClient /// /// 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 + /// + global::System.Threading.Tasks.Task> RestartAConversationStartingFromAGivenEntryAsResponseAsync( + string conversationId, + + global::Mistral.ConversationRestartRequest request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// 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 /// diff --git a/src/libs/Mistral/Generated/Mistral.IBetaConversationsClient.RetrieveAConversationInformation.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaConversationsClient.RetrieveAConversationInformation.g.cs index abcc365b..fc6f4f55 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaConversationsClient.RetrieveAConversationInformation.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaConversationsClient.RetrieveAConversationInformation.g.cs @@ -18,5 +18,19 @@ public partial interface IBetaConversationsClient string conversationId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// 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 + /// + global::System.Threading.Tasks.Task>> RetrieveAConversationInformationAsResponseAsync( + string conversationId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaConversationsClient.RetrieveAllEntriesInAConversation.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaConversationsClient.RetrieveAllEntriesInAConversation.g.cs index 2b49f2d4..552a1f5f 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaConversationsClient.RetrieveAllEntriesInAConversation.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaConversationsClient.RetrieveAllEntriesInAConversation.g.cs @@ -18,5 +18,19 @@ public partial interface IBetaConversationsClient string conversationId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// 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 + /// + global::System.Threading.Tasks.Task> RetrieveAllEntriesInAConversationAsResponseAsync( + string conversationId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaConversationsClient.RetrieveAllMessagesInAConversation.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaConversationsClient.RetrieveAllMessagesInAConversation.g.cs index f08bc59f..2e61d0b5 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaConversationsClient.RetrieveAllMessagesInAConversation.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaConversationsClient.RetrieveAllMessagesInAConversation.g.cs @@ -18,5 +18,19 @@ public partial interface IBetaConversationsClient string conversationId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// 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 + /// + global::System.Threading.Tasks.Task> RetrieveAllMessagesInAConversationAsResponseAsync( + string conversationId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaLibrariesAccessesClient.CreateOrUpdateAnAccessLevel.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaLibrariesAccessesClient.CreateOrUpdateAnAccessLevel.g.cs index d4ec65c7..0f13d75f 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaLibrariesAccessesClient.CreateOrUpdateAnAccessLevel.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaLibrariesAccessesClient.CreateOrUpdateAnAccessLevel.g.cs @@ -24,6 +24,21 @@ public partial interface IBetaLibrariesAccessesClient /// 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 + /// + 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); + /// + /// 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. + ///
+ /// /// /// /// diff --git a/src/libs/Mistral/Generated/Mistral.IBetaLibrariesAccessesClient.DeleteAnAccessLevel.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaLibrariesAccessesClient.DeleteAnAccessLevel.g.cs index 6c5dc3e6..3c34b834 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaLibrariesAccessesClient.DeleteAnAccessLevel.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaLibrariesAccessesClient.DeleteAnAccessLevel.g.cs @@ -24,6 +24,21 @@ public partial interface IBetaLibrariesAccessesClient /// 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 + /// + 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); + /// + /// 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. + ///
+ /// /// /// /// The id of the entity (user, workspace or organization) to share with diff --git a/src/libs/Mistral/Generated/Mistral.IBetaLibrariesAccessesClient.ListAllOfTheAccessToThisLibrary.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaLibrariesAccessesClient.ListAllOfTheAccessToThisLibrary.g.cs index 90c3d6b7..19a3cb72 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaLibrariesAccessesClient.ListAllOfTheAccessToThisLibrary.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaLibrariesAccessesClient.ListAllOfTheAccessToThisLibrary.g.cs @@ -16,5 +16,17 @@ public partial interface IBetaLibrariesAccessesClient global::System.Guid libraryId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// 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 + /// + global::System.Threading.Tasks.Task> ListAllOfTheAccessToThisLibraryAsResponseAsync( + global::System.Guid libraryId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaLibrariesClient.CreateANewLibrary.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaLibrariesClient.CreateANewLibrary.g.cs index aa9f05f8..201dc71b 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaLibrariesClient.CreateANewLibrary.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaLibrariesClient.CreateANewLibrary.g.cs @@ -21,6 +21,19 @@ public partial interface IBetaLibrariesClient /// 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 + /// + global::System.Threading.Tasks.Task> CreateANewLibraryAsResponseAsync( + + global::Mistral.LibraryIn request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// 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. + ///
/// /// /// diff --git a/src/libs/Mistral/Generated/Mistral.IBetaLibrariesClient.DeleteALibraryAndAllOfItsDocument.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaLibrariesClient.DeleteALibraryAndAllOfItsDocument.g.cs index d0762745..4668d6ac 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaLibrariesClient.DeleteALibraryAndAllOfItsDocument.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaLibrariesClient.DeleteALibraryAndAllOfItsDocument.g.cs @@ -16,5 +16,17 @@ public partial interface IBetaLibrariesClient global::System.Guid libraryId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// 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 + /// + global::System.Threading.Tasks.Task> DeleteALibraryAndAllOfItsDocumentAsResponseAsync( + global::System.Guid libraryId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaLibrariesClient.DetailedInformationAboutASpecificLibrary.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaLibrariesClient.DetailedInformationAboutASpecificLibrary.g.cs index 921e7758..70a71a58 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaLibrariesClient.DetailedInformationAboutASpecificLibrary.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaLibrariesClient.DetailedInformationAboutASpecificLibrary.g.cs @@ -16,5 +16,17 @@ public partial interface IBetaLibrariesClient global::System.Guid libraryId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// 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 + /// + global::System.Threading.Tasks.Task> DetailedInformationAboutASpecificLibraryAsResponseAsync( + global::System.Guid libraryId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaLibrariesClient.ListAllLibrariesYouHaveAccessTo.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaLibrariesClient.ListAllLibrariesYouHaveAccessTo.g.cs index f7fd1706..c168c0b4 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaLibrariesClient.ListAllLibrariesYouHaveAccessTo.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaLibrariesClient.ListAllLibrariesYouHaveAccessTo.g.cs @@ -14,5 +14,15 @@ public partial interface IBetaLibrariesClient global::System.Threading.Tasks.Task ListAllLibrariesYouHaveAccessToAsync( global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// 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 + /// + global::System.Threading.Tasks.Task> ListAllLibrariesYouHaveAccessToAsResponseAsync( + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaLibrariesClient.UpdateALibrary.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaLibrariesClient.UpdateALibrary.g.cs index 05264195..0232a739 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaLibrariesClient.UpdateALibrary.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaLibrariesClient.UpdateALibrary.g.cs @@ -24,6 +24,21 @@ public partial interface IBetaLibrariesClient /// 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 + /// + 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); + /// + /// 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. diff --git a/src/libs/Mistral/Generated/Mistral.IBetaLibrariesDocumentsClient.DeleteADocument.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaLibrariesDocumentsClient.DeleteADocument.g.cs index a34e074b..3b91f30e 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaLibrariesDocumentsClient.DeleteADocument.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaLibrariesDocumentsClient.DeleteADocument.g.cs @@ -18,5 +18,19 @@ public partial interface IBetaLibrariesDocumentsClient global::System.Guid documentId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// 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 + /// + 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); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaLibrariesDocumentsClient.ListDocumentsInAGivenLibrary.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaLibrariesDocumentsClient.ListDocumentsInAGivenLibrary.g.cs index a0a606ad..d86da477 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaLibrariesDocumentsClient.ListDocumentsInAGivenLibrary.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaLibrariesDocumentsClient.ListDocumentsInAGivenLibrary.g.cs @@ -36,5 +36,37 @@ public partial interface IBetaLibrariesDocumentsClient string? sortOrder = default, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// 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 + /// + 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); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaLibrariesDocumentsClient.ReprocessADocument.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaLibrariesDocumentsClient.ReprocessADocument.g.cs index d7fcfcd6..7fcd1a2a 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaLibrariesDocumentsClient.ReprocessADocument.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaLibrariesDocumentsClient.ReprocessADocument.g.cs @@ -18,5 +18,19 @@ public partial interface IBetaLibrariesDocumentsClient global::System.Guid documentId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// 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 + /// + 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); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaLibrariesDocumentsClient.RetrieveTheMetadataOfASpecificDocument.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaLibrariesDocumentsClient.RetrieveTheMetadataOfASpecificDocument.g.cs index 72b46815..77ed279c 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaLibrariesDocumentsClient.RetrieveTheMetadataOfASpecificDocument.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaLibrariesDocumentsClient.RetrieveTheMetadataOfASpecificDocument.g.cs @@ -18,5 +18,19 @@ public partial interface IBetaLibrariesDocumentsClient global::System.Guid documentId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// 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 + /// + 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); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaLibrariesDocumentsClient.RetrieveTheProcessingStatusOfASpecificDocument.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaLibrariesDocumentsClient.RetrieveTheProcessingStatusOfASpecificDocument.g.cs index 49378772..23fec8dd 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaLibrariesDocumentsClient.RetrieveTheProcessingStatusOfASpecificDocument.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaLibrariesDocumentsClient.RetrieveTheProcessingStatusOfASpecificDocument.g.cs @@ -18,5 +18,19 @@ public partial interface IBetaLibrariesDocumentsClient global::System.Guid documentId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// 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 + /// + 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); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaLibrariesDocumentsClient.RetrieveTheSignedUrlOfASpecificDocument.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaLibrariesDocumentsClient.RetrieveTheSignedUrlOfASpecificDocument.g.cs index 23ff31cb..50f1cc71 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaLibrariesDocumentsClient.RetrieveTheSignedUrlOfASpecificDocument.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaLibrariesDocumentsClient.RetrieveTheSignedUrlOfASpecificDocument.g.cs @@ -18,5 +18,19 @@ public partial interface IBetaLibrariesDocumentsClient global::System.Guid documentId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// 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 + /// + 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); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaLibrariesDocumentsClient.RetrieveTheSignedUrlOfTextExtractedFromAGivenDocument.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaLibrariesDocumentsClient.RetrieveTheSignedUrlOfTextExtractedFromAGivenDocument.g.cs index 5bb16746..a3206f62 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaLibrariesDocumentsClient.RetrieveTheSignedUrlOfTextExtractedFromAGivenDocument.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaLibrariesDocumentsClient.RetrieveTheSignedUrlOfTextExtractedFromAGivenDocument.g.cs @@ -18,5 +18,19 @@ public partial interface IBetaLibrariesDocumentsClient global::System.Guid documentId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// 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 + /// + 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); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaLibrariesDocumentsClient.RetrieveTheTextContentOfASpecificDocument.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaLibrariesDocumentsClient.RetrieveTheTextContentOfASpecificDocument.g.cs index 8552aab9..863b0993 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaLibrariesDocumentsClient.RetrieveTheTextContentOfASpecificDocument.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaLibrariesDocumentsClient.RetrieveTheTextContentOfASpecificDocument.g.cs @@ -18,5 +18,19 @@ public partial interface IBetaLibrariesDocumentsClient global::System.Guid documentId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// 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 + /// + 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); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaLibrariesDocumentsClient.UpdateTheMetadataOfASpecificDocument.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaLibrariesDocumentsClient.UpdateTheMetadataOfASpecificDocument.g.cs index d1c2ea03..1b5c9a98 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaLibrariesDocumentsClient.UpdateTheMetadataOfASpecificDocument.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaLibrariesDocumentsClient.UpdateTheMetadataOfASpecificDocument.g.cs @@ -27,6 +27,23 @@ public partial interface IBetaLibrariesDocumentsClient /// /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + 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); + /// + /// 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. diff --git a/src/libs/Mistral/Generated/Mistral.IBetaLibrariesDocumentsClient.UploadANewDocument.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaLibrariesDocumentsClient.UploadANewDocument.g.cs index 172ec5dd..20fc39c0 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaLibrariesDocumentsClient.UploadANewDocument.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaLibrariesDocumentsClient.UploadANewDocument.g.cs @@ -24,6 +24,21 @@ public partial interface IBetaLibrariesDocumentsClient /// 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 + /// + 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); + /// + /// 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:
@@ -55,5 +70,78 @@ public partial interface IBetaLibrariesDocumentsClient string filename, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// 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 + /// + 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); + /// + /// 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 + /// + 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); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityCampaignsClient.CreateAndStartANewCampaign.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityCampaignsClient.CreateAndStartANewCampaign.g.cs index f99609a1..28ce6e69 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityCampaignsClient.CreateAndStartANewCampaign.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityCampaignsClient.CreateAndStartANewCampaign.g.cs @@ -19,6 +19,18 @@ public partial interface IBetaObservabilityCampaignsClient /// /// 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 + /// + global::System.Threading.Tasks.Task> CreateAndStartANewCampaignAsResponseAsync( + + global::Mistral.PostCampaignInSchema request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create and start a new campaign + /// /// /// /// diff --git a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityCampaignsClient.DeleteACampaign.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityCampaignsClient.DeleteACampaign.g.cs index 0f27bc7f..89a6551e 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityCampaignsClient.DeleteACampaign.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityCampaignsClient.DeleteACampaign.g.cs @@ -15,5 +15,16 @@ public partial interface IBetaObservabilityCampaignsClient global::System.Guid campaignId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete a campaign + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeleteACampaignAsResponseAsync( + global::System.Guid campaignId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityCampaignsClient.GetAllCampaigns.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityCampaignsClient.GetAllCampaigns.g.cs index e58d09fd..0f516676 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityCampaignsClient.GetAllCampaigns.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityCampaignsClient.GetAllCampaigns.g.cs @@ -23,5 +23,24 @@ public partial interface IBetaObservabilityCampaignsClient string? q = default, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// 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 + /// + 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); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityCampaignsClient.GetCampaignById.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityCampaignsClient.GetCampaignById.g.cs index 8ecc319b..18b4f910 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityCampaignsClient.GetCampaignById.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityCampaignsClient.GetCampaignById.g.cs @@ -15,5 +15,16 @@ public partial interface IBetaObservabilityCampaignsClient global::System.Guid campaignId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get campaign by id + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetCampaignByIdAsResponseAsync( + global::System.Guid campaignId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityCampaignsClient.GetCampaignStatusByCampaignId.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityCampaignsClient.GetCampaignStatusByCampaignId.g.cs index 26d7034d..1fb56932 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityCampaignsClient.GetCampaignStatusByCampaignId.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityCampaignsClient.GetCampaignStatusByCampaignId.g.cs @@ -15,5 +15,16 @@ public partial interface IBetaObservabilityCampaignsClient global::System.Guid campaignId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// 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 + /// + global::System.Threading.Tasks.Task> GetCampaignStatusByCampaignIdAsResponseAsync( + global::System.Guid campaignId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityCampaignsClient.GetEventIdsThatWereSelectedByTheGivenCampaign.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityCampaignsClient.GetEventIdsThatWereSelectedByTheGivenCampaign.g.cs index 31980a15..84c20591 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityCampaignsClient.GetEventIdsThatWereSelectedByTheGivenCampaign.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityCampaignsClient.GetEventIdsThatWereSelectedByTheGivenCampaign.g.cs @@ -23,5 +23,24 @@ public partial interface IBetaObservabilityCampaignsClient int? page = default, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get event ids that were selected by the given campaign + /// + /// + /// + /// 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 + /// + global::System.Threading.Tasks.Task> GetEventIdsThatWereSelectedByTheGivenCampaignAsResponseAsync( + global::System.Guid campaignId, + int? pageSize = default, + int? page = default, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityChatCompletionEventsClient.AlternativeToSearchThatReturnsOnlyTheIDsAndThatCanReturnManyIDsAtOnce.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityChatCompletionEventsClient.AlternativeToSearchThatReturnsOnlyTheIDsAndThatCanReturnManyIDsAtOnce.g.cs index ec430c7f..14c0ee17 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityChatCompletionEventsClient.AlternativeToSearchThatReturnsOnlyTheIDsAndThatCanReturnManyIDsAtOnce.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityChatCompletionEventsClient.AlternativeToSearchThatReturnsOnlyTheIDsAndThatCanReturnManyIDsAtOnce.g.cs @@ -19,6 +19,18 @@ public partial interface IBetaObservabilityChatCompletionEventsClient /// /// Alternative to /search that returns only the IDs and that can return many IDs at once /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> AlternativeToSearchThatReturnsOnlyTheIDsAndThatCanReturnManyIDsAtOnceAsResponseAsync( + + global::Mistral.GetChatCompletionEventIdsInSchema request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Alternative to /search that returns only the IDs and that can return many IDs at once + /// /// /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. diff --git a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityChatCompletionEventsClient.GetChatCompletionEvent.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityChatCompletionEventsClient.GetChatCompletionEvent.g.cs index 09dfa33a..9172d194 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityChatCompletionEventsClient.GetChatCompletionEvent.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityChatCompletionEventsClient.GetChatCompletionEvent.g.cs @@ -15,5 +15,16 @@ public partial interface IBetaObservabilityChatCompletionEventsClient global::System.Guid eventId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Chat Completion Event + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetChatCompletionEventAsResponseAsync( + global::System.Guid eventId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityChatCompletionEventsClient.GetChatCompletionEvents.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityChatCompletionEventsClient.GetChatCompletionEvents.g.cs index 61d4b5e8..c58ecde9 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityChatCompletionEventsClient.GetChatCompletionEvents.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityChatCompletionEventsClient.GetChatCompletionEvents.g.cs @@ -29,6 +29,24 @@ public partial interface IBetaObservabilityChatCompletionEventsClient /// Default Value: 50 /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetChatCompletionEventsAsResponseAsync( + + global::Mistral.GetChatCompletionEventsInSchema request, + int? pageSize = default, + string? cursor = default, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Chat Completion Events + /// + /// + /// Default Value: 50 + /// + /// /// /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. diff --git a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityChatCompletionEventsClient.GetSimilarChatCompletionEvents.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityChatCompletionEventsClient.GetSimilarChatCompletionEvents.g.cs index 5110f818..c6fa7f4b 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityChatCompletionEventsClient.GetSimilarChatCompletionEvents.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityChatCompletionEventsClient.GetSimilarChatCompletionEvents.g.cs @@ -15,5 +15,16 @@ public partial interface IBetaObservabilityChatCompletionEventsClient global::System.Guid eventId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Similar Chat Completion Events + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetSimilarChatCompletionEventsAsResponseAsync( + global::System.Guid eventId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityChatCompletionEventsClient.RunJudgeOnAnEventBasedOnTheGivenOptions.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityChatCompletionEventsClient.RunJudgeOnAnEventBasedOnTheGivenOptions.g.cs index 5642e94b..472aee64 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityChatCompletionEventsClient.RunJudgeOnAnEventBasedOnTheGivenOptions.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityChatCompletionEventsClient.RunJudgeOnAnEventBasedOnTheGivenOptions.g.cs @@ -22,6 +22,20 @@ public partial interface IBetaObservabilityChatCompletionEventsClient /// Run Judge on an event based on the given options /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> RunJudgeOnAnEventBasedOnTheGivenOptionsAsResponseAsync( + global::System.Guid eventId, + + global::Mistral.PostChatCompletionEventJudgingInSchema request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Run Judge on an event based on the given options + /// + /// /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with diff --git a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityChatCompletionEventsFieldsClient.GetChatCompletionFieldOptions.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityChatCompletionEventsFieldsClient.GetChatCompletionFieldOptions.g.cs index 41c07536..84a33727 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityChatCompletionEventsFieldsClient.GetChatCompletionFieldOptions.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityChatCompletionEventsFieldsClient.GetChatCompletionFieldOptions.g.cs @@ -19,5 +19,20 @@ public partial interface IBetaObservabilityChatCompletionEventsFieldsClient global::Mistral.GetChatCompletionFieldOptionsV1ObservabilityChatCompletionFieldsFieldNameOptionsGetOperator @operator, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Chat Completion Field Options + /// + /// + /// + /// The operator to use for filtering options + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetChatCompletionFieldOptionsAsResponseAsync( + string fieldName, + global::Mistral.GetChatCompletionFieldOptionsV1ObservabilityChatCompletionFieldsFieldNameOptionsGetOperator @operator, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityChatCompletionEventsFieldsClient.GetChatCompletionFieldOptionsCounts.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityChatCompletionEventsFieldsClient.GetChatCompletionFieldOptionsCounts.g.cs index 0b3fd841..5b7fb301 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityChatCompletionEventsFieldsClient.GetChatCompletionFieldOptionsCounts.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityChatCompletionEventsFieldsClient.GetChatCompletionFieldOptionsCounts.g.cs @@ -22,6 +22,20 @@ public partial interface IBetaObservabilityChatCompletionEventsFieldsClient /// Get Chat Completion Field Options Counts /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetChatCompletionFieldOptionsCountsAsResponseAsync( + string fieldName, + + global::Mistral.FieldOptionCountsInSchema request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Chat Completion Field Options Counts + /// + /// /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with diff --git a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityChatCompletionEventsFieldsClient.GetChatCompletionFields.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityChatCompletionEventsFieldsClient.GetChatCompletionFields.g.cs index 8dab2519..69bed5fa 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityChatCompletionEventsFieldsClient.GetChatCompletionFields.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityChatCompletionEventsFieldsClient.GetChatCompletionFields.g.cs @@ -13,5 +13,14 @@ public partial interface IBetaObservabilityChatCompletionEventsFieldsClient global::System.Threading.Tasks.Task GetChatCompletionFieldsAsync( global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Chat Completion Fields + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetChatCompletionFieldsAsResponseAsync( + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsClient.AddAConversationToTheDataset.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsClient.AddAConversationToTheDataset.g.cs index 4fc63a8a..7603bec4 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsClient.AddAConversationToTheDataset.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsClient.AddAConversationToTheDataset.g.cs @@ -22,6 +22,20 @@ public partial interface IBetaObservabilityDatasetsClient /// Add a conversation to the dataset /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> AddAConversationToTheDatasetAsResponseAsync( + global::System.Guid datasetId, + + global::Mistral.PostDatasetRecordInSchema request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Add a conversation to the dataset + /// + /// /// /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. diff --git a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsClient.CreateANewEmptyDataset.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsClient.CreateANewEmptyDataset.g.cs index 2ba93470..7aa30d89 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsClient.CreateANewEmptyDataset.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsClient.CreateANewEmptyDataset.g.cs @@ -19,6 +19,18 @@ public partial interface IBetaObservabilityDatasetsClient /// /// Create a new empty dataset /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateANewEmptyDatasetAsResponseAsync( + + global::Mistral.PostDatasetInSchema request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create a new empty dataset + /// /// /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. diff --git a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsClient.DeleteADataset.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsClient.DeleteADataset.g.cs index d0a756d4..c189f915 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsClient.DeleteADataset.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsClient.DeleteADataset.g.cs @@ -15,5 +15,16 @@ public partial interface IBetaObservabilityDatasetsClient global::System.Guid datasetId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete a dataset + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeleteADatasetAsResponseAsync( + global::System.Guid datasetId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsClient.ExportToTheFilesApiAndRetrievePresignedUrlToDownloadTheResultingJsonlFile.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsClient.ExportToTheFilesApiAndRetrievePresignedUrlToDownloadTheResultingJsonlFile.g.cs index f85abc19..b5b17d02 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsClient.ExportToTheFilesApiAndRetrievePresignedUrlToDownloadTheResultingJsonlFile.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsClient.ExportToTheFilesApiAndRetrievePresignedUrlToDownloadTheResultingJsonlFile.g.cs @@ -15,5 +15,16 @@ public partial interface IBetaObservabilityDatasetsClient global::System.Guid datasetId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Export to the Files API and retrieve presigned URL to download the resulting JSONL file + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ExportToTheFilesApiAndRetrievePresignedUrlToDownloadTheResultingJsonlFileAsResponseAsync( + global::System.Guid datasetId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsClient.GetDatasetById.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsClient.GetDatasetById.g.cs index 4767b0a0..8e529cf4 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsClient.GetDatasetById.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsClient.GetDatasetById.g.cs @@ -15,5 +15,16 @@ public partial interface IBetaObservabilityDatasetsClient global::System.Guid datasetId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get dataset by id + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetDatasetByIdAsResponseAsync( + global::System.Guid datasetId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsClient.GetStatusOfADatasetImportTask.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsClient.GetStatusOfADatasetImportTask.g.cs index a11e0675..882f522c 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsClient.GetStatusOfADatasetImportTask.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsClient.GetStatusOfADatasetImportTask.g.cs @@ -17,5 +17,18 @@ public partial interface IBetaObservabilityDatasetsClient global::System.Guid taskId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get status of a dataset import task + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetStatusOfADatasetImportTaskAsResponseAsync( + global::System.Guid datasetId, + global::System.Guid taskId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsClient.ListExistingDatasets.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsClient.ListExistingDatasets.g.cs index 57344583..f3ca8797 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsClient.ListExistingDatasets.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsClient.ListExistingDatasets.g.cs @@ -23,5 +23,24 @@ public partial interface IBetaObservabilityDatasetsClient string? q = default, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List existing datasets + /// + /// + /// 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 + /// + global::System.Threading.Tasks.Task> ListExistingDatasetsAsResponseAsync( + int? pageSize = default, + int? page = default, + string? q = default, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsClient.ListExistingRecordsInTheDataset.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsClient.ListExistingRecordsInTheDataset.g.cs index 69a622f0..a881b208 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsClient.ListExistingRecordsInTheDataset.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsClient.ListExistingRecordsInTheDataset.g.cs @@ -23,5 +23,24 @@ public partial interface IBetaObservabilityDatasetsClient int? page = default, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List existing records in the dataset + /// + /// + /// + /// 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 + /// + global::System.Threading.Tasks.Task> ListExistingRecordsInTheDatasetAsResponseAsync( + global::System.Guid datasetId, + int? pageSize = default, + int? page = default, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsClient.ListImportTasksForTheGivenDataset.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsClient.ListImportTasksForTheGivenDataset.g.cs index 6f1912de..5f167fa7 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsClient.ListImportTasksForTheGivenDataset.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsClient.ListImportTasksForTheGivenDataset.g.cs @@ -23,5 +23,24 @@ public partial interface IBetaObservabilityDatasetsClient int? page = default, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List import tasks for the given dataset + /// + /// + /// + /// 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 + /// + global::System.Threading.Tasks.Task> ListImportTasksForTheGivenDatasetAsResponseAsync( + global::System.Guid datasetId, + int? pageSize = default, + int? page = default, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsClient.PatchDataset.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsClient.PatchDataset.g.cs index 2778d88d..766eeaa7 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsClient.PatchDataset.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsClient.PatchDataset.g.cs @@ -22,6 +22,20 @@ public partial interface IBetaObservabilityDatasetsClient /// Patch dataset /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> PatchDatasetAsResponseAsync( + global::System.Guid datasetId, + + global::Mistral.PatchDatasetInSchema request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Patch dataset + /// + /// /// /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. diff --git a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsClient.PopulateTheDatasetWithACampaign.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsClient.PopulateTheDatasetWithACampaign.g.cs index 5cc67bf4..6e83b89e 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsClient.PopulateTheDatasetWithACampaign.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsClient.PopulateTheDatasetWithACampaign.g.cs @@ -22,6 +22,20 @@ public partial interface IBetaObservabilityDatasetsClient /// Populate the dataset with a campaign /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> PopulateTheDatasetWithACampaignAsResponseAsync( + global::System.Guid datasetId, + + global::Mistral.PostDatasetImportFromCampaignInSchema request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Populate the dataset with a campaign + /// + /// /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with diff --git a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsClient.PopulateTheDatasetWithSamplesFromAnUploadedFile.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsClient.PopulateTheDatasetWithSamplesFromAnUploadedFile.g.cs index b8e77c1f..52aae3d3 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsClient.PopulateTheDatasetWithSamplesFromAnUploadedFile.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsClient.PopulateTheDatasetWithSamplesFromAnUploadedFile.g.cs @@ -22,6 +22,20 @@ public partial interface IBetaObservabilityDatasetsClient /// Populate the dataset with samples from an uploaded file /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> PopulateTheDatasetWithSamplesFromAnUploadedFileAsResponseAsync( + global::System.Guid datasetId, + + global::Mistral.PostDatasetImportFromFileInSchema request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Populate the dataset with samples from an uploaded file + /// + /// /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with diff --git a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsClient.PopulateTheDatasetWithSamplesFromAnotherDataset.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsClient.PopulateTheDatasetWithSamplesFromAnotherDataset.g.cs index 2610956a..63957a4d 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsClient.PopulateTheDatasetWithSamplesFromAnotherDataset.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsClient.PopulateTheDatasetWithSamplesFromAnotherDataset.g.cs @@ -22,6 +22,20 @@ public partial interface IBetaObservabilityDatasetsClient /// Populate the dataset with samples from another dataset /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> PopulateTheDatasetWithSamplesFromAnotherDatasetAsResponseAsync( + global::System.Guid datasetId, + + global::Mistral.PostDatasetImportFromDatasetInSchema request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Populate the dataset with samples from another dataset + /// + /// /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with diff --git a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsClient.PopulateTheDatasetWithSamplesFromTheExplorer.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsClient.PopulateTheDatasetWithSamplesFromTheExplorer.g.cs index 12c021d3..66314c07 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsClient.PopulateTheDatasetWithSamplesFromTheExplorer.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsClient.PopulateTheDatasetWithSamplesFromTheExplorer.g.cs @@ -22,6 +22,20 @@ public partial interface IBetaObservabilityDatasetsClient /// Populate the dataset with samples from the explorer /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> PopulateTheDatasetWithSamplesFromTheExplorerAsResponseAsync( + global::System.Guid datasetId, + + global::Mistral.PostDatasetImportFromExplorerInSchema request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Populate the dataset with samples from the explorer + /// + /// /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with diff --git a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsClient.PopulateTheDatasetWithSamplesFromThePlayground.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsClient.PopulateTheDatasetWithSamplesFromThePlayground.g.cs index bd52e35b..3d13a1a2 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsClient.PopulateTheDatasetWithSamplesFromThePlayground.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsClient.PopulateTheDatasetWithSamplesFromThePlayground.g.cs @@ -22,6 +22,20 @@ public partial interface IBetaObservabilityDatasetsClient /// Populate the dataset with samples from the playground /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> PopulateTheDatasetWithSamplesFromThePlaygroundAsResponseAsync( + global::System.Guid datasetId, + + global::Mistral.PostDatasetImportFromPlaygroundInSchema request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Populate the dataset with samples from the playground + /// + /// /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with diff --git a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsRecordsClient.DeleteARecordFromADataset.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsRecordsClient.DeleteARecordFromADataset.g.cs index 82ac74aa..4e16949b 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsRecordsClient.DeleteARecordFromADataset.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsRecordsClient.DeleteARecordFromADataset.g.cs @@ -15,5 +15,16 @@ public partial interface IBetaObservabilityDatasetsRecordsClient global::System.Guid datasetRecordId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete a record from a dataset + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeleteARecordFromADatasetAsResponseAsync( + global::System.Guid datasetRecordId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsRecordsClient.DeleteMultipleRecordsFromDatasets.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsRecordsClient.DeleteMultipleRecordsFromDatasets.g.cs index 20e28032..346bf05d 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsRecordsClient.DeleteMultipleRecordsFromDatasets.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsRecordsClient.DeleteMultipleRecordsFromDatasets.g.cs @@ -19,6 +19,18 @@ public partial interface IBetaObservabilityDatasetsRecordsClient /// /// Delete multiple records from datasets /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeleteMultipleRecordsFromDatasetsAsResponseAsync( + + global::Mistral.DeleteDatasetRecordsInSchema request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete multiple records from datasets + /// /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with diff --git a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsRecordsClient.GetTheContentOfAGivenConversationFromADataset.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsRecordsClient.GetTheContentOfAGivenConversationFromADataset.g.cs index d306f161..49437eb3 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsRecordsClient.GetTheContentOfAGivenConversationFromADataset.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsRecordsClient.GetTheContentOfAGivenConversationFromADataset.g.cs @@ -15,5 +15,16 @@ public partial interface IBetaObservabilityDatasetsRecordsClient global::System.Guid datasetRecordId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get the content of a given conversation from a dataset + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetTheContentOfAGivenConversationFromADatasetAsResponseAsync( + global::System.Guid datasetRecordId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsRecordsClient.RunJudgeOnADatasetRecordBasedOnTheGivenOptions.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsRecordsClient.RunJudgeOnADatasetRecordBasedOnTheGivenOptions.g.cs index 7cbd4956..cf2a51c5 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsRecordsClient.RunJudgeOnADatasetRecordBasedOnTheGivenOptions.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsRecordsClient.RunJudgeOnADatasetRecordBasedOnTheGivenOptions.g.cs @@ -22,6 +22,20 @@ public partial interface IBetaObservabilityDatasetsRecordsClient /// Run Judge on a dataset record based on the given options /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> RunJudgeOnADatasetRecordBasedOnTheGivenOptionsAsResponseAsync( + global::System.Guid datasetRecordId, + + global::Mistral.PostDatasetRecordJudgingInSchema request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Run Judge on a dataset record based on the given options + /// + /// /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with diff --git a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsRecordsClient.UpdateADatasetRecordConversationPayload.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsRecordsClient.UpdateADatasetRecordConversationPayload.g.cs index aefea26c..318b7341 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsRecordsClient.UpdateADatasetRecordConversationPayload.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsRecordsClient.UpdateADatasetRecordConversationPayload.g.cs @@ -22,6 +22,20 @@ public partial interface IBetaObservabilityDatasetsRecordsClient /// Update a dataset record conversation payload /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task UpdateADatasetRecordConversationPayloadAsResponseAsync( + global::System.Guid datasetRecordId, + + global::Mistral.PutDatasetRecordPayloadInSchema request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update a dataset record conversation payload + /// + /// /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with diff --git a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsRecordsClient.UpdateConversationProperties.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsRecordsClient.UpdateConversationProperties.g.cs index 70d51205..a3602398 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsRecordsClient.UpdateConversationProperties.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityDatasetsRecordsClient.UpdateConversationProperties.g.cs @@ -22,6 +22,20 @@ public partial interface IBetaObservabilityDatasetsRecordsClient /// Update conversation properties /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task UpdateConversationPropertiesAsResponseAsync( + global::System.Guid datasetRecordId, + + global::Mistral.PutDatasetRecordPropertiesInSchema request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update conversation properties + /// + /// /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. /// The token to cancel the operation with diff --git a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityJudgesClient.CreateANewJudge.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityJudgesClient.CreateANewJudge.g.cs index 56db6f4f..3d8f394d 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityJudgesClient.CreateANewJudge.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityJudgesClient.CreateANewJudge.g.cs @@ -19,6 +19,18 @@ public partial interface IBetaObservabilityJudgesClient /// /// Create a new judge /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CreateANewJudgeAsResponseAsync( + + global::Mistral.PostJudgeInSchema request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create a new judge + /// /// /// /// diff --git a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityJudgesClient.DeleteAJudge.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityJudgesClient.DeleteAJudge.g.cs index 3e48713a..47349251 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityJudgesClient.DeleteAJudge.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityJudgesClient.DeleteAJudge.g.cs @@ -15,5 +15,16 @@ public partial interface IBetaObservabilityJudgesClient global::System.Guid judgeId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete a judge + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DeleteAJudgeAsResponseAsync( + global::System.Guid judgeId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityJudgesClient.GetJudgeById.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityJudgesClient.GetJudgeById.g.cs index 4002a5b9..532e807b 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityJudgesClient.GetJudgeById.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityJudgesClient.GetJudgeById.g.cs @@ -15,5 +15,16 @@ public partial interface IBetaObservabilityJudgesClient global::System.Guid judgeId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get judge by id + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetJudgeByIdAsResponseAsync( + global::System.Guid judgeId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityJudgesClient.GetJudgesWithOptionalFilteringAndSearch.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityJudgesClient.GetJudgesWithOptionalFilteringAndSearch.g.cs index 15f4ce89..c0e1d159 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityJudgesClient.GetJudgesWithOptionalFilteringAndSearch.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityJudgesClient.GetJudgesWithOptionalFilteringAndSearch.g.cs @@ -31,5 +31,32 @@ public partial interface IBetaObservabilityJudgesClient string? q = default, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get judges with optional filtering and search + /// + /// + /// Filter by judge output types + /// + /// + /// Filter by model names + /// + /// + /// 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 + /// + global::System.Threading.Tasks.Task> GetJudgesWithOptionalFilteringAndSearchAsResponseAsync( + global::System.Collections.Generic.IList? typeFilter = default, + global::System.Collections.Generic.IList? modelFilter = default, + int? pageSize = default, + int? page = default, + string? q = default, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityJudgesClient.RunASavedJudgeOnAConversation.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityJudgesClient.RunASavedJudgeOnAConversation.g.cs index 020dfbc4..205d263d 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityJudgesClient.RunASavedJudgeOnAConversation.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityJudgesClient.RunASavedJudgeOnAConversation.g.cs @@ -22,6 +22,20 @@ public partial interface IBetaObservabilityJudgesClient /// Run a saved judge on a conversation /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> RunASavedJudgeOnAConversationAsResponseAsync( + global::System.Guid judgeId, + + global::Mistral.JudgeConversationRequest request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Run a saved judge on a conversation + /// + /// /// /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. diff --git a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityJudgesClient.UpdateAJudge.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityJudgesClient.UpdateAJudge.g.cs index 78964343..d3aa9c74 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaObservabilityJudgesClient.UpdateAJudge.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaObservabilityJudgesClient.UpdateAJudge.g.cs @@ -22,6 +22,20 @@ public partial interface IBetaObservabilityJudgesClient /// Update a judge /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task UpdateAJudgeAsResponseAsync( + global::System.Guid judgeId, + + global::Mistral.PutJudgeInSchema request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update a judge + /// + /// /// /// /// diff --git a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsClient.ArchiveWorkflow.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsClient.ArchiveWorkflow.g.cs index fba987b0..feed0dae 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsClient.ArchiveWorkflow.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsClient.ArchiveWorkflow.g.cs @@ -15,5 +15,16 @@ public partial interface IBetaWorkflowsClient string workflowIdentifier, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Archive Workflow + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ArchiveWorkflowAsResponseAsync( + string workflowIdentifier, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsClient.ExecuteWorkflow.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsClient.ExecuteWorkflow.g.cs index d6c29d7e..a76695bf 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsClient.ExecuteWorkflow.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsClient.ExecuteWorkflow.g.cs @@ -24,6 +24,20 @@ public partial interface IBetaWorkflowsClient /// Execute Workflow /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task>> ExecuteWorkflowAsResponseAsync( + string workflowIdentifier, + + global::Mistral.WorkflowExecutionRequest request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Execute Workflow + /// + /// /// /// Allows you to specify a custom execution ID. If not provided, a random ID will be generated. /// diff --git a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsClient.GetWorkflow.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsClient.GetWorkflow.g.cs index 4585af92..132bc61b 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsClient.GetWorkflow.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsClient.GetWorkflow.g.cs @@ -15,5 +15,16 @@ public partial interface IBetaWorkflowsClient string workflowIdentifier, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Workflow + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetWorkflowAsResponseAsync( + string workflowIdentifier, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsClient.GetWorkflowRegistration.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsClient.GetWorkflowRegistration.g.cs index bdd4675c..99addbf9 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsClient.GetWorkflowRegistration.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsClient.GetWorkflowRegistration.g.cs @@ -25,5 +25,26 @@ public partial interface IBetaWorkflowsClient bool? includeShared = default, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Workflow Registration + /// + /// + /// + /// Whether to include the workflow definition
+ /// Default Value: false + /// + /// + /// Whether to include shared workflow versions
+ /// Default Value: true + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetWorkflowRegistrationAsResponseAsync( + global::System.Guid workflowRegistrationId, + bool? withWorkflow = default, + bool? includeShared = default, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsClient.GetWorkflowRegistrations.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsClient.GetWorkflowRegistrations.g.cs index faa57d01..67af4819 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsClient.GetWorkflowRegistrations.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsClient.GetWorkflowRegistrations.g.cs @@ -57,5 +57,58 @@ public partial interface IBetaWorkflowsClient global::System.Guid? cursor = default, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Workflow Registrations + /// + /// + /// The workflow ID to filter by + /// + /// + /// The task queue to filter by + /// + /// + /// Whether to only return active workflows versions
+ /// Default Value: false + /// + /// + /// Whether to include shared workflow versions
+ /// Default Value: true + /// + /// + /// The workflow name to filter by + /// + /// + /// Filter by archived state. False=exclude archived, True=only archived, None=include all + /// + /// + /// Whether to include the workflow definition
+ /// Default Value: false + /// + /// + /// Whether to only return workflows compatible with chat assistant + /// + /// + /// The maximum number of workflows versions to return
+ /// Default Value: 50 + /// + /// + /// The cursor for pagination + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetWorkflowRegistrationsAsResponseAsync( + global::System.Guid? workflowId = default, + string? taskQueue = default, + bool? activeOnly = default, + bool? includeShared = default, + string? workflowSearch = default, + bool? archived = default, + bool? withWorkflow = default, + bool? availableInChatAssistant = default, + int? limit = default, + global::System.Guid? cursor = default, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsClient.UnarchiveWorkflow.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsClient.UnarchiveWorkflow.g.cs index 5413909f..5d17cafb 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsClient.UnarchiveWorkflow.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsClient.UnarchiveWorkflow.g.cs @@ -15,5 +15,16 @@ public partial interface IBetaWorkflowsClient string workflowIdentifier, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Unarchive Workflow + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UnarchiveWorkflowAsResponseAsync( + string workflowIdentifier, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsClient.UpdateWorkflow.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsClient.UpdateWorkflow.g.cs index da49fc3e..2f5fb7bd 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsClient.UpdateWorkflow.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsClient.UpdateWorkflow.g.cs @@ -22,6 +22,20 @@ public partial interface IBetaWorkflowsClient /// Update Workflow /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UpdateWorkflowAsResponseAsync( + string workflowIdentifier, + + global::Mistral.WorkflowUpdateRequest request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update Workflow + /// + /// /// /// New display name value /// diff --git a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsDeploymentsClient.GetDeployment.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsDeploymentsClient.GetDeployment.g.cs index 9da4661c..268fc0d1 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsDeploymentsClient.GetDeployment.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsDeploymentsClient.GetDeployment.g.cs @@ -15,5 +15,16 @@ public partial interface IBetaWorkflowsDeploymentsClient string name, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Deployment + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetDeploymentAsResponseAsync( + string name, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsDeploymentsClient.ListDeployments.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsDeploymentsClient.ListDeployments.g.cs index ba440271..1a231acd 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsDeploymentsClient.ListDeployments.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsDeploymentsClient.ListDeployments.g.cs @@ -19,5 +19,20 @@ public partial interface IBetaWorkflowsDeploymentsClient string? workflowName = default, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Deployments + /// + /// + /// Default Value: true + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListDeploymentsAsResponseAsync( + bool? activeOnly = default, + string? workflowName = default, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsEventsClient.GetWorkflowEvents.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsEventsClient.GetWorkflowEvents.g.cs index b7bcd90c..ac4aa394 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsEventsClient.GetWorkflowEvents.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsEventsClient.GetWorkflowEvents.g.cs @@ -34,5 +34,35 @@ public partial interface IBetaWorkflowsEventsClient string? cursor = default, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Workflow Events + /// + /// + /// Execution ID of the root workflow that initiated this execution chain. + /// + /// + /// Execution ID of the workflow that emitted this event. + /// + /// + /// Run ID of the workflow that emitted this event. + /// + /// + /// Maximum number of events to return.
+ /// Default Value: 100 + /// + /// + /// Cursor for pagination. + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetWorkflowEventsAsResponseAsync( + string? rootWorkflowExecId = default, + string? workflowExecId = default, + string? workflowRunId = default, + int? limit = default, + string? cursor = default, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsExecutionsClient.BatchCancelWorkflowExecutions.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsExecutionsClient.BatchCancelWorkflowExecutions.g.cs index 26c969b4..43bdd420 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsExecutionsClient.BatchCancelWorkflowExecutions.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsExecutionsClient.BatchCancelWorkflowExecutions.g.cs @@ -19,6 +19,18 @@ public partial interface IBetaWorkflowsExecutionsClient /// /// Batch Cancel Workflow Executions /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> BatchCancelWorkflowExecutionsAsResponseAsync( + + global::Mistral.BatchExecutionBody request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Batch Cancel Workflow Executions + /// /// /// List of execution IDs to process /// diff --git a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsExecutionsClient.BatchTerminateWorkflowExecutions.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsExecutionsClient.BatchTerminateWorkflowExecutions.g.cs index 8621fce0..7a5b55a7 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsExecutionsClient.BatchTerminateWorkflowExecutions.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsExecutionsClient.BatchTerminateWorkflowExecutions.g.cs @@ -19,6 +19,18 @@ public partial interface IBetaWorkflowsExecutionsClient /// /// Batch Terminate Workflow Executions /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> BatchTerminateWorkflowExecutionsAsResponseAsync( + + global::Mistral.BatchExecutionBody request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Batch Terminate Workflow Executions + /// /// /// List of execution IDs to process /// diff --git a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsExecutionsClient.CancelWorkflowExecution.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsExecutionsClient.CancelWorkflowExecution.g.cs index 12456078..a2f1a940 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsExecutionsClient.CancelWorkflowExecution.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsExecutionsClient.CancelWorkflowExecution.g.cs @@ -15,5 +15,16 @@ public partial interface IBetaWorkflowsExecutionsClient string executionId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Cancel Workflow Execution + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task CancelWorkflowExecutionAsResponseAsync( + string executionId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsExecutionsClient.GetWorkflowExecution.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsExecutionsClient.GetWorkflowExecution.g.cs index 2b2b6a70..3c7210c5 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsExecutionsClient.GetWorkflowExecution.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsExecutionsClient.GetWorkflowExecution.g.cs @@ -15,5 +15,16 @@ public partial interface IBetaWorkflowsExecutionsClient string executionId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Workflow Execution + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetWorkflowExecutionAsResponseAsync( + string executionId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsExecutionsClient.GetWorkflowExecutionHistory.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsExecutionsClient.GetWorkflowExecutionHistory.g.cs index d22f3cc3..5c045de4 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsExecutionsClient.GetWorkflowExecutionHistory.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsExecutionsClient.GetWorkflowExecutionHistory.g.cs @@ -19,5 +19,20 @@ public partial interface IBetaWorkflowsExecutionsClient bool? decodePayloads = default, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Workflow Execution History + /// + /// + /// + /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetWorkflowExecutionHistoryAsResponseAsync( + string executionId, + bool? decodePayloads = default, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsExecutionsClient.GetWorkflowExecutionTraceEvents.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsExecutionsClient.GetWorkflowExecutionTraceEvents.g.cs index 800cd6c3..26dcb9ac 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsExecutionsClient.GetWorkflowExecutionTraceEvents.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsExecutionsClient.GetWorkflowExecutionTraceEvents.g.cs @@ -23,5 +23,24 @@ public partial interface IBetaWorkflowsExecutionsClient bool? includeInternalEvents = default, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Workflow Execution Trace Events + /// + /// + /// + /// Default Value: false + /// + /// + /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetWorkflowExecutionTraceEventsAsResponseAsync( + string executionId, + bool? mergeSameIdEvents = default, + bool? includeInternalEvents = default, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsExecutionsClient.GetWorkflowExecutionTraceOtel.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsExecutionsClient.GetWorkflowExecutionTraceOtel.g.cs index 1bf0b199..08850576 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsExecutionsClient.GetWorkflowExecutionTraceOtel.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsExecutionsClient.GetWorkflowExecutionTraceOtel.g.cs @@ -15,5 +15,16 @@ public partial interface IBetaWorkflowsExecutionsClient string executionId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Workflow Execution Trace Otel + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetWorkflowExecutionTraceOtelAsResponseAsync( + string executionId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsExecutionsClient.GetWorkflowExecutionTraceSummary.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsExecutionsClient.GetWorkflowExecutionTraceSummary.g.cs index 82d40e7b..886d30c8 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsExecutionsClient.GetWorkflowExecutionTraceSummary.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsExecutionsClient.GetWorkflowExecutionTraceSummary.g.cs @@ -15,5 +15,16 @@ public partial interface IBetaWorkflowsExecutionsClient string executionId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Workflow Execution Trace Summary + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetWorkflowExecutionTraceSummaryAsResponseAsync( + string executionId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsExecutionsClient.QueryWorkflowExecution.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsExecutionsClient.QueryWorkflowExecution.g.cs index eb733cd4..d95b5fe3 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsExecutionsClient.QueryWorkflowExecution.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsExecutionsClient.QueryWorkflowExecution.g.cs @@ -22,6 +22,20 @@ public partial interface IBetaWorkflowsExecutionsClient /// Query Workflow Execution /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> QueryWorkflowExecutionAsResponseAsync( + string executionId, + + global::Mistral.QueryInvocationBody request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Query Workflow Execution + /// + /// /// /// The name of the query to request /// diff --git a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsExecutionsClient.ResetWorkflow.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsExecutionsClient.ResetWorkflow.g.cs index fe9008b9..0bd858cc 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsExecutionsClient.ResetWorkflow.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsExecutionsClient.ResetWorkflow.g.cs @@ -22,6 +22,20 @@ public partial interface IBetaWorkflowsExecutionsClient /// Reset Workflow /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task ResetWorkflowAsResponseAsync( + string executionId, + + global::Mistral.ResetInvocationBody request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Reset Workflow + /// + /// /// /// The event ID to reset the workflow execution to /// diff --git a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsExecutionsClient.SignalWorkflowExecution.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsExecutionsClient.SignalWorkflowExecution.g.cs index 8b53e6d8..a8816ca3 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsExecutionsClient.SignalWorkflowExecution.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsExecutionsClient.SignalWorkflowExecution.g.cs @@ -22,6 +22,20 @@ public partial interface IBetaWorkflowsExecutionsClient /// Signal Workflow Execution /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> SignalWorkflowExecutionAsResponseAsync( + string executionId, + + global::Mistral.SignalInvocationBody request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Signal Workflow Execution + /// + /// /// /// The name of the signal to send /// diff --git a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsExecutionsClient.TerminateWorkflowExecution.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsExecutionsClient.TerminateWorkflowExecution.g.cs index 8ab54662..b02161eb 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsExecutionsClient.TerminateWorkflowExecution.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsExecutionsClient.TerminateWorkflowExecution.g.cs @@ -15,5 +15,16 @@ public partial interface IBetaWorkflowsExecutionsClient string executionId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Terminate Workflow Execution + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task TerminateWorkflowExecutionAsResponseAsync( + string executionId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsExecutionsClient.UpdateWorkflowExecution.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsExecutionsClient.UpdateWorkflowExecution.g.cs index 63be1716..0a8aee29 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsExecutionsClient.UpdateWorkflowExecution.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsExecutionsClient.UpdateWorkflowExecution.g.cs @@ -22,6 +22,20 @@ public partial interface IBetaWorkflowsExecutionsClient /// Update Workflow Execution /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UpdateWorkflowExecutionAsResponseAsync( + string executionId, + + global::Mistral.UpdateInvocationBody request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update Workflow Execution + /// + /// /// /// The name of the update to request /// diff --git a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsMetricsClient.GetWorkflowMetrics.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsMetricsClient.GetWorkflowMetrics.g.cs index 8071e41b..7176fe7a 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsMetricsClient.GetWorkflowMetrics.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsMetricsClient.GetWorkflowMetrics.g.cs @@ -40,5 +40,41 @@ public partial interface IBetaWorkflowsMetricsClient global::System.DateTime? endTime = default, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Workflow Metrics
+ /// Get comprehensive metrics for a specific workflow.
+ /// Args:
+ /// workflow_name: The name of the workflow type to get metrics for
+ /// start_time: Optional start time filter (ISO 8601 format)
+ /// end_time: Optional end time filter (ISO 8601 format)
+ /// Returns:
+ /// WorkflowMetrics: Dictionary containing metrics:
+ /// - execution_count: Total number of executions
+ /// - success_count: Number of successful executions
+ /// - error_count: Number of failed/terminated executions
+ /// - average_latency_ms: Average execution duration in milliseconds
+ /// - retry_rate: Proportion of workflows with retries
+ /// - latency_over_time: Time-series data of execution durations
+ /// Example:
+ /// GET /v1/workflows/MyWorkflow/metrics
+ /// GET /v1/workflows/MyWorkflow/metrics?start_time=2025-01-01T00:00:00Z
+ /// GET /v1/workflows/MyWorkflow/metrics?start_time=2025-01-01T00:00:00Z&end_time=2025-12-31T23:59:59Z + ///
+ /// + /// + /// Filter workflows started after this time (ISO 8601) + /// + /// + /// Filter workflows started before this time (ISO 8601) + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetWorkflowMetricsAsResponseAsync( + string workflowName, + global::System.DateTime? startTime = default, + global::System.DateTime? endTime = default, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsRunsClient.GetRun.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsRunsClient.GetRun.g.cs index 82b22084..2713a878 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsRunsClient.GetRun.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsRunsClient.GetRun.g.cs @@ -15,5 +15,16 @@ public partial interface IBetaWorkflowsRunsClient global::System.Guid runId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Run + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetRunAsResponseAsync( + global::System.Guid runId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsRunsClient.GetRunHistory.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsRunsClient.GetRunHistory.g.cs index 73bfdc7b..c501f887 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsRunsClient.GetRunHistory.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsRunsClient.GetRunHistory.g.cs @@ -19,5 +19,20 @@ public partial interface IBetaWorkflowsRunsClient bool? decodePayloads = default, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Run History + /// + /// + /// + /// Default Value: false + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetRunHistoryAsResponseAsync( + global::System.Guid runId, + bool? decodePayloads = default, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsRunsClient.ListRuns.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsRunsClient.ListRuns.g.cs index b8a95265..6409e308 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsRunsClient.ListRuns.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsRunsClient.ListRuns.g.cs @@ -34,5 +34,35 @@ public partial interface IBetaWorkflowsRunsClient string? nextPageToken = default, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Runs + /// + /// + /// Filter by workflow name or id + /// + /// + /// Search by workflow name, display name or id + /// + /// + /// Filter by workflow status + /// + /// + /// Number of items per page
+ /// Default Value: 50 + /// + /// + /// Token for the next page of results + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListRunsAsResponseAsync( + string? workflowIdentifier = default, + string? search = default, + global::Mistral.AnyOf, object>? status = default, + int? pageSize = default, + string? nextPageToken = default, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsSchedulesClient.GetSchedules.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsSchedulesClient.GetSchedules.g.cs index fea89023..e83c584c 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsSchedulesClient.GetSchedules.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsSchedulesClient.GetSchedules.g.cs @@ -13,5 +13,14 @@ public partial interface IBetaWorkflowsSchedulesClient global::System.Threading.Tasks.Task GetSchedulesAsync( global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Schedules + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetSchedulesAsResponseAsync( + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsSchedulesClient.ScheduleWorkflow.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsSchedulesClient.ScheduleWorkflow.g.cs index a6d615aa..3cd01893 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsSchedulesClient.ScheduleWorkflow.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsSchedulesClient.ScheduleWorkflow.g.cs @@ -21,6 +21,18 @@ public partial interface IBetaWorkflowsSchedulesClient /// /// Schedule Workflow /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ScheduleWorkflowAsResponseAsync( + + global::Mistral.WorkflowScheduleRequest request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Schedule Workflow + /// /// /// The schedule definition /// diff --git a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsSchedulesClient.UnscheduleWorkflow.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsSchedulesClient.UnscheduleWorkflow.g.cs index 264cdece..d06129c7 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsSchedulesClient.UnscheduleWorkflow.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsSchedulesClient.UnscheduleWorkflow.g.cs @@ -15,5 +15,16 @@ public partial interface IBetaWorkflowsSchedulesClient string scheduleId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Unschedule Workflow + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task UnscheduleWorkflowAsResponseAsync( + string scheduleId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsWorkersClient.GetWorkerInfo.g.cs b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsWorkersClient.GetWorkerInfo.g.cs index 650d60eb..fc6971fa 100644 --- a/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsWorkersClient.GetWorkerInfo.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IBetaWorkflowsWorkersClient.GetWorkerInfo.g.cs @@ -13,5 +13,14 @@ public partial interface IBetaWorkflowsWorkersClient global::System.Threading.Tasks.Task GetWorkerInfoAsync( global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Worker Info + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetWorkerInfoAsResponseAsync( + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IChatClient.ChatCompletion.g.cs b/src/libs/Mistral/Generated/Mistral.IChatClient.ChatCompletion.g.cs index 3ade517f..c46cec21 100644 --- a/src/libs/Mistral/Generated/Mistral.IChatClient.ChatCompletion.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IChatClient.ChatCompletion.g.cs @@ -19,6 +19,18 @@ public partial interface IChatClient /// /// Chat Completion /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ChatCompletionAsResponseAsync( + + global::Mistral.ChatCompletionRequest request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Chat Completion + /// /// /// ID of the model to use. You can use the [List Available Models](/api/#tag/models/operation/list_models_v1_models_get) API to see all of your available models, or see our [Model overview](/models) for model descriptions. /// diff --git a/src/libs/Mistral/Generated/Mistral.IClassifiersClient.ChatClassifications.g.cs b/src/libs/Mistral/Generated/Mistral.IClassifiersClient.ChatClassifications.g.cs index 71705174..4c7a56e6 100644 --- a/src/libs/Mistral/Generated/Mistral.IClassifiersClient.ChatClassifications.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IClassifiersClient.ChatClassifications.g.cs @@ -19,6 +19,18 @@ public partial interface IClassifiersClient /// /// Chat Classifications /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ChatClassificationsAsResponseAsync( + + global::Mistral.ChatClassificationRequest request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Chat Classifications + /// /// /// /// Chat to classify diff --git a/src/libs/Mistral/Generated/Mistral.IClassifiersClient.ChatModerations.g.cs b/src/libs/Mistral/Generated/Mistral.IClassifiersClient.ChatModerations.g.cs index f0a6a9f0..127db7c5 100644 --- a/src/libs/Mistral/Generated/Mistral.IClassifiersClient.ChatModerations.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IClassifiersClient.ChatModerations.g.cs @@ -19,6 +19,18 @@ public partial interface IClassifiersClient /// /// Chat Moderations /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ChatModerationsAsResponseAsync( + + global::Mistral.ChatModerationRequest request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Chat Moderations + /// /// /// Chat to classify /// diff --git a/src/libs/Mistral/Generated/Mistral.IClassifiersClient.Classifications.g.cs b/src/libs/Mistral/Generated/Mistral.IClassifiersClient.Classifications.g.cs index c990bac4..5786f012 100644 --- a/src/libs/Mistral/Generated/Mistral.IClassifiersClient.Classifications.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IClassifiersClient.Classifications.g.cs @@ -19,6 +19,18 @@ public partial interface IClassifiersClient /// /// Classifications /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ClassificationsAsResponseAsync( + + global::Mistral.ClassificationRequest request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Classifications + /// /// /// ID of the model to use. /// diff --git a/src/libs/Mistral/Generated/Mistral.IClassifiersClient.Moderations.g.cs b/src/libs/Mistral/Generated/Mistral.IClassifiersClient.Moderations.g.cs index 97f44dcc..25957259 100644 --- a/src/libs/Mistral/Generated/Mistral.IClassifiersClient.Moderations.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IClassifiersClient.Moderations.g.cs @@ -19,6 +19,18 @@ public partial interface IClassifiersClient /// /// Moderations /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ModerationsAsResponseAsync( + + global::Mistral.ClassificationRequest request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Moderations + /// /// /// ID of the model to use. /// diff --git a/src/libs/Mistral/Generated/Mistral.IDeprecatedFineTuningClient.CancelFineTuningJob.g.cs b/src/libs/Mistral/Generated/Mistral.IDeprecatedFineTuningClient.CancelFineTuningJob.g.cs index b84800b0..c7f55f1c 100644 --- a/src/libs/Mistral/Generated/Mistral.IDeprecatedFineTuningClient.CancelFineTuningJob.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IDeprecatedFineTuningClient.CancelFineTuningJob.g.cs @@ -16,5 +16,17 @@ public partial interface IDeprecatedFineTuningClient global::System.Guid jobId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Cancel Fine Tuning Job
+ /// Request the cancellation of a fine tuning job. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> CancelFineTuningJobAsResponseAsync( + global::System.Guid jobId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IDeprecatedFineTuningClient.CreateFineTuningJob.g.cs b/src/libs/Mistral/Generated/Mistral.IDeprecatedFineTuningClient.CreateFineTuningJob.g.cs index 36cef2f4..8a949cff 100644 --- a/src/libs/Mistral/Generated/Mistral.IDeprecatedFineTuningClient.CreateFineTuningJob.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IDeprecatedFineTuningClient.CreateFineTuningJob.g.cs @@ -24,6 +24,21 @@ public partial interface IDeprecatedFineTuningClient /// Create a new fine-tuning 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 + /// + global::System.Threading.Tasks.Task>> CreateFineTuningJobAsResponseAsync( + + global::Mistral.JobIn request, + bool? dryRun = default, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Create Fine Tuning Job
+ /// Create a new fine-tuning job, it will be queued for processing. + ///
+ /// /// /// /// Default Value: [] diff --git a/src/libs/Mistral/Generated/Mistral.IDeprecatedFineTuningClient.GetFineTuningJob.g.cs b/src/libs/Mistral/Generated/Mistral.IDeprecatedFineTuningClient.GetFineTuningJob.g.cs index a1e1b3e3..8703df65 100644 --- a/src/libs/Mistral/Generated/Mistral.IDeprecatedFineTuningClient.GetFineTuningJob.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IDeprecatedFineTuningClient.GetFineTuningJob.g.cs @@ -16,5 +16,17 @@ public partial interface IDeprecatedFineTuningClient global::System.Guid jobId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Fine Tuning Job
+ /// Get a fine-tuned job details by its UUID. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetFineTuningJobAsResponseAsync( + global::System.Guid jobId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IDeprecatedFineTuningClient.GetFineTuningJobs.g.cs b/src/libs/Mistral/Generated/Mistral.IDeprecatedFineTuningClient.GetFineTuningJobs.g.cs index 237c7081..6189d54c 100644 --- a/src/libs/Mistral/Generated/Mistral.IDeprecatedFineTuningClient.GetFineTuningJobs.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IDeprecatedFineTuningClient.GetFineTuningJobs.g.cs @@ -40,5 +40,41 @@ public partial interface IDeprecatedFineTuningClient string? suffix = default, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Fine Tuning Jobs
+ /// Get a list of fine-tuning jobs for your organization and user. + ///
+ /// + /// Default Value: 0 + /// + /// + /// Default Value: 100 + /// + /// + /// + /// + /// + /// Default Value: false + /// + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetFineTuningJobsAsResponseAsync( + int? page = default, + int? pageSize = default, + string? model = default, + global::System.DateTime? createdAfter = default, + global::System.DateTime? createdBefore = default, + bool? createdByMe = default, + global::Mistral.JobsApiRoutesFineTuningGetFineTuningJobsStatus2? status = default, + string? wandbProject = default, + string? wandbName = default, + string? suffix = default, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IDeprecatedFineTuningClient.StartFineTuningJob.g.cs b/src/libs/Mistral/Generated/Mistral.IDeprecatedFineTuningClient.StartFineTuningJob.g.cs index f6f8d34b..597dc7ae 100644 --- a/src/libs/Mistral/Generated/Mistral.IDeprecatedFineTuningClient.StartFineTuningJob.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IDeprecatedFineTuningClient.StartFineTuningJob.g.cs @@ -16,5 +16,17 @@ public partial interface IDeprecatedFineTuningClient global::System.Guid jobId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Start Fine Tuning Job
+ /// Request the start of a validated fine tuning job. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> StartFineTuningJobAsResponseAsync( + global::System.Guid jobId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IEmbeddingsClient.Embeddings.g.cs b/src/libs/Mistral/Generated/Mistral.IEmbeddingsClient.Embeddings.g.cs index 213679cd..a8087b45 100644 --- a/src/libs/Mistral/Generated/Mistral.IEmbeddingsClient.Embeddings.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IEmbeddingsClient.Embeddings.g.cs @@ -21,6 +21,19 @@ public partial interface IEmbeddingsClient /// Embeddings
/// Embeddings /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> EmbeddingsAsResponseAsync( + + global::Mistral.EmbeddingRequest request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Embeddings
+ /// Embeddings + ///
/// /// ID of the model to use.
/// Example: mistral-embed diff --git a/src/libs/Mistral/Generated/Mistral.IFilesClient.DeleteFile.g.cs b/src/libs/Mistral/Generated/Mistral.IFilesClient.DeleteFile.g.cs index aafe7ade..6ebe9199 100644 --- a/src/libs/Mistral/Generated/Mistral.IFilesClient.DeleteFile.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IFilesClient.DeleteFile.g.cs @@ -16,5 +16,17 @@ public partial interface IFilesClient global::System.Guid fileId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete File
+ /// Delete a file. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeleteFileAsResponseAsync( + global::System.Guid fileId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IFilesClient.DownloadFile.g.cs b/src/libs/Mistral/Generated/Mistral.IFilesClient.DownloadFile.g.cs index 106ba676..fb4183c0 100644 --- a/src/libs/Mistral/Generated/Mistral.IFilesClient.DownloadFile.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IFilesClient.DownloadFile.g.cs @@ -16,5 +16,29 @@ public partial interface IFilesClient global::System.Guid fileId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Download File
+ /// Download a file + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task DownloadFileAsStreamAsync( + global::System.Guid fileId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Download File
+ /// Download a file + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DownloadFileAsResponseAsync( + global::System.Guid fileId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IFilesClient.GetSignedUrl.g.cs b/src/libs/Mistral/Generated/Mistral.IFilesClient.GetSignedUrl.g.cs index 505695a3..05dbf4f3 100644 --- a/src/libs/Mistral/Generated/Mistral.IFilesClient.GetSignedUrl.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IFilesClient.GetSignedUrl.g.cs @@ -20,5 +20,21 @@ public partial interface IFilesClient int? expiry = default, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Get Signed Url + /// + /// + /// + /// Number of hours before the url becomes invalid. Defaults to 24h
+ /// Default Value: 24 + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> GetSignedUrlAsResponseAsync( + global::System.Guid fileId, + int? expiry = default, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IFilesClient.ListFiles.g.cs b/src/libs/Mistral/Generated/Mistral.IFilesClient.ListFiles.g.cs index 37089876..de30bc9c 100644 --- a/src/libs/Mistral/Generated/Mistral.IFilesClient.ListFiles.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IFilesClient.ListFiles.g.cs @@ -36,5 +36,37 @@ public partial interface IFilesClient global::System.Collections.Generic.IList? mimetypes = default, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Files
+ /// Returns a list of files that belong to the user's organization. + ///
+ /// + /// Default Value: 0 + /// + /// + /// Default Value: 100 + /// + /// + /// Default Value: true + /// + /// + /// + /// + /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListFilesAsResponseAsync( + int? page = default, + int? pageSize = default, + bool? includeTotal = default, + global::System.Collections.Generic.IList? sampleType = default, + global::System.Collections.Generic.IList? source = default, + string? search = default, + global::Mistral.FilePurpose? purpose = default, + global::System.Collections.Generic.IList? mimetypes = default, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IFilesClient.RetrieveFile.g.cs b/src/libs/Mistral/Generated/Mistral.IFilesClient.RetrieveFile.g.cs index 07fa2157..936defa2 100644 --- a/src/libs/Mistral/Generated/Mistral.IFilesClient.RetrieveFile.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IFilesClient.RetrieveFile.g.cs @@ -16,5 +16,17 @@ public partial interface IFilesClient global::System.Guid fileId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Retrieve File
+ /// Returns information about a specific file. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> RetrieveFileAsResponseAsync( + global::System.Guid fileId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IFilesClient.UploadFile.g.cs b/src/libs/Mistral/Generated/Mistral.IFilesClient.UploadFile.g.cs index c23ea2b5..67dda078 100644 --- a/src/libs/Mistral/Generated/Mistral.IFilesClient.UploadFile.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IFilesClient.UploadFile.g.cs @@ -25,6 +25,21 @@ public partial interface IFilesClient /// The size of individual files can be a maximum of 512 MB. The Fine-tuning API only supports .jsonl files.
/// Please contact us if you need to increase these storage limits. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UploadFileAsResponseAsync( + + global::Mistral.FilesApiRoutesUploadFileRequest request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Upload File
+ /// Upload a file that can be used across various endpoints.
+ /// The size of individual files can be a maximum of 512 MB. The Fine-tuning API only supports .jsonl files.
+ /// Please contact us if you need to increase these storage limits. + ///
/// /// /// Default Value: workspace @@ -63,5 +78,94 @@ public partial interface IFilesClient global::Mistral.FilePurpose? purpose = default, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + + /// + /// Upload File
+ /// Upload a file that can be used across various endpoints.
+ /// The size of individual files can be a maximum of 512 MB. The Fine-tuning API only supports .jsonl files.
+ /// Please contact us if you need to increase these storage limits. + ///
+ /// + /// + /// Default Value: workspace + /// + /// + /// + /// 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 + /// + global::System.Threading.Tasks.Task UploadFileAsync( + global::System.IO.Stream file, + string filename, + int? expiry = default, + global::Mistral.FilesApiRoutesUploadFileRequestVisibility? visibility = default, + global::Mistral.FilePurpose? purpose = default, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Upload File
+ /// Upload a file that can be used across various endpoints.
+ /// The size of individual files can be a maximum of 512 MB. The Fine-tuning API only supports .jsonl files.
+ /// Please contact us if you need to increase these storage limits. + ///
+ /// + /// + /// Default Value: workspace + /// + /// + /// + /// 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 + /// + global::System.Threading.Tasks.Task> UploadFileAsResponseAsync( + global::System.IO.Stream file, + string filename, + int? expiry = default, + global::Mistral.FilesApiRoutesUploadFileRequestVisibility? visibility = default, + global::Mistral.FilePurpose? purpose = default, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IFimClient.FimCompletion.g.cs b/src/libs/Mistral/Generated/Mistral.IFimClient.FimCompletion.g.cs index a371671a..a0b0326e 100644 --- a/src/libs/Mistral/Generated/Mistral.IFimClient.FimCompletion.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IFimClient.FimCompletion.g.cs @@ -21,6 +21,19 @@ public partial interface IFimClient /// Fim Completion
/// FIM completion. /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> FimCompletionAsResponseAsync( + + global::Mistral.FIMCompletionRequest request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Fim Completion
+ /// FIM completion. + ///
/// /// ID of the model with FIM to use.
/// Default Value: codestral-2404 diff --git a/src/libs/Mistral/Generated/Mistral.IModelsClient.ArchiveFineTunedModel.g.cs b/src/libs/Mistral/Generated/Mistral.IModelsClient.ArchiveFineTunedModel.g.cs index 43a3b051..962d9529 100644 --- a/src/libs/Mistral/Generated/Mistral.IModelsClient.ArchiveFineTunedModel.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IModelsClient.ArchiveFineTunedModel.g.cs @@ -16,5 +16,17 @@ public partial interface IModelsClient string modelId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Archive Fine Tuned Model
+ /// Archive a fine-tuned model. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ArchiveFineTunedModelAsResponseAsync( + string modelId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IModelsClient.DeleteModel.g.cs b/src/libs/Mistral/Generated/Mistral.IModelsClient.DeleteModel.g.cs index c2ece236..f6c3b7e4 100644 --- a/src/libs/Mistral/Generated/Mistral.IModelsClient.DeleteModel.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IModelsClient.DeleteModel.g.cs @@ -16,5 +16,17 @@ public partial interface IModelsClient string modelId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Delete Model
+ /// Delete a fine-tuned model. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> DeleteModelAsResponseAsync( + string modelId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IModelsClient.ListModels.g.cs b/src/libs/Mistral/Generated/Mistral.IModelsClient.ListModels.g.cs index e8e27502..7932d71c 100644 --- a/src/libs/Mistral/Generated/Mistral.IModelsClient.ListModels.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IModelsClient.ListModels.g.cs @@ -18,5 +18,19 @@ public partial interface IModelsClient string? model = default, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// List Models
+ /// List all models available to the user. + ///
+ /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> ListModelsAsResponseAsync( + string? provider = default, + string? model = default, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IModelsClient.RetrieveModel.g.cs b/src/libs/Mistral/Generated/Mistral.IModelsClient.RetrieveModel.g.cs index d0fb4f98..e7627784 100644 --- a/src/libs/Mistral/Generated/Mistral.IModelsClient.RetrieveModel.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IModelsClient.RetrieveModel.g.cs @@ -16,5 +16,17 @@ public partial interface IModelsClient string modelId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Retrieve Model
+ /// Retrieve information about a model. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> RetrieveModelAsResponseAsync( + string modelId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IModelsClient.UnarchiveFineTunedModel.g.cs b/src/libs/Mistral/Generated/Mistral.IModelsClient.UnarchiveFineTunedModel.g.cs index af89ffa1..10e0e24d 100644 --- a/src/libs/Mistral/Generated/Mistral.IModelsClient.UnarchiveFineTunedModel.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IModelsClient.UnarchiveFineTunedModel.g.cs @@ -16,5 +16,17 @@ public partial interface IModelsClient string modelId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Unarchive Fine Tuned Model
+ /// Un-archive a fine-tuned model. + ///
+ /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UnarchiveFineTunedModelAsResponseAsync( + string modelId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); } } \ No newline at end of file diff --git a/src/libs/Mistral/Generated/Mistral.IModelsClient.UpdateFineTunedModel.g.cs b/src/libs/Mistral/Generated/Mistral.IModelsClient.UpdateFineTunedModel.g.cs index 56fcede6..9b6514bb 100644 --- a/src/libs/Mistral/Generated/Mistral.IModelsClient.UpdateFineTunedModel.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IModelsClient.UpdateFineTunedModel.g.cs @@ -24,6 +24,21 @@ public partial interface IModelsClient /// Update a model name or description. /// /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> UpdateFineTunedModelAsResponseAsync( + string modelId, + + global::Mistral.UpdateFTModelIn request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// Update Fine Tuned Model
+ /// Update a model name or description. + ///
+ /// /// /// /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. diff --git a/src/libs/Mistral/Generated/Mistral.IOcrClient.Ocr.g.cs b/src/libs/Mistral/Generated/Mistral.IOcrClient.Ocr.g.cs index adf2c634..fe4ef1bb 100644 --- a/src/libs/Mistral/Generated/Mistral.IOcrClient.Ocr.g.cs +++ b/src/libs/Mistral/Generated/Mistral.IOcrClient.Ocr.g.cs @@ -19,6 +19,18 @@ public partial interface IOcrClient /// /// OCR /// + /// + /// Per-request overrides such as headers, query parameters, timeout, retries, and response buffering. + /// The token to cancel the operation with + /// + global::System.Threading.Tasks.Task> OcrAsResponseAsync( + + global::Mistral.OCRRequest request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default); + /// + /// OCR + /// /// /// /// diff --git a/src/libs/Mistral/Generated/Mistral.MistralClient.g.cs b/src/libs/Mistral/Generated/Mistral.MistralClient.g.cs index b00da6a5..c4800cc8 100644 --- a/src/libs/Mistral/Generated/Mistral.MistralClient.g.cs +++ b/src/libs/Mistral/Generated/Mistral.MistralClient.g.cs @@ -43,7 +43,7 @@ public sealed partial class MistralClient : global::Mistral.IMistralClient, glob /// /// Speech API. API for text-to-speech generation. /// - public AudioSpeechClient AudioSpeech => new AudioSpeechClient(HttpClient, authorizations: Authorizations, options: Options) + public AudioSpeechClient AudioSpeech => new AudioSpeechClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -52,7 +52,7 @@ public sealed partial class MistralClient : global::Mistral.IMistralClient, glob /// /// Transcriptions API. API for audio transcription. /// - public AudioTranscriptionsClient AudioTranscriptions => new AudioTranscriptionsClient(HttpClient, authorizations: Authorizations, options: Options) + public AudioTranscriptionsClient AudioTranscriptions => new AudioTranscriptionsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -61,7 +61,7 @@ public sealed partial class MistralClient : global::Mistral.IMistralClient, glob /// /// Voices API. API for managing custom voice profiles. /// - public AudioVoicesClient AudioVoices => new AudioVoicesClient(HttpClient, authorizations: Authorizations, options: Options) + public AudioVoicesClient AudioVoices => new AudioVoicesClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -70,7 +70,7 @@ public sealed partial class MistralClient : global::Mistral.IMistralClient, glob /// /// Batch. Batch API. /// - public BatchClient Batch => new BatchClient(HttpClient, authorizations: Authorizations, options: Options) + public BatchClient Batch => new BatchClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -79,7 +79,7 @@ public sealed partial class MistralClient : global::Mistral.IMistralClient, glob /// /// (beta) Agents API. /// - public BetaAgentsClient BetaAgents => new BetaAgentsClient(HttpClient, authorizations: Authorizations, options: Options) + public BetaAgentsClient BetaAgents => new BetaAgentsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -88,7 +88,7 @@ public sealed partial class MistralClient : global::Mistral.IMistralClient, glob /// /// (beta) Conversations API. /// - public BetaConversationsClient BetaConversations => new BetaConversationsClient(HttpClient, authorizations: Authorizations, options: Options) + public BetaConversationsClient BetaConversations => new BetaConversationsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -97,7 +97,7 @@ public sealed partial class MistralClient : global::Mistral.IMistralClient, glob /// /// (beta) Libraries API - Main. (beta) Libraries API to create and manage libraries - index your documents to enhance agent capabilities. /// - public BetaLibrariesClient BetaLibraries => new BetaLibrariesClient(HttpClient, authorizations: Authorizations, options: Options) + public BetaLibrariesClient BetaLibraries => new BetaLibrariesClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -106,7 +106,7 @@ public sealed partial class MistralClient : global::Mistral.IMistralClient, glob /// /// (beta) Libraries API - Access. (beta) Libraries API - manage access to a library. /// - public BetaLibrariesAccessesClient BetaLibrariesAccesses => new BetaLibrariesAccessesClient(HttpClient, authorizations: Authorizations, options: Options) + public BetaLibrariesAccessesClient BetaLibrariesAccesses => new BetaLibrariesAccessesClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -115,7 +115,7 @@ public sealed partial class MistralClient : global::Mistral.IMistralClient, glob /// /// (beta) Libraries API - Documents. (beta) Libraries API - manage documents in a library. /// - public BetaLibrariesDocumentsClient BetaLibrariesDocuments => new BetaLibrariesDocumentsClient(HttpClient, authorizations: Authorizations, options: Options) + public BetaLibrariesDocumentsClient BetaLibrariesDocuments => new BetaLibrariesDocumentsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -124,7 +124,7 @@ public sealed partial class MistralClient : global::Mistral.IMistralClient, glob /// /// (beta) Observability - Campaigns. (beta) Create and manage evaluation campaigns. /// - public BetaObservabilityCampaignsClient BetaObservabilityCampaigns => new BetaObservabilityCampaignsClient(HttpClient, authorizations: Authorizations, options: Options) + public BetaObservabilityCampaignsClient BetaObservabilityCampaigns => new BetaObservabilityCampaignsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -133,7 +133,7 @@ public sealed partial class MistralClient : global::Mistral.IMistralClient, glob /// /// (beta) Observability - Chat completion events. (beta) Search, retrieve, and analyze chat completion events. /// - public BetaObservabilityChatCompletionEventsClient BetaObservabilityChatCompletionEvents => new BetaObservabilityChatCompletionEventsClient(HttpClient, authorizations: Authorizations, options: Options) + public BetaObservabilityChatCompletionEventsClient BetaObservabilityChatCompletionEvents => new BetaObservabilityChatCompletionEventsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -142,7 +142,7 @@ public sealed partial class MistralClient : global::Mistral.IMistralClient, glob /// /// (beta) Observability - Chat completion fields. (beta) List and inspect filterable fields for chat completion events. /// - public BetaObservabilityChatCompletionEventsFieldsClient BetaObservabilityChatCompletionEventsFields => new BetaObservabilityChatCompletionEventsFieldsClient(HttpClient, authorizations: Authorizations, options: Options) + public BetaObservabilityChatCompletionEventsFieldsClient BetaObservabilityChatCompletionEventsFields => new BetaObservabilityChatCompletionEventsFieldsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -151,7 +151,7 @@ public sealed partial class MistralClient : global::Mistral.IMistralClient, glob /// /// (beta) Observability - Datasets. (beta) Create, update, import, and export datasets. /// - public BetaObservabilityDatasetsClient BetaObservabilityDatasets => new BetaObservabilityDatasetsClient(HttpClient, authorizations: Authorizations, options: Options) + public BetaObservabilityDatasetsClient BetaObservabilityDatasets => new BetaObservabilityDatasetsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -160,7 +160,7 @@ public sealed partial class MistralClient : global::Mistral.IMistralClient, glob /// /// (beta) Observability - Dataset records. (beta) Manage individual records within datasets. /// - public BetaObservabilityDatasetsRecordsClient BetaObservabilityDatasetsRecords => new BetaObservabilityDatasetsRecordsClient(HttpClient, authorizations: Authorizations, options: Options) + public BetaObservabilityDatasetsRecordsClient BetaObservabilityDatasetsRecords => new BetaObservabilityDatasetsRecordsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -169,7 +169,7 @@ public sealed partial class MistralClient : global::Mistral.IMistralClient, glob /// /// (beta) Observability - Judges. (beta) Create, update, and manage judges for evaluating chat completions. /// - public BetaObservabilityJudgesClient BetaObservabilityJudges => new BetaObservabilityJudgesClient(HttpClient, authorizations: Authorizations, options: Options) + public BetaObservabilityJudgesClient BetaObservabilityJudges => new BetaObservabilityJudgesClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -178,7 +178,7 @@ public sealed partial class MistralClient : global::Mistral.IMistralClient, glob /// /// Workflows. Workflow management API. /// - public BetaWorkflowsClient BetaWorkflows => new BetaWorkflowsClient(HttpClient, authorizations: Authorizations, options: Options) + public BetaWorkflowsClient BetaWorkflows => new BetaWorkflowsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -187,7 +187,7 @@ public sealed partial class MistralClient : global::Mistral.IMistralClient, glob /// /// Deployments. List and inspect worker deployments. /// - public BetaWorkflowsDeploymentsClient BetaWorkflowsDeployments => new BetaWorkflowsDeploymentsClient(HttpClient, authorizations: Authorizations, options: Options) + public BetaWorkflowsDeploymentsClient BetaWorkflowsDeployments => new BetaWorkflowsDeploymentsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -196,7 +196,7 @@ public sealed partial class MistralClient : global::Mistral.IMistralClient, glob /// /// Events. Stream and list workflow execution events. /// - public BetaWorkflowsEventsClient BetaWorkflowsEvents => new BetaWorkflowsEventsClient(HttpClient, authorizations: Authorizations, options: Options) + public BetaWorkflowsEventsClient BetaWorkflowsEvents => new BetaWorkflowsEventsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -205,7 +205,7 @@ public sealed partial class MistralClient : global::Mistral.IMistralClient, glob /// /// Executions. Trigger, monitor, and control workflow executions. /// - public BetaWorkflowsExecutionsClient BetaWorkflowsExecutions => new BetaWorkflowsExecutionsClient(HttpClient, authorizations: Authorizations, options: Options) + public BetaWorkflowsExecutionsClient BetaWorkflowsExecutions => new BetaWorkflowsExecutionsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -214,7 +214,7 @@ public sealed partial class MistralClient : global::Mistral.IMistralClient, glob /// /// Metrics. Get performance metrics for workflows. /// - public BetaWorkflowsMetricsClient BetaWorkflowsMetrics => new BetaWorkflowsMetricsClient(HttpClient, authorizations: Authorizations, options: Options) + public BetaWorkflowsMetricsClient BetaWorkflowsMetrics => new BetaWorkflowsMetricsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -223,7 +223,7 @@ public sealed partial class MistralClient : global::Mistral.IMistralClient, glob /// /// Runs. List and inspect individual workflow runs. /// - public BetaWorkflowsRunsClient BetaWorkflowsRuns => new BetaWorkflowsRunsClient(HttpClient, authorizations: Authorizations, options: Options) + public BetaWorkflowsRunsClient BetaWorkflowsRuns => new BetaWorkflowsRunsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -232,7 +232,7 @@ public sealed partial class MistralClient : global::Mistral.IMistralClient, glob /// /// Schedules. Create and manage workflow schedules. /// - public BetaWorkflowsSchedulesClient BetaWorkflowsSchedules => new BetaWorkflowsSchedulesClient(HttpClient, authorizations: Authorizations, options: Options) + public BetaWorkflowsSchedulesClient BetaWorkflowsSchedules => new BetaWorkflowsSchedulesClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -241,7 +241,7 @@ public sealed partial class MistralClient : global::Mistral.IMistralClient, glob /// /// Workers. Worker connection info. /// - public BetaWorkflowsWorkersClient BetaWorkflowsWorkers => new BetaWorkflowsWorkersClient(HttpClient, authorizations: Authorizations, options: Options) + public BetaWorkflowsWorkersClient BetaWorkflowsWorkers => new BetaWorkflowsWorkersClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -250,7 +250,7 @@ public sealed partial class MistralClient : global::Mistral.IMistralClient, glob /// /// Chat. Chat Completion API. /// - public ChatClient Chat => new ChatClient(HttpClient, authorizations: Authorizations, options: Options) + public ChatClient Chat => new ChatClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -259,7 +259,7 @@ public sealed partial class MistralClient : global::Mistral.IMistralClient, glob /// /// Classifiers. Classifiers API. /// - public ClassifiersClient Classifiers => new ClassifiersClient(HttpClient, authorizations: Authorizations, options: Options) + public ClassifiersClient Classifiers => new ClassifiersClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -268,7 +268,7 @@ public sealed partial class MistralClient : global::Mistral.IMistralClient, glob /// /// (deprecated) Fine Tuning. (deprecated) Fine-tuning API. /// - public DeprecatedFineTuningClient DeprecatedFineTuning => new DeprecatedFineTuningClient(HttpClient, authorizations: Authorizations, options: Options) + public DeprecatedFineTuningClient DeprecatedFineTuning => new DeprecatedFineTuningClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -277,7 +277,7 @@ public sealed partial class MistralClient : global::Mistral.IMistralClient, glob /// /// Embeddings. Embeddings API. /// - public EmbeddingsClient Embeddings => new EmbeddingsClient(HttpClient, authorizations: Authorizations, options: Options) + public EmbeddingsClient Embeddings => new EmbeddingsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -286,7 +286,7 @@ public sealed partial class MistralClient : global::Mistral.IMistralClient, glob /// /// Files. Files API. /// - public FilesClient Files => new FilesClient(HttpClient, authorizations: Authorizations, options: Options) + public FilesClient Files => new FilesClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -295,7 +295,7 @@ public sealed partial class MistralClient : global::Mistral.IMistralClient, glob /// /// FIM. Fill-in-the-middle API. /// - public FimClient Fim => new FimClient(HttpClient, authorizations: Authorizations, options: Options) + public FimClient Fim => new FimClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -304,7 +304,7 @@ public sealed partial class MistralClient : global::Mistral.IMistralClient, glob /// /// Models. Model Management API. /// - public ModelsClient Models => new ModelsClient(HttpClient, authorizations: Authorizations, options: Options) + public ModelsClient Models => new ModelsClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -313,7 +313,7 @@ public sealed partial class MistralClient : global::Mistral.IMistralClient, glob /// /// OCR API. /// - public OcrClient Ocr => new OcrClient(HttpClient, authorizations: Authorizations, options: Options) + public OcrClient Ocr => new OcrClient(HttpClient, baseUri: null, authorizations: Authorizations, options: Options) { ReadResponseAsString = ReadResponseAsString, JsonSerializerContext = JsonSerializerContext, @@ -352,10 +352,10 @@ public MistralClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public MistralClient( - 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.ModelsClient.ArchiveFineTunedModel.g.cs b/src/libs/Mistral/Generated/Mistral.ModelsClient.ArchiveFineTunedModel.g.cs index b3655e77..129b5686 100644 --- a/src/libs/Mistral/Generated/Mistral.ModelsClient.ArchiveFineTunedModel.g.cs +++ b/src/libs/Mistral/Generated/Mistral.ModelsClient.ArchiveFineTunedModel.g.cs @@ -53,6 +53,27 @@ partial void ProcessArchiveFineTunedModelResponseContent( string modelId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ArchiveFineTunedModelAsResponseAsync( + modelId: modelId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Archive Fine Tuned Model
+ /// Archive a fine-tuned model. + ///
+ /// + /// 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> ArchiveFineTunedModelAsResponseAsync( + string modelId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -82,6 +103,7 @@ partial void ProcessArchiveFineTunedModelResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/fine_tuning/models/{modelId}/archive", baseUri: HttpClient.BaseAddress); @@ -155,6 +177,8 @@ partial void ProcessArchiveFineTunedModelResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -165,6 +189,11 @@ partial void ProcessArchiveFineTunedModelResponseContent( } 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 ProcessArchiveFineTunedModelResponseContent( 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 ProcessArchiveFineTunedModelResponseContent( __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 ProcessArchiveFineTunedModelResponseContent( __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 ProcessArchiveFineTunedModelResponseContent( 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 ProcessArchiveFineTunedModelResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -284,6 +322,8 @@ partial void ProcessArchiveFineTunedModelResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -308,9 +348,13 @@ partial void ProcessArchiveFineTunedModelResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.ArchiveFTModelOut.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.ArchiveFTModelOut.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 ProcessArchiveFineTunedModelResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.ArchiveFTModelOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.ArchiveFTModelOut.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.ModelsClient.DeleteModel.g.cs b/src/libs/Mistral/Generated/Mistral.ModelsClient.DeleteModel.g.cs index cb2071b8..b4cc192f 100644 --- a/src/libs/Mistral/Generated/Mistral.ModelsClient.DeleteModel.g.cs +++ b/src/libs/Mistral/Generated/Mistral.ModelsClient.DeleteModel.g.cs @@ -53,6 +53,27 @@ partial void ProcessDeleteModelResponseContent( string modelId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await DeleteModelAsResponseAsync( + modelId: modelId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Delete Model
+ /// Delete a fine-tuned model. + ///
+ /// + /// 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> DeleteModelAsResponseAsync( + string modelId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -82,6 +103,7 @@ partial void ProcessDeleteModelResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/models/{modelId}", baseUri: HttpClient.BaseAddress); @@ -155,6 +177,8 @@ partial void ProcessDeleteModelResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -165,6 +189,11 @@ partial void ProcessDeleteModelResponseContent( } 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 ProcessDeleteModelResponseContent( 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 ProcessDeleteModelResponseContent( __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 ProcessDeleteModelResponseContent( __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 ProcessDeleteModelResponseContent( 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 ProcessDeleteModelResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -284,6 +322,8 @@ partial void ProcessDeleteModelResponseContent( 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 ProcessDeleteModelResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.DeleteModelOut.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.DeleteModelOut.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 ProcessDeleteModelResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.DeleteModelOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.DeleteModelOut.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.ModelsClient.ListModels.g.cs b/src/libs/Mistral/Generated/Mistral.ModelsClient.ListModels.g.cs index 14b59d69..29f61616 100644 --- a/src/libs/Mistral/Generated/Mistral.ModelsClient.ListModels.g.cs +++ b/src/libs/Mistral/Generated/Mistral.ModelsClient.ListModels.g.cs @@ -57,6 +57,30 @@ partial void ProcessListModelsResponseContent( string? model = default, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await ListModelsAsResponseAsync( + provider: provider, + model: model, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// List Models
+ /// List all models available to the user. + ///
+ /// + /// + /// 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> ListModelsAsResponseAsync( + string? provider = default, + string? model = default, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -87,12 +111,13 @@ partial void ProcessListModelsResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: "/v1/models", - baseUri: HttpClient.BaseAddress); + baseUri: HttpClient.BaseAddress); __pathBuilder .AddOptionalParameter("provider", provider) - .AddOptionalParameter("model", model) + .AddOptionalParameter("model", model) ; var __path = __pathBuilder.ToString(); __path = global::Mistral.AutoSDKRequestOptionsSupport.AppendQueryParameters( @@ -165,6 +190,8 @@ partial void ProcessListModelsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -175,6 +202,11 @@ partial void ProcessListModelsResponseContent( } 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 +224,8 @@ partial void ProcessListModelsResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: __willRetry, + retryDelay: __willRetry ? __retryDelay : (global::System.TimeSpan?)null, + retryReason: "exception", cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); if (!__willRetry) { @@ -201,8 +235,7 @@ partial void ProcessListModelsResponseContent( __httpRequest.Dispose(); __httpRequest = null; await global::Mistral.AutoSDKRequestOptionsSupport.DelayBeforeRetryAsync( - clientOptions: Options, - requestOptions: requestOptions, + retryDelay: __retryDelay, cancellationToken: __effectiveCancellationToken).ConfigureAwait(false); continue; } @@ -211,6 +244,11 @@ partial void ProcessListModelsResponseContent( __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 +265,15 @@ partial void ProcessListModelsResponseContent( 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 +313,8 @@ partial void ProcessListModelsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -294,6 +335,8 @@ partial void ProcessListModelsResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -356,9 +399,13 @@ partial void ProcessListModelsResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.ModelList.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.ModelList.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) { @@ -386,9 +433,13 @@ partial void ProcessListModelsResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.ModelList.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.ModelList.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.ModelsClient.RetrieveModel.g.cs b/src/libs/Mistral/Generated/Mistral.ModelsClient.RetrieveModel.g.cs index 49c60856..26fd3af7 100644 --- a/src/libs/Mistral/Generated/Mistral.ModelsClient.RetrieveModel.g.cs +++ b/src/libs/Mistral/Generated/Mistral.ModelsClient.RetrieveModel.g.cs @@ -53,6 +53,27 @@ partial void ProcessRetrieveModelResponseContent( string modelId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await RetrieveModelAsResponseAsync( + modelId: modelId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Retrieve Model
+ /// Retrieve information about a model. + ///
+ /// + /// 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> RetrieveModelAsResponseAsync( + string modelId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -82,6 +103,7 @@ partial void ProcessRetrieveModelResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/models/{modelId}", baseUri: HttpClient.BaseAddress); @@ -155,6 +177,8 @@ partial void ProcessRetrieveModelResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -165,6 +189,11 @@ partial void ProcessRetrieveModelResponseContent( } 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 ProcessRetrieveModelResponseContent( 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 ProcessRetrieveModelResponseContent( __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 ProcessRetrieveModelResponseContent( __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 ProcessRetrieveModelResponseContent( 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 ProcessRetrieveModelResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -284,6 +322,8 @@ partial void ProcessRetrieveModelResponseContent( 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 ProcessRetrieveModelResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.RetrieveModelV1ModelsModelIdGetResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.RetrieveModelV1ModelsModelIdGetResponse.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 ProcessRetrieveModelResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.RetrieveModelV1ModelsModelIdGetResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.RetrieveModelV1ModelsModelIdGetResponse.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.ModelsClient.UnarchiveFineTunedModel.g.cs b/src/libs/Mistral/Generated/Mistral.ModelsClient.UnarchiveFineTunedModel.g.cs index 21b8c9a0..846298e8 100644 --- a/src/libs/Mistral/Generated/Mistral.ModelsClient.UnarchiveFineTunedModel.g.cs +++ b/src/libs/Mistral/Generated/Mistral.ModelsClient.UnarchiveFineTunedModel.g.cs @@ -53,6 +53,27 @@ partial void ProcessUnarchiveFineTunedModelResponseContent( string modelId, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UnarchiveFineTunedModelAsResponseAsync( + modelId: modelId, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Unarchive Fine Tuned Model
+ /// Un-archive a fine-tuned model. + ///
+ /// + /// 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> UnarchiveFineTunedModelAsResponseAsync( + string modelId, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) { PrepareArguments( client: HttpClient); @@ -82,6 +103,7 @@ partial void ProcessUnarchiveFineTunedModelResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/fine_tuning/models/{modelId}/archive", baseUri: HttpClient.BaseAddress); @@ -155,6 +177,8 @@ partial void ProcessUnarchiveFineTunedModelResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -165,6 +189,11 @@ partial void ProcessUnarchiveFineTunedModelResponseContent( } 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 ProcessUnarchiveFineTunedModelResponseContent( 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 ProcessUnarchiveFineTunedModelResponseContent( __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 ProcessUnarchiveFineTunedModelResponseContent( __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 ProcessUnarchiveFineTunedModelResponseContent( 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 ProcessUnarchiveFineTunedModelResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -284,6 +322,8 @@ partial void ProcessUnarchiveFineTunedModelResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -308,9 +348,13 @@ partial void ProcessUnarchiveFineTunedModelResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.UnarchiveFTModelOut.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.UnarchiveFTModelOut.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 ProcessUnarchiveFineTunedModelResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.UnarchiveFTModelOut.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.UnarchiveFTModelOut.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.ModelsClient.UpdateFineTunedModel.g.cs b/src/libs/Mistral/Generated/Mistral.ModelsClient.UpdateFineTunedModel.g.cs index af4981d1..7899905c 100644 --- a/src/libs/Mistral/Generated/Mistral.ModelsClient.UpdateFineTunedModel.g.cs +++ b/src/libs/Mistral/Generated/Mistral.ModelsClient.UpdateFineTunedModel.g.cs @@ -55,6 +55,32 @@ partial void ProcessUpdateFineTunedModelResponseContent( public async global::System.Threading.Tasks.Task UpdateFineTunedModelAsync( string modelId, + global::Mistral.UpdateFTModelIn request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await UpdateFineTunedModelAsResponseAsync( + modelId: modelId, + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// Update Fine Tuned Model
+ /// Update a model name or 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> UpdateFineTunedModelAsResponseAsync( + string modelId, + global::Mistral.UpdateFTModelIn request, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -90,6 +116,7 @@ partial void ProcessUpdateFineTunedModelResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: $"/v1/fine_tuning/models/{modelId}", baseUri: HttpClient.BaseAddress); @@ -170,6 +197,8 @@ partial void ProcessUpdateFineTunedModelResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -180,6 +209,11 @@ partial void ProcessUpdateFineTunedModelResponseContent( } 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 ProcessUpdateFineTunedModelResponseContent( 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 ProcessUpdateFineTunedModelResponseContent( __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 ProcessUpdateFineTunedModelResponseContent( __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 ProcessUpdateFineTunedModelResponseContent( 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 ProcessUpdateFineTunedModelResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -299,6 +342,8 @@ partial void ProcessUpdateFineTunedModelResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } @@ -323,9 +368,13 @@ partial void ProcessUpdateFineTunedModelResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.JobsApiRoutesFineTuningUpdateFineTunedModelResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.JobsApiRoutesFineTuningUpdateFineTunedModelResponse.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) { @@ -353,9 +402,13 @@ partial void ProcessUpdateFineTunedModelResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.JobsApiRoutesFineTuningUpdateFineTunedModelResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.JobsApiRoutesFineTuningUpdateFineTunedModelResponse.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.ModelsClient.g.cs b/src/libs/Mistral/Generated/Mistral.ModelsClient.g.cs index c68ddaa6..ca89c47a 100644 --- a/src/libs/Mistral/Generated/Mistral.ModelsClient.g.cs +++ b/src/libs/Mistral/Generated/Mistral.ModelsClient.g.cs @@ -73,10 +73,10 @@ public ModelsClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public ModelsClient( - 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.OcrClient.Ocr.g.cs b/src/libs/Mistral/Generated/Mistral.OcrClient.Ocr.g.cs index d448964c..0059a3ed 100644 --- a/src/libs/Mistral/Generated/Mistral.OcrClient.Ocr.g.cs +++ b/src/libs/Mistral/Generated/Mistral.OcrClient.Ocr.g.cs @@ -50,6 +50,28 @@ partial void ProcessOcrResponseContent( /// public async global::System.Threading.Tasks.Task OcrAsync( + global::Mistral.OCRRequest request, + global::Mistral.AutoSDKRequestOptions? requestOptions = default, + global::System.Threading.CancellationToken cancellationToken = default) + { + var __response = await OcrAsResponseAsync( + + request: request, + requestOptions: requestOptions, + cancellationToken: cancellationToken + ).ConfigureAwait(false); + + return __response.Body; + } + /// + /// 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> OcrAsResponseAsync( + global::Mistral.OCRRequest request, global::Mistral.AutoSDKRequestOptions? requestOptions = default, global::System.Threading.CancellationToken cancellationToken = default) @@ -84,6 +106,7 @@ partial void ProcessOcrResponseContent( global::System.Net.Http.HttpRequestMessage __CreateHttpRequest() { + var __pathBuilder = new global::Mistral.PathBuilder( path: "/v1/ocr", baseUri: HttpClient.BaseAddress); @@ -163,6 +186,8 @@ partial void ProcessOcrResponseContent( attempt: __attempt, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); try { @@ -173,6 +198,11 @@ partial void ProcessOcrResponseContent( } 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 ProcessOcrResponseContent( 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 ProcessOcrResponseContent( __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 ProcessOcrResponseContent( __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 ProcessOcrResponseContent( 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 ProcessOcrResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } else @@ -292,6 +331,8 @@ partial void ProcessOcrResponseContent( attempt: __attemptNumber, maxAttempts: __maxAttempts, willRetry: false, + retryDelay: null, + retryReason: global::System.String.Empty, cancellationToken: __effectiveCancellationToken)).ConfigureAwait(false); } // Validation Error @@ -354,9 +395,13 @@ partial void ProcessOcrResponseContent( { __response.EnsureSuccessStatusCode(); - return - global::Mistral.OCRResponse.FromJson(__content, JsonSerializerContext) ?? + var __value = global::Mistral.OCRResponse.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) { @@ -384,9 +429,13 @@ partial void ProcessOcrResponseContent( #endif ).ConfigureAwait(false); - return - await global::Mistral.OCRResponse.FromJsonStreamAsync(__content, JsonSerializerContext).ConfigureAwait(false) ?? + var __value = await global::Mistral.OCRResponse.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.OcrClient.g.cs b/src/libs/Mistral/Generated/Mistral.OcrClient.g.cs index a0141556..72fe709b 100644 --- a/src/libs/Mistral/Generated/Mistral.OcrClient.g.cs +++ b/src/libs/Mistral/Generated/Mistral.OcrClient.g.cs @@ -73,10 +73,10 @@ public OcrClient( /// Client-wide request defaults such as headers, query parameters, retries, and timeout. /// Dispose the HttpClient when the instance is disposed. True by default. public OcrClient( - 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.OptionsSupport.g.cs b/src/libs/Mistral/Generated/Mistral.OptionsSupport.g.cs index ee6b8f3c..d5802240 100644 --- a/src/libs/Mistral/Generated/Mistral.OptionsSupport.g.cs +++ b/src/libs/Mistral/Generated/Mistral.OptionsSupport.g.cs @@ -101,9 +101,45 @@ public sealed class AutoSDKRetryOptions public int MaxAttempts { get; set; } = 1; /// - /// Optional fixed delay between retry attempts. + /// Optional fixed delay between retry attempts. When set, this takes precedence over exponential backoff. /// public global::System.TimeSpan? Delay { get; set; } + + /// + /// Initial exponential backoff delay used when is not set. + /// + public global::System.TimeSpan InitialDelay { get; set; } = global::System.TimeSpan.FromSeconds(1); + + /// + /// Maximum retry delay after applying retry headers, backoff, and jitter. + /// + public global::System.TimeSpan MaxDelay { get; set; } = global::System.TimeSpan.FromSeconds(30); + + /// + /// Multiplier applied to exponential backoff after each failed attempt. + /// Values below 1 are normalized to 1. + /// + public double BackoffMultiplier { get; set; } = 2D; + + /// + /// Randomizes computed backoff by plus or minus this ratio. Values are clamped to 0..1. + /// + public double JitterRatio { get; set; } = 0.2D; + + /// + /// Whether Retry-After response headers should control retry delay when present. + /// + public bool UseRetryAfterHeader { get; set; } = true; + + /// + /// Whether a rate-limit reset response header should control retry delay when present. + /// + public bool UseRateLimitResetHeader { get; set; } + + /// + /// Optional provider-specific rate-limit reset header name. Values may be Unix seconds or an HTTP date. + /// + public string? RateLimitResetHeaderName { get; set; } = "X-RateLimit-Reset"; } @@ -231,6 +267,16 @@ public sealed class AutoSDKHookContext /// public bool WillRetry { get; set; } + /// + /// The computed retry delay when is true. + /// + public global::System.TimeSpan? RetryDelay { get; set; } + + /// + /// A short retry reason such as exception or status:429. + /// + public string RetryReason { get; set; } = string.Empty; + /// /// The effective cancellation token for the current request attempt. /// @@ -254,6 +300,8 @@ internal static class AutoSDKRequestOptionsSupport int attempt, int maxAttempts, bool willRetry, + global::System.TimeSpan? retryDelay, + string retryReason, global::System.Threading.CancellationToken cancellationToken) { return new global::Mistral.AutoSDKHookContext @@ -271,6 +319,8 @@ internal static class AutoSDKRequestOptionsSupport Attempt = attempt, MaxAttempts = maxAttempts, WillRetry = willRetry, + RetryDelay = retryDelay, + RetryReason = retryReason ?? string.Empty, CancellationToken = cancellationToken, }; } @@ -338,19 +388,188 @@ internal static int GetMaxAttempts( return maxAttempts < 1 ? 1 : maxAttempts; } - internal static async global::System.Threading.Tasks.Task DelayBeforeRetryAsync( + internal static global::System.TimeSpan GetRetryDelay( global::Mistral.AutoSDKClientOptions clientOptions, global::Mistral.AutoSDKRequestOptions? requestOptions, + global::System.Net.Http.HttpResponseMessage? response, + int attempt) + { + var retryOptions = requestOptions?.Retry ?? clientOptions.Retry ?? new global::Mistral.AutoSDKRetryOptions(); + + if (retryOptions.UseRetryAfterHeader && + TryGetRetryAfterDelay(response, out var retryAfterDelay)) + { + return ClampRetryDelay(retryAfterDelay, retryOptions); + } + + if (retryOptions.UseRateLimitResetHeader && + TryGetRateLimitResetDelay(response, retryOptions.RateLimitResetHeaderName, out var rateLimitResetDelay)) + { + return ClampRetryDelay(rateLimitResetDelay, retryOptions); + } + + if (retryOptions.Delay.HasValue) + { + return ClampRetryDelay(retryOptions.Delay.Value, retryOptions); + } + + var initialDelay = retryOptions.InitialDelay; + if (initialDelay <= global::System.TimeSpan.Zero) + { + return global::System.TimeSpan.Zero; + } + + var multiplier = retryOptions.BackoffMultiplier < 1D ? 1D : retryOptions.BackoffMultiplier; + var exponent = attempt <= 1 ? 0 : attempt - 1; + var delayMilliseconds = initialDelay.TotalMilliseconds * global::System.Math.Pow(multiplier, exponent); + if (double.IsNaN(delayMilliseconds) || double.IsInfinity(delayMilliseconds) || delayMilliseconds < 0D) + { + delayMilliseconds = 0D; + } + + var delay = global::System.TimeSpan.FromMilliseconds(delayMilliseconds); + delay = ApplyJitter(delay, retryOptions.JitterRatio); + return ClampRetryDelay(delay, retryOptions); + } + + internal static async global::System.Threading.Tasks.Task DelayBeforeRetryAsync( + global::System.TimeSpan retryDelay, global::System.Threading.CancellationToken cancellationToken) { - var delay = requestOptions?.Retry?.Delay ?? - clientOptions.Retry?.Delay; - if (!delay.HasValue || delay.Value <= global::System.TimeSpan.Zero) + if (retryDelay <= global::System.TimeSpan.Zero) { return; } - await global::System.Threading.Tasks.Task.Delay(delay.Value, cancellationToken).ConfigureAwait(false); + await global::System.Threading.Tasks.Task.Delay(retryDelay, cancellationToken).ConfigureAwait(false); + } + + private static bool TryGetRetryAfterDelay( + global::System.Net.Http.HttpResponseMessage? response, + out global::System.TimeSpan delay) + { + delay = global::System.TimeSpan.Zero; + var retryAfter = response?.Headers.RetryAfter; + if (retryAfter == null) + { + return false; + } + + if (retryAfter.Delta.HasValue) + { + delay = retryAfter.Delta.Value; + return delay > global::System.TimeSpan.Zero; + } + + if (retryAfter.Date.HasValue) + { + delay = retryAfter.Date.Value - global::System.DateTimeOffset.UtcNow; + return delay > global::System.TimeSpan.Zero; + } + + return false; + } + + private static bool TryGetRateLimitResetDelay( + global::System.Net.Http.HttpResponseMessage? response, + string? headerName, + out global::System.TimeSpan delay) + { + delay = global::System.TimeSpan.Zero; + if (response == null || string.IsNullOrWhiteSpace(headerName)) + { + return false; + } + + if (!response.Headers.TryGetValues(headerName, out var values) && + (response.Content?.Headers == null || !response.Content.Headers.TryGetValues(headerName, out values))) + { + return false; + } + + var value = global::System.Linq.Enumerable.FirstOrDefault(values); + if (string.IsNullOrWhiteSpace(value)) + { + return false; + } + + value = value.Trim(); + if (long.TryParse( + value, + global::System.Globalization.NumberStyles.Integer, + global::System.Globalization.CultureInfo.InvariantCulture, + out var unixSeconds)) + { + delay = global::System.DateTimeOffset.FromUnixTimeSeconds(unixSeconds) - global::System.DateTimeOffset.UtcNow; + return delay > global::System.TimeSpan.Zero; + } + + if (global::System.DateTimeOffset.TryParse( + value, + global::System.Globalization.CultureInfo.InvariantCulture, + global::System.Globalization.DateTimeStyles.AssumeUniversal | global::System.Globalization.DateTimeStyles.AdjustToUniversal, + out var resetAt)) + { + delay = resetAt - global::System.DateTimeOffset.UtcNow; + return delay > global::System.TimeSpan.Zero; + } + + return false; + } + + private static global::System.TimeSpan ApplyJitter( + global::System.TimeSpan delay, + double jitterRatio) + { + if (delay <= global::System.TimeSpan.Zero || jitterRatio <= 0D) + { + return delay; + } + + if (jitterRatio > 1D) + { + jitterRatio = 1D; + } + + var sample = NextJitterSample(); + var multiplier = 1D - jitterRatio + (sample * jitterRatio * 2D); + var milliseconds = delay.TotalMilliseconds * multiplier; + if (double.IsNaN(milliseconds) || double.IsInfinity(milliseconds) || milliseconds < 0D) + { + milliseconds = 0D; + } + + return global::System.TimeSpan.FromMilliseconds(milliseconds); + } + + private static double NextJitterSample() + { + var bytes = new byte[8]; + using (var randomNumberGenerator = global::System.Security.Cryptography.RandomNumberGenerator.Create()) + { + randomNumberGenerator.GetBytes(bytes); + } + + var value = global::System.BitConverter.ToUInt64(bytes, 0); + return value / (double)ulong.MaxValue; + } + + private static global::System.TimeSpan ClampRetryDelay( + global::System.TimeSpan delay, + global::Mistral.AutoSDKRetryOptions retryOptions) + { + if (delay <= global::System.TimeSpan.Zero) + { + return global::System.TimeSpan.Zero; + } + + var maxDelay = retryOptions.MaxDelay; + if (maxDelay > global::System.TimeSpan.Zero && delay > maxDelay) + { + return maxDelay; + } + + return delay; } internal static bool ShouldRetryStatusCode( diff --git a/src/libs/Mistral/Generated/Mistral.ResponseStream.g.cs b/src/libs/Mistral/Generated/Mistral.ResponseStream.g.cs new file mode 100644 index 00000000..bc5c9400 --- /dev/null +++ b/src/libs/Mistral/Generated/Mistral.ResponseStream.g.cs @@ -0,0 +1,117 @@ + +#nullable enable + +namespace Mistral +{ + internal sealed class ResponseStream : global::System.IO.Stream + { + private readonly global::System.Net.Http.HttpResponseMessage _response; + private readonly global::System.IO.Stream _stream; + private bool _disposed; + + public ResponseStream( + global::System.Net.Http.HttpResponseMessage response, + global::System.IO.Stream stream) + { + _response = response ?? throw new global::System.ArgumentNullException(nameof(response)); + _stream = stream ?? throw new global::System.ArgumentNullException(nameof(stream)); + } + + public override bool CanRead => _stream.CanRead; + public override bool CanSeek => _stream.CanSeek; + public override bool CanWrite => _stream.CanWrite; + public override bool CanTimeout => _stream.CanTimeout; + public override long Length => _stream.Length; + + public override long Position + { + get => _stream.Position; + set => _stream.Position = value; + } + + public override int ReadTimeout + { + get => _stream.ReadTimeout; + set => _stream.ReadTimeout = value; + } + + public override int WriteTimeout + { + get => _stream.WriteTimeout; + set => _stream.WriteTimeout = value; + } + + public override void Flush() => _stream.Flush(); + + public override global::System.Threading.Tasks.Task FlushAsync( + global::System.Threading.CancellationToken cancellationToken) => + _stream.FlushAsync(cancellationToken); + + public override int Read(byte[] buffer, int offset, int count) => + _stream.Read(buffer, offset, count); + + public override global::System.Threading.Tasks.Task ReadAsync( + byte[] buffer, + int offset, + int count, + global::System.Threading.CancellationToken cancellationToken) => + _stream.ReadAsync(buffer, offset, count, cancellationToken); + +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_0_OR_GREATER || NET5_0_OR_GREATER + public override global::System.Threading.Tasks.ValueTask ReadAsync( + global::System.Memory buffer, + global::System.Threading.CancellationToken cancellationToken = default) => + _stream.ReadAsync(buffer, cancellationToken); +#endif + + public override long Seek(long offset, global::System.IO.SeekOrigin origin) => + _stream.Seek(offset, origin); + + public override void SetLength(long value) => + _stream.SetLength(value); + + public override void Write(byte[] buffer, int offset, int count) => + _stream.Write(buffer, offset, count); + + public override global::System.Threading.Tasks.Task WriteAsync( + byte[] buffer, + int offset, + int count, + global::System.Threading.CancellationToken cancellationToken) => + _stream.WriteAsync(buffer, offset, count, cancellationToken); + +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_0_OR_GREATER || NET5_0_OR_GREATER + public override global::System.Threading.Tasks.ValueTask WriteAsync( + global::System.ReadOnlyMemory buffer, + global::System.Threading.CancellationToken cancellationToken = default) => + _stream.WriteAsync(buffer, cancellationToken); +#endif + + protected override void Dispose(bool disposing) + { + if (!_disposed && disposing) + { + _disposed = true; + _stream.Dispose(); + _response.Dispose(); + } + + base.Dispose(disposing); + } + +#if NETSTANDARD2_1_OR_GREATER || NETCOREAPP3_0_OR_GREATER || NET5_0_OR_GREATER + public override async global::System.Threading.Tasks.ValueTask DisposeAsync() + { + if (_disposed) + { + return; + } + + _disposed = true; + await _stream.DisposeAsync().ConfigureAwait(false); + _response.Dispose(); + await base.DisposeAsync().ConfigureAwait(false); + } +#endif + } +} \ No newline at end of file